Address review comments.
This commit is contained in:
@@ -48,10 +48,6 @@ if(USE_SNMALLOC_STATS)
|
||||
add_definitions(-DUSE_SNMALLOC_STATS)
|
||||
endif()
|
||||
|
||||
if(CACHE_FRIENDLY_OFFSET)
|
||||
add_definitions(-DCACHE_FRIENDLY_OFFSET=${CACHE_FRIENDLY_OFFSET})
|
||||
endif()
|
||||
|
||||
if(USE_MEASURE)
|
||||
add_definitions(-DUSE_MEASURE)
|
||||
endif()
|
||||
@@ -66,6 +62,10 @@ macro(add_shim name)
|
||||
target_include_directories(${name} PRIVATE src)
|
||||
target_compile_definitions(${name} PRIVATE "SNMALLOC_EXPORT=__attribute__((visibility(\"default\")))")
|
||||
set_target_properties(${name} PROPERTIES CXX_VISIBILITY_PRESET hidden)
|
||||
|
||||
if(CACHE_FRIENDLY_OFFSET)
|
||||
target_compile_definitions(${name} PRIVATE -DCACHE_FRIENDLY_OFFSET=${CACHE_FRIENDLY_OFFSET})
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
if(NOT MSVC)
|
||||
|
||||
@@ -150,7 +150,8 @@ namespace snmalloc
|
||||
}
|
||||
|
||||
// Check we terminated traversal on a correctly aligned block
|
||||
assert(((curr & ~1) - offset) % size == 0);
|
||||
uint16_t start = remove_cache_friendly_offset(curr & ~1, sizeclass);
|
||||
assert((start - offset) % size == 0);
|
||||
|
||||
if (curr != link)
|
||||
{
|
||||
|
||||
@@ -7,8 +7,7 @@ namespace snmalloc
|
||||
constexpr static uint16_t get_slab_offset(uint8_t sc, bool is_short);
|
||||
constexpr static size_t sizeclass_to_size(uint8_t sizeclass);
|
||||
constexpr static size_t sizeclass_to_cache_friendly_mask(uint8_t sizeclass);
|
||||
constexpr static size_t
|
||||
sizeclass_to_inverse_cache_friendly_mask(uint8_t sizeclass);
|
||||
constexpr static size_t sizeclass_to_inverse_cache_friendly_mask(uint8_t sc);
|
||||
constexpr static uint16_t medium_slab_free(uint8_t sizeclass);
|
||||
|
||||
static inline uint8_t size_to_sizeclass(size_t size)
|
||||
|
||||
Reference in New Issue
Block a user