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:
+2
-4
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user