mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-07-10 15:57:24 +03:00
Integrate auto tcache into TSD.
The embedded tcache is initialized upon tsd initialization. The avail arrays for the tbins will be allocated / deallocated accordingly during init / cleanup. With this change, the pointer to the auto tcache will always be available, as long as we have access to the TSD. tcache_available() (called in tcache_get()) is provided to check if we should use tcache.
This commit is contained in:
parent
eeabdd2466
commit
fde3e20cc0
16 changed files with 300 additions and 178 deletions
|
|
@ -36,13 +36,17 @@ struct tcache_s {
|
|||
ticker_t gc_ticker; /* Drives incremental GC. */
|
||||
szind_t next_gc_bin; /* Next bin to GC. */
|
||||
arena_t *arena; /* Associated arena. */
|
||||
tcache_bin_t tbins[1]; /* Dynamically sized. */
|
||||
/*
|
||||
* The pointer stacks associated with tbins follow as a contiguous
|
||||
* array. During tcache initialization, the avail pointer in each
|
||||
* element of tbins is initialized to point to the proper offset within
|
||||
* this array.
|
||||
*/
|
||||
#ifdef JEMALLOC_TCACHE
|
||||
tcache_bin_t tbins[NSIZES];
|
||||
#else
|
||||
tcache_bin_t tbins[0];
|
||||
#endif
|
||||
};
|
||||
|
||||
/* Linkage for list of available (previously used) explicit tcache IDs. */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue