summaryrefslogtreecommitdiffstats
path: root/libc/bionic/malloc_debug_common.h
diff options
context:
space:
mode:
Diffstat (limited to 'libc/bionic/malloc_debug_common.h')
-rw-r--r--libc/bionic/malloc_debug_common.h15
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