[Rust] add support for optionally compiling libc functions (#763)

* add SNMALLOC_RUST_LIBC_API option
This commit is contained in:
Will Brown
2025-04-03 08:56:41 -04:00
committed by GitHub
parent 59987ca908
commit e6bf8570d0
2 changed files with 12 additions and 1 deletions

View File

@@ -1,5 +1,11 @@
#define SNMALLOC_NAME_MANGLE(a) sn_##a
#include "snmalloc/snmalloc.h"
// The libc API provided by malloc.cc will always be mangled per above.
#ifdef SNMALLOC_RUST_LIBC_API
# include "malloc.cc"
#else
# include "snmalloc/snmalloc.h"
#endif
#include <string.h>