Refactor ctl_stats_t.

Refactor ctl_stats_t to be a demand-zeroed non-growing data structure.
To keep the size from being onerous (~60 MiB) on 32-bit systems, convert
the arenas field to contain pointers rather than directly embedded
ctl_arena_stats_t elements.
This commit is contained in:
Jason Evans
2017-01-03 12:40:54 -08:00
parent 0f04bb1d6f
commit d778dd2afc
3 changed files with 107 additions and 67 deletions

View File

@@ -61,7 +61,7 @@ struct ctl_stats_s {
size_t mapped;
size_t retained;
unsigned narenas;
ctl_arena_stats_t *arenas; /* (narenas + 1) elements. */
ctl_arena_stats_t *arenas[1 << MALLOCX_ARENA_BITS];
};
#endif /* JEMALLOC_H_STRUCTS */