Skip to content

Commit

Permalink
export snmalloc::alloc_size to rust wrappers.
Browse files Browse the repository at this point in the history
  • Loading branch information
devnexen committed Sep 15, 2024
1 parent 8b95b9a commit 380e338
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/snmalloc/override/rust.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,10 @@ extern "C" SNMALLOC_EXPORT void SNMALLOC_NAME_MANGLE(rust_statistics)(
{
*current_memory_usage = Alloc::Config::Backend::get_current_usage();
*peak_memory_usage = Alloc::Config::Backend::get_peak_usage();
}
}

extern "C" SNMALLOC_EXPORT size_t SNMALLOC_NAME_MANGLE(rust_usable_size)(
const void *ptr)
{
return ThreadAlloc::get().alloc_size(ptr);
}

0 comments on commit 380e338

Please sign in to comment.