View source code
Display the source code in rt/lifetime.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 rt.lifetime

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

Functions

NameDescription
_d_allocmemory(sz) Allocate memory using the garbage collector
_d_arrayappendcd(x, c) Append dchar to char[], converting UTF-32 to UTF-8
_d_arrayappendcTX() Extend an array by n elements.
_d_arrayappendwd(x, c) Append dchar to wchar[], converting UTF-32 to UTF-16
_d_arrayliteralTX(ti, length) Allocate an array literal
_d_arraysetcapacity(ti, newcapacity, p) Set the array capacity.
_d_arraysetlengthiT(ti, newlength, p) Resize a dynamic array by setting the .length property
_d_arraysetlengthT(ti, newlength, p) Resize a dynamic array by setting the .length property
_d_arrayshrinkfit(ti, arr) Shrink the "allocated" length of an array to be the exact size of the array.
_d_callfinalizer(p)
_d_callinterfacefinalizer(p)
_d_delclass(p)
_d_delinterface(p)
_d_delmemory(p)
_d_newarrayiT(ti, length) Allocate an array with the garbage collector.
_d_newarrayT(ti, length) Allocate an array with the garbage collector.
_d_newarrayU(ti, length) Allocate an array with the garbage collector.
_d_newclass(ci) Create a new class instance.
_d_newitemU(_ti) Non-template version of core.lifetime.d_newitemT that does not perform initialization. Needed for rt.aaA.allocEntry.
newCapacity(newlength, size) Given an array of length size that needs to be expanded to newlength, compute a new capacity.
rt_finalize(p, det) Backwards compatibility
rt_finalize2(p, det, resetMemory)
rt_getCollectHandler()
rt_hasFinalizerInSegment(p, size, attr, segment)
rt_setCollectHandler(h)

Authors

Walter Bright, Sean Kelly, Steven Schveighoffer

License

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