mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-05-17 18:36:21 +03:00
Fix malloc_mutex_[un]lock() to conditionally check witness.
Also remove tautological cassert(config_debug) calls.
This commit is contained in:
parent
d9394d0ca8
commit
1b5830178f
2 changed files with 2 additions and 12 deletions
|
|
@ -81,7 +81,8 @@ malloc_mutex_lock(tsd_t *tsd, malloc_mutex_t *mutex)
|
|||
{
|
||||
|
||||
if (isthreaded) {
|
||||
witness_assert_not_owner(tsd, &mutex->witness);
|
||||
if (config_debug)
|
||||
witness_assert_not_owner(tsd, &mutex->witness);
|
||||
#ifdef _WIN32
|
||||
# if _WIN32_WINNT >= 0x0600
|
||||
AcquireSRWLockExclusive(&mutex->lock);
|
||||
|
|
@ -103,7 +104,6 @@ malloc_mutex_unlock(tsd_t *tsd, malloc_mutex_t *mutex)
|
|||
{
|
||||
|
||||
if (isthreaded) {
|
||||
witness_assert_owner(tsd, &mutex->witness);
|
||||
if (config_debug)
|
||||
witness_unlock(tsd, &mutex->witness);
|
||||
#ifdef _WIN32
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue