From 7b8cac7931edce44c3b4f4eb2ac22fefe36484a4 Mon Sep 17 00:00:00 2001 From: ryancinsight <55164720+ryancinsight@users.noreply.github.com> Date: Wed, 3 Mar 2021 04:58:17 -0500 Subject: [PATCH] Add to rust surface standard C style API (#290) The existing snmalloc Rust surface only exposes the calls required by the Rust global allocator. As Rust knows the size of objects it provides those to the allocator, which snmalloc takes advantage of. This PR, exposes the standard C API for allocation as well with the prefix `sn_`, so that unsafe code can potentially take advantage of using the same allocator. --- src/override/rust.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/override/rust.cc b/src/override/rust.cc index a8597e6..b6c0834 100644 --- a/src/override/rust.cc +++ b/src/override/rust.cc @@ -1,5 +1,5 @@ -#include "../mem/slowalloc.h" -#include "../snmalloc.h" +#define SNMALLOC_NAME_MANGLE(a) sn_##a +#include "malloc.cc" #include