mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-08-25 16:43:33 +03:00
Add internal tsd for background_thread.
This commit is contained in:
parent
73713fbb27
commit
5642f03cae
3 changed files with 24 additions and 11 deletions
11
src/tsd.c
11
src/tsd.c
|
|
@ -103,7 +103,16 @@ tsd_data_init_nocleanup(tsd_t *tsd) {
|
|||
}
|
||||
|
||||
tsd_t *
|
||||
tsd_fetch_slow(tsd_t *tsd) {
|
||||
tsd_fetch_slow(tsd_t *tsd, bool internal) {
|
||||
if (internal) {
|
||||
/* For internal background threads use only. */
|
||||
assert(tsd->state == tsd_state_uninitialized);
|
||||
tsd->state = tsd_state_reincarnated;
|
||||
tsd_set(tsd);
|
||||
tsd_data_init_nocleanup(tsd);
|
||||
return tsd;
|
||||
}
|
||||
|
||||
if (tsd->state == tsd_state_nominal_slow) {
|
||||
/* On slow path but no work needed. */
|
||||
assert(malloc_slow || !tsd_tcache_enabled_get(tsd) ||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue