Skip to content

Commit

Permalink
Alter layout slightly.
Browse files Browse the repository at this point in the history
  • Loading branch information
mjp41 committed Feb 24, 2025
1 parent 22343cd commit f2faf98
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/snmalloc/mem/corealloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ namespace snmalloc
return r;
}

struct FastFreeLists
{
// Free list per small size class. These are used for
// allocation on the fast path. This part of the code is inspired by
// mimalloc.
freelist::Iter<> small_fast_free_lists[NUM_SMALL_SIZECLASSES] = {};
};

/**
* The core, stateful, part of a memory allocator.
*
Expand All @@ -68,7 +76,8 @@ namespace snmalloc
* `init_message_queue`.
*/
template<SNMALLOC_CONCEPT(IsConfigLazy) Config_>
class Allocator : public stl::conditional_t<
class Allocator : public FastFreeLists,
public stl::conditional_t<
Config_::Options.CoreAllocIsPoolAllocated,
Pooled<Allocator<Config_>>,
Empty>
Expand All @@ -87,11 +96,6 @@ namespace snmalloc

/// }@

// Free list per small size class. These are used for
// allocation on the fast path. This part of the code is inspired by
// mimalloc.
freelist::Iter<> small_fast_free_lists[NUM_SMALL_SIZECLASSES] = {};

/**
* Remote deallocations for other threads
*/
Expand Down

0 comments on commit f2faf98

Please sign in to comment.