tryRawReallocate
- void rawReallocate(A allocator, size_t alignment, size_t elementSize, void* ptr, size_t preserveCount, size_t newCount, bool zeroFill, bool gcScan)
- bool tryRawReallocate(A allocator, size_t alignment, size_t elementSize, void* ptr, size_t preserveCount, size_t newCount, bool zeroFill, bool gcScan)
unstd memory allocation
enumsfunctionspropertiesstatic variablesstructs
Requests resize of an alignment-byte aligned block of memory allocated from allocator or if ptr is null requests memory allocation like rawAllocate/tryRawAllocate. Memory may be moved, but preserveCount elements content will stay the same.
If zeroFill is true and preserveCount < newCount the memory of "unpreserved" elements will be zero-filled.
If reallocation fails ptr isn't changed. tryRawReallocate returns whether reallocation succeeded.
If reallocation fails rawReallocate will also call $(COREREF exception, onOutOfMemoryError) which is expected to throw an $(COREREF exception, OutOfMemoryError).
Preconditions: alignment && elementSize % alignment == 0 && (ptr || !preserveCount) && preserveCount <= newCount && newCount