mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-06-06 04:04:17 +03:00
Add hooking functionality
This allows us to hook chosen functions and do interesting things there (in particular: reentrancy checking).
This commit is contained in:
parent
36bd90b962
commit
0a0fcd3e6a
19 changed files with 183 additions and 11 deletions
|
|
@ -45,6 +45,7 @@ extern "C" {
|
|||
# define JEMALLOC_MANGLE
|
||||
# include "jemalloc/internal/jemalloc_internal.h"
|
||||
|
||||
|
||||
/******************************************************************************/
|
||||
/*
|
||||
* For integration tests, expose the public jemalloc interfaces, but only
|
||||
|
|
@ -68,6 +69,7 @@ static const bool config_debug =
|
|||
|
||||
# define JEMALLOC_N(n) @private_namespace@##n
|
||||
# include "jemalloc/internal/private_namespace.h"
|
||||
# include "jemalloc/internal/hooks.h"
|
||||
|
||||
/* Hermetic headers. */
|
||||
# include "jemalloc/internal/assert.h"
|
||||
|
|
|
|||
|
|
@ -310,6 +310,9 @@ label_test_end: \
|
|||
#define test(...) \
|
||||
p_test(__VA_ARGS__, NULL)
|
||||
|
||||
#define test_no_reentrancy(...) \
|
||||
p_test_no_reentrancy(__VA_ARGS__, NULL)
|
||||
|
||||
#define test_no_malloc_init(...) \
|
||||
p_test_no_malloc_init(__VA_ARGS__, NULL)
|
||||
|
||||
|
|
@ -321,11 +324,14 @@ label_test_end: \
|
|||
} \
|
||||
} while (0)
|
||||
|
||||
bool test_is_reentrant();
|
||||
|
||||
void test_skip(const char *format, ...) JEMALLOC_FORMAT_PRINTF(1, 2);
|
||||
void test_fail(const char *format, ...) JEMALLOC_FORMAT_PRINTF(1, 2);
|
||||
|
||||
/* For private use by macros. */
|
||||
test_status_t p_test(test_t *t, ...);
|
||||
test_status_t p_test_no_reentrancy(test_t *t, ...);
|
||||
test_status_t p_test_no_malloc_init(test_t *t, ...);
|
||||
void p_test_init(const char *name);
|
||||
void p_test_fini(void);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue