mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-05-30 08:37:29 +03:00
Fix locking in arena_dirty_count().
This was a latent bug, since the function is (intentionally) not used.
This commit is contained in:
parent
363629df88
commit
d0a3129b88
1 changed files with 3 additions and 1 deletions
|
|
@ -639,12 +639,14 @@ arena_dirty_count(tsdn_t *tsdn, arena_t *arena)
|
|||
extent_t *extent;
|
||||
size_t ndirty = 0;
|
||||
|
||||
malloc_mutex_assert_owner(tsdn, &arena->extents_mtx);
|
||||
malloc_mutex_lock(tsdn, &arena->extents_mtx);
|
||||
|
||||
for (extent = qr_next(&arena->extents_dirty, qr_link); extent !=
|
||||
&arena->extents_dirty; extent = qr_next(extent, qr_link))
|
||||
ndirty += extent_size_get(extent) >> LG_PAGE;
|
||||
|
||||
malloc_mutex_unlock(tsdn, &arena->extents_mtx);
|
||||
|
||||
return (ndirty);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue