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.
This commit is contained in:
ryancinsight
2021-03-03 04:58:17 -05:00
committed by GitHub
parent a554703151
commit 7b8cac7931

View File

@@ -1,5 +1,5 @@
#include "../mem/slowalloc.h"
#include "../snmalloc.h"
#define SNMALLOC_NAME_MANGLE(a) sn_##a
#include "malloc.cc"
#include <cstring>