mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-07-23 21:23:06 +00:00
Restructure setters for profiling info
Explicitly define three setters: - `prof_tctx_reset()`: set `prof_tctx` to `1U`, if we don't know in advance whether the allocation is large or not; - `prof_tctx_reset_sampled()`: set `prof_tctx` to `1U`, if we already know in advance that the allocation is large; - `prof_info_set()`: set a real `prof_tctx`, and also set other profiling info e.g. the allocation time. Code structure wise, the prof level is kept as a thin wrapper, the large level only provides low level setter APIs, and the arena level carries out the main logic.
This commit is contained in:
@@ -372,7 +372,7 @@ large_prof_info_get(const extent_t *extent, prof_info_t *prof_info) {
|
||||
extent_prof_info_get(extent, prof_info);
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
large_prof_tctx_set(extent_t *extent, prof_tctx_t *tctx) {
|
||||
extent_prof_tctx_set(extent, tctx);
|
||||
}
|
||||
@@ -383,6 +383,9 @@ large_prof_tctx_reset(extent_t *extent) {
|
||||
}
|
||||
|
||||
void
|
||||
large_prof_alloc_time_set(extent_t *extent, nstime_t *t) {
|
||||
extent_prof_alloc_time_set(extent, t);
|
||||
large_prof_info_set(extent_t *extent, prof_tctx_t *tctx) {
|
||||
large_prof_tctx_set(extent, tctx);
|
||||
nstime_t t;
|
||||
nstime_init_update(&t);
|
||||
extent_prof_alloc_time_set(extent, &t);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user