export snmalloc::alloc_size to rust wrappers. (#676)

This commit is contained in:
David CARLIER
2024-09-19 16:54:56 +01:00
committed by GitHub
parent 8b95b9a916
commit d537d35268

View File

@@ -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);
}