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
@ -639,12 +639,14 @@ arena_dirty_count(tsdn_t *tsdn, arena_t *arena)
|
|||||||
extent_t *extent;
|
extent_t *extent;
|
||||||
size_t ndirty = 0;
|
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 !=
|
for (extent = qr_next(&arena->extents_dirty, qr_link); extent !=
|
||||||
&arena->extents_dirty; extent = qr_next(extent, qr_link))
|
&arena->extents_dirty; extent = qr_next(extent, qr_link))
|
||||||
ndirty += extent_size_get(extent) >> LG_PAGE;
|
ndirty += extent_size_get(extent) >> LG_PAGE;
|
||||||
|
|
||||||
|
malloc_mutex_unlock(tsdn, &arena->extents_mtx);
|
||||||
|
|
||||||
return (ndirty);
|
return (ndirty);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user