diff --git a/src/mem/freelist.h b/src/mem/freelist.h index 9cfa49b..eab71eb 100644 --- a/src/mem/freelist.h +++ b/src/mem/freelist.h @@ -271,12 +271,6 @@ namespace snmalloc * * Adds signing of pointers in the SNMALLOC_CHECK_CLIENT mode * - * We use the template parameter, so that an enclosing - * class can make use of the remaining bytes, which may not - * be aligned. On 64bit ptr architectures, this structure - * is a multiple of 8 bytes in the checked and random more. - * But on 128bit ptr architectures this may be a benefit. - * * If RANDOM is enabled, the builder uses two queues, and * "randomly" decides to add to one of the two queues. This * means that we will maintain a randomisation of the order @@ -348,7 +342,7 @@ namespace snmalloc * Adds an element to the builder, if we are guaranteed that * RANDOM is false. This is useful in certain construction * cases that do not need to introduce randomness, such as - * during the initialation construction of a free list, which + * during the initialisation construction of a free list, which * uses its own algorithm, or during building remote deallocation * lists, which will be randomised at the other end. */ diff --git a/src/mem/localcache.h b/src/mem/localcache.h index 65a6107..eaaf6c1 100644 --- a/src/mem/localcache.h +++ b/src/mem/localcache.h @@ -68,6 +68,9 @@ namespace snmalloc : remote_allocator(remote_allocator) {} + /** + * Return all the free lists to the allocator. Used during thread teardown. + */ template< size_t allocator_size, typename SharedStateHandle, @@ -77,8 +80,6 @@ namespace snmalloc { auto& key = entropy.get_free_list_key(); - // Return all the free lists to the allocator. - // Used during thread teardown for (size_t i = 0; i < NUM_SIZECLASSES; i++) { // TODO could optimise this, to return the whole list in one append diff --git a/src/mem/remoteallocator.h b/src/mem/remoteallocator.h index f467cfc..e02c2c8 100644 --- a/src/mem/remoteallocator.h +++ b/src/mem/remoteallocator.h @@ -71,13 +71,15 @@ namespace snmalloc return bk == front; } + /** + * Pushes a list of messages to the queue. Each message from first to + * last should be linked together through their next pointers. + */ void enqueue( CapPtr first, CapPtr last, const FreeListKey& key) { - // Pushes a list of messages to the queue. Each message from first to - // last should be linked together through their next pointers. invariant(); last->atomic_store_null(key); @@ -93,9 +95,11 @@ namespace snmalloc return front; } + /** + * Returns the front message, or null if not possible to return a message. + */ std::pair, bool> dequeue(const FreeListKey& key) { - // Returns the front message, or null if not possible to return a message. invariant(); CapPtr first = front; CapPtr next = first->atomic_read_next(key);