allocate an array memory block by applying the proper padding and assigning block attributes if not inherited from the existing block
get the allocation size of the array for the given block (without padding or type info)
get the padding required to allocate size bytes. Note that the padding is NOT included in the passed in size. Therefore, do NOT call this function with the size of an allocated block.
get the start of the array for the given block
Get the cached block info of an interior pointer. Returns null if the interior pointer's block is not cached.
Set the allocated length of the array block. This is called any time an array is appended to or its length is set.
Append y[] to array x[]
Extend an array by n elements. Caller must initialize those elements.
Append dchar to char[]
Append dchar to wchar[]
Allocate the array, rely on the caller to do the initialization of the array.
set the array capacity. If the array capacity isn't currently large enough to hold the requested capacity (in number of elements), then the array is resized/reallocated to the appropriate size. Pass in a requested capacity of 0 to get the current capacity. Returns the number of elements that can actually be stored once the resizing is done.
Resize dynamic arrays with 0 initializers.
Resize arrays for non-zero initializers. p pointer to array lvalue to be updated newlength new .length property of array sizeelem size of each element of array initsize size of initializer ... initializer
Shrink the "allocated" length of an array to be the exact size of the array. It doesn't matter what the current allocated length of the array is, the user is telling the runtime that he knows what he is doing.
This is called for a delete statement where the value being deleted is a pointer to a struct with a destructor but doesn't have an overloaded delete operator.
Allocate a new array of length elements. ti is the type of the resulting array, or pointer to element. (For when the array is initialized to 0)
Allocate a new uninitialized array of length elements. ti is the type of the resulting array, or pointer to element.
For when the array has a non-zero initializer.
Same as above, zero initializes the item.
Allocate an uninitialized non-array item. This is an optimization to avoid things needed for arrays like the __arrayPad(size).
Same as above, for item with non-zero initializer.
cache for the lookup of the block info
Distributed under the Boost Software License 1.0. (See accompanying file LICENSE)
Copyright Digital Mars 2000 - 2012.
This module contains all functions related to an object's lifetime: allocation, resizing, deallocation, and finalization.