NFC: Accumulated nits in comments
Mostly, promote some inline commentary to doc comments. A typo and some stale text can go, too.
This commit is contained in:
committed by
Nathaniel Wesley Filardo
parent
73ebb69955
commit
3109ae9f72
@@ -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.
|
||||
*/
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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<FreeObject, CBAlloc> first,
|
||||
CapPtr<FreeObject, CBAlloc> 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<CapPtr<FreeObject, CBAlloc>, bool> dequeue(const FreeListKey& key)
|
||||
{
|
||||
// Returns the front message, or null if not possible to return a message.
|
||||
invariant();
|
||||
CapPtr<FreeObject, CBAlloc> first = front;
|
||||
CapPtr<FreeObject, CBAlloc> next = first->atomic_read_next(key);
|
||||
|
||||
Reference in New Issue
Block a user