diff options
| author | David Goldblatt <davidgoldblatt@fb.com> | 2017-03-28 17:30:54 -0700 |
|---|---|---|
| committer | David Goldblatt <davidtgoldblatt@gmail.com> | 2017-04-07 14:10:27 -0700 |
| commit | 0a0fcd3e6a0816f0a56fa852416d0ece861c0abb (patch) | |
| tree | 49b3c934dd8308e7c3bf31692184ef72bb1e8a0d /test/include | |
| parent | 36bd90b96212772f1adbd421a6b091b542278995 (diff) | |
| download | platform_external_jemalloc_new-0a0fcd3e6a0816f0a56fa852416d0ece861c0abb.tar.gz platform_external_jemalloc_new-0a0fcd3e6a0816f0a56fa852416d0ece861c0abb.tar.bz2 platform_external_jemalloc_new-0a0fcd3e6a0816f0a56fa852416d0ece861c0abb.zip | |
Add hooking functionality
This allows us to hook chosen functions and do interesting things there (in
particular: reentrancy checking).
Diffstat (limited to 'test/include')
| -rw-r--r-- | test/include/test/jemalloc_test.h.in | 2 | ||||
| -rw-r--r-- | test/include/test/test.h | 6 |
2 files changed, 8 insertions, 0 deletions
diff --git a/test/include/test/jemalloc_test.h.in b/test/include/test/jemalloc_test.h.in index 0770d020..e3882b29 100644 --- a/test/include/test/jemalloc_test.h.in +++ b/test/include/test/jemalloc_test.h.in @@ -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" diff --git a/test/include/test/test.h b/test/include/test/test.h index d7f05fad..fd0e5265 100644 --- a/test/include/test/test.h +++ b/test/include/test/test.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); |
