jemallocator
jemallocator copied to clipboard
Support `prof.dump` for jemalloc-ctl.
I'm trying to implement prof.dump for jemalloc but I met some problems that can be generally applied to all functions that take a string argument.
The write interface usually take a &'static str as an input argument, however, the raw::write_str take a C-style string the end with \0. I can think of two solutions:
- Take
ffi::CStras input. Let users pass a C-style string. - include
allocinjemalloc-ctland convert a Rust-style "`&'static str" to a C-stype string.
Could you let me what is the best practice for this? Thanks!
CStr should be used.
Okay, I'll submit a pr later