Add support for scudo svelte.

Bug: 137795072

Test: Built with scudo and scudo svelte.
Change-Id: Ib2afd5249b897b818012ee71547af1f4ee60201b
This commit is contained in:
Christopher Ferris 2019-12-16 16:22:55 -08:00
parent 5761dd85b6
commit e1fd409fcb
3 changed files with 35 additions and 1 deletions

View File

@ -127,9 +127,18 @@ cc_defaults {
name: "libc_scudo_defaults",
cflags: [
"-DUSE_SCUDO",
"-DUSE_SCUDO_SVELTE",
],
product_variables: {
malloc_not_svelte: {
cflags: [
"-UUSE_SCUDO_SVELTE",
"-DUSE_SCUDO",
],
},
},
whole_static_libs: [
"libscudo",
],

View File

@ -60,6 +60,11 @@ __END_DECLS
#include "scudo.h"
#define Malloc(function) scudo_ ## function
#elif defined(USE_SCUDO_SVELTE)
#include "scudo.h"
#define Malloc(function) scudo_svelte_ ## function
#else
#include "jemalloc.h"

View File

@ -56,4 +56,24 @@ int scudo_malloc_iterate(uintptr_t, size_t, void (*)(uintptr_t, size_t, void*),
void scudo_malloc_disable();
void scudo_malloc_enable();
void* scudo_svelte_aligned_alloc(size_t, size_t);
void* scudo_svelte_calloc(size_t, size_t);
void scudo_svelte_free(void*);
struct mallinfo scudo_svelte_mallinfo();
void* scudo_svelte_malloc(size_t);
int scudo_svelte_malloc_info(int, FILE*);
size_t scudo_svelte_malloc_usable_size(const void*);
int scudo_svelte_mallopt(int, int);
void* scudo_svelte_memalign(size_t, size_t);
void* scudo_svelte_realloc(void*, size_t);
int scudo_svelte_posix_memalign(void**, size_t, size_t);
#if defined(HAVE_DEPRECATED_MALLOC_FUNCS)
void* scudo_svelte_pvalloc(size_t);
void* scudo_svelte_valloc(size_t);
#endif
int scudo_svelte_malloc_iterate(uintptr_t, size_t, void (*)(uintptr_t, size_t, void*), void*);
void scudo_svelte_malloc_disable();
void scudo_svelte_malloc_enable();
__END_DECLS