diff options
Diffstat (limited to 'src/pkg/runtime/malloc.h')
| -rw-r--r-- | src/pkg/runtime/malloc.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/pkg/runtime/malloc.h b/src/pkg/runtime/malloc.h index cbcc09cdb7..0d31326a22 100644 --- a/src/pkg/runtime/malloc.h +++ b/src/pkg/runtime/malloc.h @@ -285,15 +285,18 @@ struct MCacheList struct MCache { - MCacheList list[NumSizeClasses]; + // The following members are accessed on every malloc, + // so they are grouped here for better caching. + int32 next_sample; // trigger heap sample after allocating this many bytes intptr local_cachealloc; // bytes allocated (or freed) from cache since last lock of heap + // The rest is not accessed on every malloc. + MCacheList list[NumSizeClasses]; intptr local_objects; // objects allocated (or freed) from cache since last lock of heap intptr local_alloc; // bytes allocated (or freed) since last lock of heap uintptr local_total_alloc; // bytes allocated (even if freed) since last lock of heap uintptr local_nmalloc; // number of mallocs since last lock of heap uintptr local_nfree; // number of frees since last lock of heap uintptr local_nlookup; // number of pointer lookups since last lock of heap - int32 next_sample; // trigger heap sample after allocating this many bytes // Statistics about allocation size classes since last lock of heap struct { uintptr nmalloc; |
