dmd.root.region
Region storage allocator implementation.
License
Source: root/region.d
Documentation: https://dlang.org/phobos/dmd_root_region.html
-
Declaration
struct
Region
;Simple region storage allocator.
-
Declaration
nothrow void*
malloc
(size_tnbytes
);Allocate
nbytes
. Aborts on failure.Parameters
size_t
nbytes
number of bytes to allocate, can be 0, must be <= than MaxAllocSize
Return Value
allocated data,
null
fornbytes
==0 -
Declaration
nothrow RegionPos
savePos
();Return stack position for allocations in this region.
Return Value
an opaque struct to be passed to
release()
-
Declaration
nothrow void
release
(RegionPospos
);Release the memory that was allocated after the respective call to
savePos()
.Parameters
RegionPos
pos
position returned by
savePos()
-
Declaration
nothrow bool
contains
(void*p
);If pointer points into Region.
Parameters
void*
p
pointer to check
Return Value
true
if it points into the region -
Declaration
nothrow size_t
size
();Return Value
size
of Region
-