Aligns a pointer down to a specified alignment. The resulting pointer is less than or equal to the given pointer.
Aligns a pointer up to a specified alignment. The resulting pointer is greater than or equal to the given pointer.
Returns true if ptr is aligned at alignment.
The default alignedReallocate function first attempts to use expand. If Allocator.expand is not defined or returns false, alignedReallocate allocates a new block of memory of appropriate size and copies data from the old block to the new block. Finally, if Allocator defines deallocate, alignedReallocate uses it to free the old memory block.
Like a / b but rounds the result up, not down.
Returns the effective alignment of ptr, i.e. the largest power of two that is a divisor of ptr.
The default good size allocation is deduced as n rounded up to the allocator's alignment.
The default reallocate function first attempts to use expand. If Allocator.expand is not defined or returns false, reallocate allocates a new block of memory of appropriate size and copies data from the old block to the new block. Finally, if Allocator defines deallocate, reallocate uses it to free the old memory block.
Returns n rounded down to a multiple of alignment, which must be a power of 2.
Returns s rounded up to a multiple of base.
Returns n rounded up to a multiple of alignment, which must be a power of 2.
Advances the beginning of b to start at alignment a. The resulting buffer may therefore be shorter. Returns the adjusted buffer, or null if obtaining a non-empty buffer is impossible.
Returns s rounded up to a multiple of base.
Returns s rounded up to the nearest power of 2.
Returns the number of trailing zeros of x.
chooseAtRuntime is a compile-time constant of type size_t that several parameterized structures in this module recognize to mean deferral to runtime of the exact value. For example, BitmappedBlock!(Allocator, 4096) (described in detail below) defines a block allocator with block size of 4096 bytes, whereas BitmappedBlock!(Allocator, chooseAtRuntime) defines a block allocator that has a field storing the block size, initialized by the user.
Forwards each of the methods in funs (if defined) to member.
unbounded is a compile-time constant of type size_t that several parameterized structures in this module recognize to mean "infinite" bounds for the parameter. For example, Freelist (described in detail below) accepts a maxNodes parameter limiting the number of freelist items. If unbounded is passed for maxNodes, then there is no limit and no checking for the number of nodes.
Returns true if the Allocator has the alignment known at compile time; otherwise it returns false.
Returns the size in bytes of the state that needs to be allocated to hold an object of type T. stateSize!T is zero for structs that are not nested and have no nonstatic member variables.
The alignment that is guaranteed to accommodate any D object allocation on the current platform.
Utility and ancillary artifacts of stdx.allocator. This module shouldn't be used directly; its functionality will be migrated into more appropriate parts of std.