diff --git a/src/mem/alloc.h b/src/mem/alloc.h index 6318118..4089a61 100644 --- a/src/mem/alloc.h +++ b/src/mem/alloc.h @@ -522,6 +522,9 @@ namespace snmalloc size_t size = 0; RemoteList list[REMOTE_SLOTS]; + /// Used to find the index into the array of queues for remote + /// deallocation + /// r is used for which round of sending this is. inline size_t get_slot(size_t id, size_t r) { constexpr size_t allocator_size = diff --git a/src/mem/remoteallocator.h b/src/mem/remoteallocator.h index c61ea0a..f9d2768 100644 --- a/src/mem/remoteallocator.h +++ b/src/mem/remoteallocator.h @@ -30,6 +30,10 @@ namespace snmalloc } }; + static_assert( + sizeof(Remote) <= MIN_ALLOC_SIZE, + "Needs to be able to fit in smallest allocation."); + struct RemoteAllocator { using alloc_id_t = Remote::alloc_id_t;