rawReallocate

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

  1. void rawReallocate(A allocator, size_t alignment, size_t elementSize, void* ptr, size_t preserveCount, size_t newCount, bool zeroFill, bool gcScan)
    void
    rawReallocate
    (
    A
    )
    (
    ref A allocator
    ,
    in size_t alignment
    ,
    in size_t elementSize
    ,
    ref void* ptr
    ,
    in size_t preserveCount
    ,
    in size_t newCount
    ,
    in bool zeroFill = true
    ,
    in bool gcScan = false
    )
  2. bool tryRawReallocate(A allocator, size_t alignment, size_t elementSize, void* ptr, size_t preserveCount, size_t newCount, bool zeroFill, bool gcScan)

Meta