Changes the representation in Metaslab Used
Used is now set to 1, when the slab is full. This means that the test for used - 1 == 0 can be used to detect leaving full, and entering empty, reducing fast path deallocation branchs by 1.
This commit is contained in:
@@ -8,6 +8,7 @@ namespace snmalloc
|
||||
// We use size_t as it generates better code.
|
||||
using sizeclass_t = size_t;
|
||||
// using sizeclass_t = uint8_t;
|
||||
using sizeclass_compress_t = uint8_t;
|
||||
|
||||
constexpr static uint16_t get_initial_offset(sizeclass_t sc, bool is_short);
|
||||
constexpr static size_t sizeclass_to_size(sizeclass_t sizeclass);
|
||||
|
||||
Reference in New Issue
Block a user