rt.lifetime

This module contains all functions related to an object's lifetime: allocation, resizing, deallocation, and finalization.

Members

Functions

__getBlkInfo
BlkInfo* __getBlkInfo(void* interior)

Get the cached block info of an interior pointer. Returns null if the interior pointer's block is not cached.

__setArrayAllocLength
bool __setArrayAllocLength(BlkInfo info, size_t newlength, bool isshared, TypeInfo tinext, size_t oldlength)

Set the allocated length of the array block. This is called any time an array is appended to or its length is set.

_d_allocmemory
void* _d_allocmemory(size_t sz)

Allocate memory using the garbage collector

_d_arrayappendcTX
byte[] _d_arrayappendcTX(TypeInfo ti, byte[] px, size_t n)

Extend an array by n elements.

_d_arrayappendcd
void[] _d_arrayappendcd(byte[] x, dchar c)

Append dchar to char[], converting UTF-32 to UTF-8

_d_arrayappendwd
void[] _d_arrayappendwd(byte[] x, dchar c)

Append dchar to wchar[], converting UTF-32 to UTF-16

_d_arrayliteralTX
void* _d_arrayliteralTX(TypeInfo ti, size_t length)

Allocate an array literal

_d_arraysetcapacity
size_t _d_arraysetcapacity(TypeInfo ti, size_t newcapacity, void[]* p)

Set the array capacity.

_d_arraysetlengthT
void[] _d_arraysetlengthT(TypeInfo ti, size_t newlength, void[]* p)
_d_arraysetlengthiT
void[] _d_arraysetlengthiT(TypeInfo ti, size_t newlength, void[]* p)

Resize a dynamic array by setting the .length property

_d_arrayshrinkfit
void _d_arrayshrinkfit(TypeInfo ti, void[] arr)

Shrink the "allocated" length of an array to be the exact size of the array.

_d_callfinalizer
void _d_callfinalizer(void* p)
_d_callinterfacefinalizer
void _d_callinterfacefinalizer(void* p)
_d_delclass
void _d_delclass(Object* p)
_d_delinterface
void _d_delinterface(void** p)
_d_delmemory
void _d_delmemory(void** p)
_d_newarrayT
void[] _d_newarrayT(TypeInfo ti, size_t length)

Allocate an array with the garbage collector.

_d_newarrayU
void[] _d_newarrayU(TypeInfo ti, size_t length)
_d_newarrayiT
void[] _d_newarrayiT(TypeInfo ti, size_t length)

Allocate an array with the garbage collector.

_d_newarraymTX
void[] _d_newarraymTX(TypeInfo ti, size_t[] dims)
_d_newarraymiTX
void[] _d_newarraymiTX(TypeInfo ti, size_t[] dims)

Create a new multi-dimensional array

_d_newclass
Object _d_newclass(ClassInfo ci)

Create a new class instance.

_d_newitemT
void* _d_newitemT(TypeInfo _ti)

Allocate an uninitialized non-array item.

_d_newitemU
void* _d_newitemU(TypeInfo _ti)

Allocate an uninitialized non-array item.

_d_newitemiT
void* _d_newitemiT(TypeInfo _ti)

Same as above, for item with non-zero initializer.

newCapacity
size_t newCapacity(size_t newlength, size_t size)

Given an array of length size that needs to be expanded to newlength, compute a new capacity.

rt_finalize
void rt_finalize(void* p, bool det)

Backwards compatibility

rt_finalize2
void rt_finalize2(void* p, bool det, bool resetMemory)
rt_getCollectHandler
CollectHandler rt_getCollectHandler()
rt_hasFinalizerInSegment
int rt_hasFinalizerInSegment(void* p, size_t size, uint attr, const(void)[] segment)
rt_setCollectHandler
void rt_setCollectHandler(CollectHandler h)

Meta

License

Distributed under the Boost Software License 1.0. (See accompanying file LICENSE)

Authors

Walter Bright, Sean Kelly, Steven Schveighoffer