tryAllocate

Requests a properly aligned block of memory of count * T.sizeof bytes from allocator.

If initialize is true the returned memory will be set to T.init.

If allocation fails allocate will also call $(COREREF exception, onOutOfMemoryError) which is expected to throw an $(COREREF exception, OutOfMemoryError).

Preconditions: count != 0

  1. T[] allocate(A allocator, size_t count, bool initialize, bool gcScan)
  2. T[] tryAllocate(A allocator, size_t count, bool initialize, bool gcScan)
    T[]
    tryAllocate
    (
    T
    A
    )
    (
    ref A allocator
    ,
    in size_t count
    ,
    in bool initialize = true
    ,
    in bool gcScan = hasIndirections!T
    )

Return Value

Type: T[]

Allocated array or null if allocaton failed.

Meta