mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-07-25 10:07:36 +03:00
Refactor and optimize prof sampling initialization.
Makes the prof sample prng use the tsd prng_state. This allows us to properly initialize the sample interval event, without having to create tdata. As a result, tdata will be created on demand (when a thread reaches the sample interval bytes allocated), instead of on the first allocation.
This commit is contained in:
parent
bc774a3519
commit
da50d8ce87
7 changed files with 16 additions and 59 deletions
|
|
@ -233,6 +233,7 @@ tsd_data_init(tsd_t *tsd) {
|
|||
*tsd_prng_statep_get(tsd) = config_debug ? 0 :
|
||||
(uint64_t)(uintptr_t)tsd;
|
||||
|
||||
/* event_init may use the prng state above. */
|
||||
tsd_thread_event_init(tsd);
|
||||
|
||||
return tsd_tcache_enabled_data_init(tsd);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue