Add remove_cache_friendly_offset calls in a few places that were missing it.

This commit is contained in:
Paul Liétar
2019-07-17 13:14:59 +01:00
parent ab8ec72738
commit a5379b24d5
5 changed files with 24 additions and 13 deletions

View File

@@ -1072,13 +1072,13 @@ namespace snmalloc
assert(sizeclass < NUM_SMALL_CLASSES);
auto& fl = small_fast_free_lists[sizeclass];
auto head = fl.value;
void* head = fl.value;
if (likely(head != nullptr))
{
void* p = head;
// Read the next slot from the memory that's about to be allocated.
fl.value = Metaslab::follow_next(p);
fl.value = Metaslab::follow_next(head);
void* p = remove_cache_friendly_offset(head, sizeclass);
if constexpr (zero_mem == YesZero)
{
large_allocator.memory_provider.zero(p, size);