mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-07-24 01:27:19 +03:00
Bin: Move stats closer to the mutex.
This is a slight cache locality optimization.
This commit is contained in:
parent
c259323ab3
commit
20140629b4
2 changed files with 13 additions and 3 deletions
|
|
@ -16,6 +16,12 @@ struct bin_s {
|
|||
/* All operations on bin_t fields require lock ownership. */
|
||||
malloc_mutex_t lock;
|
||||
|
||||
/*
|
||||
* Bin statistics. These get touched every time the lock is acquired,
|
||||
* so put them close by in the hopes of getting some cache locality.
|
||||
*/
|
||||
bin_stats_t stats;
|
||||
|
||||
/*
|
||||
* Current slab being used to service allocations of this bin's size
|
||||
* class. slabcur is independent of slabs_{nonfull,full}; whenever
|
||||
|
|
@ -33,9 +39,6 @@ struct bin_s {
|
|||
|
||||
/* List used to track full slabs. */
|
||||
edata_list_active_t slabs_full;
|
||||
|
||||
/* Bin statistics. */
|
||||
bin_stats_t stats;
|
||||
};
|
||||
|
||||
/* A set of sharded bins of the same size class. */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue