Skip to content
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

co::shared & co::unique 存在问题 #360

Closed
ChrisCatCP opened this issue Apr 4, 2024 · 5 comments
Closed

co::shared & co::unique 存在问题 #360

ChrisCatCP opened this issue Apr 4, 2024 · 5 comments

Comments

@ChrisCatCP
Copy link

目前的实现会直接实例化一个T

struct S { T o; size_t n; };
//构造S的时候会实例化T  当T为纯虚基类的时候无法实例化
@ChrisCatCP
Copy link
Author

并且这里的n我也不理解存在什么作用

@idealvin
Copy link
Owner

idealvin commented Sep 4, 2024

修复了,见 这里

@idealvin
Copy link
Owner

idealvin commented Sep 4, 2024

并且这里的n我也不理解存在什么作用

释放内存需要知道内存大小

@ChrisCatCP
Copy link
Author

并且这里的n我也不理解存在什么作用

释放内存需要知道内存大小

大小不就是sizeof(S)吗。。。

@ChrisCatCP
Copy link
Author

并且我发现存在内存泄漏,运行环境是centos6/7,我看到有人提交了相同的issues我就不提交了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants