You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Let user specify function to use for freeing foreign buffers #8465
Pull #8296 adds a type (CString) to wrap char pointers returned from C code into Rust strings. The Drop impl on CString function always calls libc::free(). This is not generally correct on Windows.
On Windows, each function or API specifies which free()-like function to use. Not using the correct function will cause problems.
I don't know Rust well enough to say what the correct fix is. Maybe pass in a function pointer to the constructor that is called at drop? The pointer could replace the "owns_buffer" bool if we use an optional pointer.
Activity
emberian commentedon Jan 6, 2014
Presumably allocator parameterization would solve this. But it's such a hairball to deal with.
alexcrichton commentedon Jan 19, 2015
This was resolved in #20507
Merge rust-lang#8465