diff options
author | David Goldblatt <davidgoldblatt@fb.com> | 2017-04-01 02:59:45 (GMT) |
---|---|---|
committer | David Goldblatt <davidtgoldblatt@gmail.com> | 2017-04-07 21:10:27 (GMT) |
commit | b407a65401bca5828760c8fd5e940e91475a2b3e (patch) | |
tree | a1bbd2e2fccd51153f126a228a07491259b44730 /test/unit | |
parent | 0a0fcd3e6a0816f0a56fa852416d0ece861c0abb (diff) | |
download | jemalloc-b407a65401bca5828760c8fd5e940e91475a2b3e.zip jemalloc-b407a65401bca5828760c8fd5e940e91475a2b3e.tar.gz jemalloc-b407a65401bca5828760c8fd5e940e91475a2b3e.tar.bz2 |
Add basic reentrancy-checking support, and allow arena_new to reenter.
This checks whether or not we're reentrant using thread-local data, and, if we
are, moves certain internal allocations to use arena 0 (which should be properly
initialized after bootstrapping).
The immediate thing this allows is spinning up threads in arena_new, which will
enable spinning up background threads there.
Diffstat (limited to 'test/unit')
-rw-r--r-- | test/unit/stats.c | 2 | ||||
-rw-r--r-- | test/unit/tsd.c | 3 |
2 files changed, 2 insertions, 3 deletions
diff --git a/test/unit/stats.c b/test/unit/stats.c index f8c6b10..1619f5b 100644 --- a/test/unit/stats.c +++ b/test/unit/stats.c @@ -351,7 +351,7 @@ TEST_END int main(void) { - return test( + return test_no_reentrancy( test_stats_summary, test_stats_large, test_stats_arenas_summary, diff --git a/test/unit/tsd.c b/test/unit/tsd.c index 4a0f318..3811467 100644 --- a/test/unit/tsd.c +++ b/test/unit/tsd.c @@ -79,7 +79,6 @@ thd_start(void *arg) { } TEST_BEGIN(test_tsd_main_thread) { - test_skip_if(test_is_reentrant()); thd_start((void *)(uintptr_t)0xa5f3e329); } TEST_END @@ -144,7 +143,7 @@ main(void) { data_tsd_boot(); data_test_started = true; - return test( + return test_no_reentrancy( test_tsd_main_thread, test_tsd_sub_thread, test_tsd_reincarnation); |