Repository navigation
use allocator for split function - #29
Conversation
wjwwood
left a comment
There was a problem hiding this comment.
One issue I have with this pull request, is that the rcutils_string_array_fini() function uses free() no matter what. So if you use something other than the default allocator here, and do not clear the string array yourself, then you can get in a situation where you're calling free() on memory where malloc() was never called.
That being said, this is an incremental improvement, it is possible to do it correctly as-is, and in our common case right now it will just work since we always use the default allocator.
Separately the string array should either be setup with an allocator or it's fini function should not free the strings themselves.
|
I just pushed a new commit addressing this comment. I also ran new ci jobs
(which again I cannot link correctly here).
Changes affect rcutils, rmw_connext_cpp, rmw_fastrtps_cpp
thanks for hanging in there with me :)
…On Tue, Jun 13, 2017 at 7:42 PM, William Woodall ***@***.***> wrote:
***@***.**** approved this pull request.
One issue I have with this pull request, is that the
rcutils_string_array_fini() function uses free() no matter what. So if
you use something other than the default allocator here, and do not clear
the string array yourself, then you can get in a situation where you're
calling free() on memory where malloc() was never called.
That being said, this is an incremental improvement, it is possible to do
it correctly as-is, and in our common case right now it will just work
since we always use the default allocator.
Separately the string array should either be setup with an allocator or
it's fini function should not free the strings themselves.
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
<#29 (review)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AFKzYSm-Nwx_64-CDTvyvpEMDDPev7zQks5sD0iygaJpZM4NzWEj>
.
|
|
This also cannot be merged due to conflicts. @Karsten1987 you need to pull before you do stuff lol. |
3569aea to
3c7f240
Compare
|
@Karsten1987 nvm, that's my bad, GitHub's rendering was wrong somehow. |
(cherry picked from commit 55de2e1) Co-authored-by: Błażej Sowa <[email protected]>
connects to #6