ADS
Algorithms and Data Structures
Loading...
Searching...
No Matches
memory Directory Reference

Files

 
AllocatorAware.h
 The rules of the allocator-aware containers of the standard ([container.reqmts], [allocator.requirements]), beyond the book, written once for the containers of ADS that take an allocator A: a container rebinds A to the type of what it allocates (its nodes, its places, its blocks) by std::allocator_traits, a copy takes the allocator that select_on_container_copy_construction() gives, and a copy assignment, a move assignment and a swap take the allocator of the other container only when the trait propagate_on_container_copy_assignment, propagate_on_container_move_assignment or propagate_on_container_swap of A is true.
 
Allocators.h
 The dynamic storage allocation of Knuth, beyond the book, on a memory of \( N \) words simulated by a vector, so that the blocks and their headers can be inspected:
 
Arena.h
 An arena of objects allocated in blocks, beyond the book: make() builds an object in the current block, a new block of \( n \) objects is taken when it is full, and all the objects die with the arena.
 
CellHeap.h
 A heap of cells of two fields with a garbage collector, beyond the book: the memory of a LISP, where a field holds nil, an atom or the address of a cell, and the cells not reachable from the roots are garbage.
 
ConcurrentPool.h
 A pool of size classes shared by threads, beyond the book: an object made by one thread may be freed by any other, e.g., a message created by the thread that changes a model and released by the thread of a solver that has read it.
 
HugePageAllocator.h
 An allocator for the large blocks of a structure, beyond the book: a request of at least one huge page (2 MB) is aligned to a huge page and rounded up to whole ones, so that a system which backs the large blocks of memory by huge pages (the transparent huge pages of Linux under the policy always, the default of several distributions) can give the block whole huge pages; a smaller request goes to std::allocator.
 
ObjectPool.h
 A pool of objects of one type, beyond the book: make() builds an object in a slot of the pool and free() destroys it and keeps its slot, which the next make() takes again (the last one freed first), so that the nodes of a linked structure cost no call to the allocator, the slot just freed is still in the cache when it is used again, and the objects made one after another are next to each other in memory.
 
PageHeap.h
 The heap of pages of size classes under PoolResource [see PoolAllocator.h] and ConcurrentPoolResource [see ConcurrentPool.h], beyond the book: slots of \( ( c + 1 ) g \) bytes, \( g = 8 \), for the classes \( c = 0 , \dots , C - 1 \), with the free lists sharded by page.
 
PoolAllocator.h
 A standard allocator over pools of size classes, beyond the book, so that the containers of the standard library and std::allocate_shared take their nodes from pages of slots of one size instead of the general allocator.
 
Prefetch.h
 The prefetch of a line of the cache, beyond the book: ADS::prefetch( p ) asks the processor to bring the line that holds the byte at \( p \) into its caches, and returns at once, so that a load issued later finds the line there instead of waiting for the memory.
 
SizeClassAllocator.h
 An allocator of small blocks by size classes, beyond the book: the scheme of the allocators of today (mimalloc, jemalloc, tcmalloc), for one thread, the size of a block given back by its owner (sized deallocation, as std::allocator does), so that a block needs no header.