Add FIFO behaviour for unchecked code.
Consuming available slabs in LIFO order makes predicting address reuse harder but appears to have performance implications. Condition this on CHECK_CLIENT and instead use FIFO order on !CHECK_CLIENT builds.
This commit is contained in:
committed by
Matthew Parkinson
parent
4987a19fe9
commit
cec015f296
@@ -292,7 +292,13 @@ namespace snmalloc
|
||||
|
||||
struct MetaslabCache
|
||||
{
|
||||
SeqQueue<Metaslab> queue;
|
||||
#ifdef SNMALLOC_CHECK_CLIENT
|
||||
SeqSet<Metaslab> available;
|
||||
#else
|
||||
// This is slightly faster in some cases,
|
||||
// but makes memory reuse more predictable.
|
||||
SeqSet<Metaslab, true> available;
|
||||
#endif
|
||||
uint16_t unused = 0;
|
||||
uint16_t length = 0;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user