mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-08-01 16:10:30 +03:00
Guard prof_active reset by opt_prof
Set `prof_active` to read-only when `opt_prof` is turned off.
This commit is contained in:
parent
1df9dd3515
commit
beb7c16e94
4 changed files with 49 additions and 2 deletions
|
|
@ -788,6 +788,7 @@ bool
|
|||
prof_active_get(tsdn_t *tsdn) {
|
||||
bool prof_active_current;
|
||||
|
||||
prof_active_assert();
|
||||
malloc_mutex_lock(tsdn, &prof_active_mtx);
|
||||
prof_active_current = prof_active;
|
||||
malloc_mutex_unlock(tsdn, &prof_active_mtx);
|
||||
|
|
@ -798,10 +799,12 @@ bool
|
|||
prof_active_set(tsdn_t *tsdn, bool active) {
|
||||
bool prof_active_old;
|
||||
|
||||
prof_active_assert();
|
||||
malloc_mutex_lock(tsdn, &prof_active_mtx);
|
||||
prof_active_old = prof_active;
|
||||
prof_active = active;
|
||||
malloc_mutex_unlock(tsdn, &prof_active_mtx);
|
||||
prof_active_assert();
|
||||
return prof_active_old;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue