Skip to content
This repository has been archived by the owner on Jun 23, 2022. It is now read-only.

rpc: remove c interface of dsn message #151

Merged
merged 2 commits into from
Aug 20, 2018
Merged

Conversation

shengofsun
Copy link
Contributor

No description provided.

@shengofsun
Copy link
Contributor Author

这个pr看着吓人,但其实不复杂,大家都认真看一看。
主要就是把dsn_message_t替换成了dsn::message_ex*, 然后把相应的c函数替换为成员函数或者静态成员函数。

这么做的原因:

  1. 以前大家在使用dsn_message_t还是dsn::message_ex*上很纠结,包括资深的工程师们也会用错。这里索性整合一下,没有这么多选择。
  2. dsn_message_t完全无法使用智能指针进行管理,这里把cpp的类暴露出来,同时添加了message_ptr这样一个类型。这样以后就可以采用智能指针了(当然,如果是rpc处理,优先使用rpc_holder)
  3. 多一个c函数的调用层,又混乱,还拖累性能。

看这个pr时候的主要注意点:

  1. 我在把一些c接口转为成员函数的时候,之前的引用计数的次数有没有变掉。
  2. 在替换方法的时候,有没有把函数手滑写错之类的。比如本来原来是dsn_msg_release_ref, 有没有手滑改成msg->add_ref()

neverchanje
neverchanje previously approved these changes Aug 13, 2018
Copy link
Contributor

@neverchanje neverchanje left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@qinzuoyan qinzuoyan merged commit 184e7be into XiaoMi:master Aug 20, 2018
@qinzuoyan qinzuoyan mentioned this pull request Aug 20, 2018
28 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants