View source code
							
							
						
								Display the source code in std/experimental/allocator/common.d from which this
								page was generated on github.
							
						
							Report a bug
							
						
								If you spot a problem with this page, click here to create a
								Bugzilla issue.
							
						
							
								Improve this page
							
							
					
								Quickly fork, edit online, and submit a pull request for this page.
								Requires a signed-in GitHub account. This works well for small changes.
								If you'd like to make larger changes you may want to consider using
								local clone.
							
						Module std.experimental.allocator.common
Utility and ancillary artifacts of std. This module
shouldn't be used directly; its functionality will be migrated into more
appropriate parts of std.
Functions
| Name | Description | 
|---|---|
| 
									alignedReallocate(alloc, b, s, a)
								 | The default alignedReallocatefunction first attempts to useexpand.
IfAllocatoris not defined or returnsfalse,alignedReallocateallocates a new block of memory of appropriate size and
copies data from the old block to the new block. Finally, ifAllocatordefinesdeallocate,alignedReallocateuses it to free the old memory
block. | 
| 
									forwardToMember(member, funs)
								 | Forwards each of the methods in funs(if defined) tomember. | 
| 
									goodAllocSize(a, n)
								 | The default good size allocation is deduced as nrounded up to the
allocator's alignment. | 
| 
									reallocate(a, b, s)
								 | The default reallocatefunction first attempts to useexpand. IfAllocatoris not defined or returnsfalse,reallocateallocates a new block of memory of appropriate size and copies data from the old
block to the new block. Finally, ifAllocatordefinesdeallocate,reallocateuses it to free the old memory block. | 
Manifest constants
| Name | Type | Description | 
|---|---|---|
| chooseAtRuntime | chooseAtRuntimeis a compile-time constant of typesize_tthat 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, whereasBitmappedBlock!(Allocator, chooseAtRuntime)defines a block allocator that has a
field storing the block size, initialized by the user. | |
| hasStaticallyKnownAlignment | Returns trueif theAllocatorhas the alignment known at compile time;
otherwise it returnsfalse. | |
| platformAlignment | The alignment that is guaranteed to accommodate any D object allocation on the current platform. | |
| stateSize | Returns the size in bytes of the state that needs to be allocated to hold an
object of type T.stateSize!Tis zero forstructs that are not
nested and have no nonstatic member variables. | |
| unbounded | unboundedis a compile-time constant of typesize_tthat several
parameterized structures in this module recognize to mean "infinite" bounds for
the parameter. For example,Freelist(described in detail below) accepts amaxNodesparameter limiting the number of freelist items. Ifunboundedis passed formaxNodes, then there is no limit and no checking for the
number of nodes. | 
Authors
Andrei Alexandrescu, Timon Gehr (Ternary)
License
					Copyright © 1999-2022 by the D Language Foundation | Page generated by ddox.