mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-08-26 00:53:34 +03:00
Add witness_assert_depth[_to_rank]().
This makes it possible to make lock state assertions about precisely which locks are held.
This commit is contained in:
parent
7034e6baa1
commit
f56cb9a68e
7 changed files with 141 additions and 107 deletions
|
|
@ -591,7 +591,7 @@ arena_chunk_alloc_internal_hard(tsdn_t *tsdn, arena_t *arena,
|
|||
size_t sn;
|
||||
|
||||
malloc_mutex_unlock(tsdn, &arena->lock);
|
||||
witness_assert_lock_depth(tsdn, 0); /* prof_gdump() requirement. */
|
||||
witness_assert_lockless(tsdn); /* prof_gdump() requirement. */
|
||||
|
||||
chunk = (arena_chunk_t *)chunk_alloc_wrapper(tsdn, arena, chunk_hooks,
|
||||
NULL, chunksize, chunksize, &sn, zero, commit);
|
||||
|
|
@ -633,7 +633,7 @@ arena_chunk_alloc_internal(tsdn_t *tsdn, arena_t *arena, bool *zero,
|
|||
size_t sn;
|
||||
|
||||
/* prof_gdump() requirement. */
|
||||
witness_assert_lock_depth(tsdn, 1);
|
||||
witness_assert_depth(tsdn, 1);
|
||||
malloc_mutex_assert_owner(tsdn, &arena->lock);
|
||||
|
||||
chunk = chunk_alloc_cache(tsdn, arena, &chunk_hooks, NULL, chunksize,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue