Skip to content

Conversation

@gongweibao
Copy link
Contributor

Fix #10155

Copy link
Contributor

@typhoonzero typhoonzero left a comment

Choose a reason for hiding this comment

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

LGTM, Thanks for finding this bug, it should be hard.

DestroyCallback destroy_callback = [](void* backing) {};

void* buf = malloc(1024);
auto buffer = std::unique_ptr<char[]>(new char[1024]);
Copy link
Contributor

@panyx0718 panyx0718 Apr 24, 2018

Choose a reason for hiding this comment

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

I think it's ok for now. Is it possible to statically create it? Maybe it's faster?
char char_buf[1024];
void* buffer = static_cast<void*>(char_buf)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe it change to be larger later? ^_^

@gongweibao gongweibao merged commit fc025f5 into PaddlePaddle:develop Apr 24, 2018
@gongweibao gongweibao deleted the fixmemleak branch April 25, 2018 07:05
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

Successfully merging this pull request may close these issues.

3 participants