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

Support prof.dump for jemalloc-ctl. #60

Open
yuhao-su opened this issue Jul 20, 2023 · 2 comments
Open

Support prof.dump for jemalloc-ctl. #60

yuhao-su opened this issue Jul 20, 2023 · 2 comments

Comments

@yuhao-su
Copy link

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:

  1. Take ffi::CStr as input. Let users pass a C-style string.
  2. include alloc in jemalloc-ctl and convert a Rust-style "`&'static str" to a C-stype string.

Could you let me what is the best practice for this? Thanks!

@BusyJay
Copy link
Member

BusyJay commented Jul 21, 2023

CStr should be used.

@yuhao-su
Copy link
Author

Okay, I'll submit a pr later

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