Addressing CR feedback

This commit is contained in:
Matthew Parkinson
2019-01-16 17:03:15 +00:00
parent c4e6af4bad
commit ab57c86e3a
2 changed files with 22 additions and 10 deletions

View File

@@ -38,10 +38,17 @@ namespace snmalloc
PMMediumslab = 2
};
#ifndef SNMALLOC_MAX_FLATPAGEMAP_SIZE
// Use flat map is under a single node.
# define SNMALLOC_MAX_FLATPAGEMAP_SIZE PAGEMAP_NODE_SIZE
#endif
static constexpr bool USE_FLATPAGEMAP = SNMALLOC_MAX_FLATPAGEMAP_SIZE >=
sizeof(FlatPagemap<SUPERSLAB_BITS, uint8_t>);
using SuperslabPagemap = std::conditional_t<
bits::is64(),
Pagemap<SUPERSLAB_BITS, uint8_t, 0>,
FlatPagemap<SUPERSLAB_BITS, uint8_t>>;
USE_FLATPAGEMAP,
FlatPagemap<SUPERSLAB_BITS, uint8_t>,
Pagemap<SUPERSLAB_BITS, uint8_t, 0>>;
HEADER_GLOBAL SuperslabPagemap global_pagemap;
/**