-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: replace new/delete with smart pointers #1493
Merged
AlexStocks
merged 28 commits into
OpenAtomFoundation:unstable
from
pika-remove-new:unstable
May 22, 2023
Merged
fix: replace new/delete with smart pointers #1493
AlexStocks
merged 28 commits into
OpenAtomFoundation:unstable
from
pika-remove-new:unstable
May 22, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ps: Not all new/delete are eliminated, as there are some variables that are not suitable for applying smart ptr, such as handle_, response_, request_ etc..., I chose to keep them as they were.
iiiuwioajdks
changed the title
使用智能指针替换 new/delete
replace new/delete with smart pointers
May 12, 2023
涉及 #1477 的部分修改 |
AlexStocks
reviewed
May 12, 2023
loveyacper
reviewed
May 12, 2023
loveyacper
reviewed
May 12, 2023
把 PR 的标题都改一下 |
[task #xxx] msg 这种格式,这样可以直接关联到 issue |
iiiuwioajdks
changed the title
replace new/delete with smart pointers
[task #1477]replace new/delete with smart pointers
May 13, 2023
…to unstable merged modification in src/net into unstable branch
AlexStocks
approved these changes
May 14, 2023
AlexStocks
reviewed
May 14, 2023
wanghenshui
changed the title
[task #1477]replace new/delete with smart pointers
fix: replace new/delete with smart pointers
May 15, 2023
评论 |
wanghenshui
reviewed
May 15, 2023
iiiuwioajdks
changed the title
fix: replace new/delete with smart pointers
[WIP]fix: replace new/delete with smart pointers
May 16, 2023
AlexStocks
reviewed
May 16, 2023
wanghenshui
reviewed
May 17, 2023
iiiuwioajdks
changed the title
[WIP]fix: replace new/delete with smart pointers
fix: replace new/delete with smart pointers
May 19, 2023
AlexStocks
reviewed
May 20, 2023
chejinge
approved these changes
May 22, 2023
chejinge
approved these changes
May 22, 2023
Seems you are using me but didn't get OPENAI_API_KEY seted in Variables/Secrets for this repo. you could follow readme for more information |
bigdaronlee163
pushed a commit
to bigdaronlee163/pika
that referenced
this pull request
Jun 8, 2024
* [feat] change storage new/del to smartp * Eliminated new/delete using smart ptr within src/net/. ps: Not all new/delete are eliminated, as there are some variables that are not suitable for applying smart ptr, such as handle_, response_, request_ etc..., I chose to keep them as they were. * [feat] replace new/delete with smart pointers * fix build * change shared_ptr to unique_ptr * change to auto * feat * removed an unnecessary shared_ptr and use unique_ptr instead. * change pstd/ * revised a comment * change pstd implement * remove code of jh * fix tools build * fix * feature * fix * fix --------- Co-authored-by: cjh <[email protected]> Co-authored-by: laimuxi <[email protected]>
cheniujh
added a commit
to cheniujh/pika
that referenced
this pull request
Sep 24, 2024
* [feat] change storage new/del to smartp * Eliminated new/delete using smart ptr within src/net/. ps: Not all new/delete are eliminated, as there are some variables that are not suitable for applying smart ptr, such as handle_, response_, request_ etc..., I chose to keep them as they were. * [feat] replace new/delete with smart pointers * fix build * change shared_ptr to unique_ptr * change to auto * feat * removed an unnecessary shared_ptr and use unique_ptr instead. * change pstd/ * revised a comment * change pstd implement * remove code of jh * fix tools build * fix * feature * fix * fix --------- Co-authored-by: cjh <[email protected]> Co-authored-by: laimuxi <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fix #1477
存在 shared_ptr 的三处地方:
1.析构函数会有互相调用的问题
2.lock 之前的设计就是 shared_ptr,这方面暂时没改,就迎合之前的设计
3.Partition 类是 enable_shared_from_this 的,里面的字段设置成 shared_ptr 会更合理
目前除 net 包下由 chenjunhua 完成外,其余的已经基本完成,还有剩下的几个指针比较难改造,可以之后对代码更熟悉之后另开 pr