mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-06-22 03:45:39 +03:00
Switch to fine-grained reentrancy support.
Previously we had a general detection and support of reentrancy, at the cost of having branches and inc / dec operations on fast paths. To avoid taxing fast paths, we move the reentrancy operations onto tsd slow state, and only modify reentrancy level around external calls (that might trigger reentrancy).
This commit is contained in:
parent
b348ba29bb
commit
c2fcf9c2cf
8 changed files with 90 additions and 86 deletions
|
|
@ -1966,11 +1966,9 @@ arena_new(tsdn_t *tsdn, unsigned ind, extent_hooks_t *extent_hooks) {
|
|||
* If we're here, then arena 0 already exists, so bootstrapping
|
||||
* is done enough that we should have tsd.
|
||||
*/
|
||||
int8_t *reentrancy_level = tsd_reentrancy_levelp_get(tsdn_tsd(
|
||||
tsdn));
|
||||
++*reentrancy_level;
|
||||
pre_reentrancy(tsdn_tsd(tsdn));
|
||||
hooks_arena_new_hook();
|
||||
--*reentrancy_level;
|
||||
post_reentrancy(tsdn_tsd(tsdn));
|
||||
}
|
||||
|
||||
return arena;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue