diff options
| author | Vladimir Chtchetkine <vchtchetkine@google.com> | 2010-02-17 13:43:15 -0800 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-02-17 13:43:15 -0800 |
| commit | b55462328f7f7468bb8c0cb44ad1069af30415a3 (patch) | |
| tree | 291cf73e304ef6840de39e4732d0d8488955f22b /libc/bionic/malloc_debug_common.h | |
| parent | f31fceaae66dcc1f71f930ed8f2a777b80fe415f (diff) | |
| parent | 75fba6888a1e5738f8255f3511c4ad40cbcc0eda (diff) | |
| download | bionic-b55462328f7f7468bb8c0cb44ad1069af30415a3.zip bionic-b55462328f7f7468bb8c0cb44ad1069af30415a3.tar.gz bionic-b55462328f7f7468bb8c0cb44ad1069af30415a3.tar.bz2 | |
Merge "Merge memory checking functionality from sandbox"
Diffstat (limited to 'libc/bionic/malloc_debug_common.h')
| -rw-r--r-- | libc/bionic/malloc_debug_common.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/libc/bionic/malloc_debug_common.h b/libc/bionic/malloc_debug_common.h index a6301b3..87600d6 100644 --- a/libc/bionic/malloc_debug_common.h +++ b/libc/bionic/malloc_debug_common.h @@ -70,13 +70,28 @@ struct HashTable { /* Entry in malloc dispatch table. */ typedef struct MallocDebug MallocDebug; struct MallocDebug { + /* Address of the actual malloc routine. */ void* (*malloc)(size_t bytes); + /* Address of the actual free routine. */ void (*free)(void* mem); + /* Address of the actual calloc routine. */ void* (*calloc)(size_t n_elements, size_t elem_size); + /* Address of the actual realloc routine. */ void* (*realloc)(void* oldMem, size_t bytes); + /* Address of the actual memalign routine. */ void* (*memalign)(size_t alignment, size_t bytes); }; +/* Malloc debugging initialization routine. + * This routine must be implemented in .so modules that implement malloc + * debugging. This routine is called once per process from malloc_init_impl + * routine implemented in bionic/libc/bionic/malloc_debug_common.c when malloc + * debugging gets initialized for the process. + * Return: + * 0 on success, -1 on failure. + */ +typedef int (*MallocDebugInit)(void); + #ifdef __cplusplus }; /* end of extern "C" */ #endif |
