Skip to content

Commit d537d35

Browse files
authored
export snmalloc::alloc_size to rust wrappers. (#676)
1 parent 8b95b9a commit d537d35

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/snmalloc/override/rust.cc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,10 @@ extern "C" SNMALLOC_EXPORT void SNMALLOC_NAME_MANGLE(rust_statistics)(
5050
{
5151
*current_memory_usage = Alloc::Config::Backend::get_current_usage();
5252
*peak_memory_usage = Alloc::Config::Backend::get_peak_usage();
53-
}
53+
}
54+
55+
extern "C" SNMALLOC_EXPORT size_t
56+
SNMALLOC_NAME_MANGLE(rust_usable_size)(const void* ptr)
57+
{
58+
return ThreadAlloc::get().alloc_size(ptr);
59+
}

0 commit comments

Comments
 (0)