The OpenD Programming Language

mir.ndslice.allocation

Members

Functions

bitRcslice
Slice!(FieldIterator!(BitField!(RCI!size_t)), N) bitRcslice(size_t[N] lengths)

Allocates a bitwise packed n-dimensional reference-counted (thread-safe) boolean slice.

bitSlice
Slice!(FieldIterator!(BitField!(size_t*)), N) bitSlice(size_t[N] lengths)

GC-Allocates a bitwise packed n-dimensional boolean slice.

makeNdarray
auto makeNdarray(Allocator alloc, Slice!(Iterator, N, kind) slice)

Allocates a common n-dimensional array using data from a slice.

makeSlice
auto makeSlice(Allocator alloc, Slice!(N, Iterator) slice)
Slice!(T*, N) makeSlice(Allocator alloc, size_t[N] lengths)
Slice!(T*, N) makeSlice(Allocator alloc, size_t[N] lengths, T init)
auto makeSlice(Allocator allocator, Slice!(Iterator, N, kind) slice)

Allocates an array through a specified allocator and creates an n-dimensional slice over it. See also std.experimental.allocator.

makeUninitSlice
Slice!(T*, N) makeUninitSlice(Allocator alloc, size_t[N] lengths)

Allocates an uninitialized array through a specified allocator and creates an n-dimensional slice over it. See also std.experimental.allocator.

mininitRcslice
Slice!(RCI!T, N) mininitRcslice(size_t[N] lengths)

Allocates a minimally initialized n-dimensional reference-counted (thread-safe) slice.

ndarray
auto ndarray(Slice!(Iterator, N, kind) slice)

Allocates a common n-dimensional array from a slice.

rcslice
Slice!(RCI!T, N) rcslice(size_t[N] lengths)
Slice!(RCI!T, N) rcslice(size_t[N] lengths, T init)
auto rcslice(Slice!(Iterator, N, kind) slice)
auto rcslice(T[] array)
auto rcslice(I[] array)
auto rcslice(Concatenation!(dim, Slices) concatenation)

Allocates an n-dimensional reference-counted (thread-safe) slice.

shape
auto shape(T[] array, int err)

Shape of a common n-dimensional array.

slice
Slice!(T*, N) slice(size_t[N] lengths, T init)
auto slice(Slice!(Iterator, N, kind) slice)
auto slice(Concatenation!(dim, Slices) concatenation)

GC-Allocates an n-dimensional slice.

stdcFreeAlignedSlice
void stdcFreeAlignedSlice(Slice!(T*, N) slice)

Frees aligned memory allocaged by CRuntime.

stdcFreeSlice
void stdcFreeSlice(Slice!(T*, N) slice)

Frees memory using core.stdc.stdlib.free.

stdcSlice
auto stdcSlice(Slice!(Iterator, N, kind) slice)

Allocates a copy of a slice using core.stdc.stdlib.malloc.

stdcUninitAlignedSlice
auto stdcUninitAlignedSlice(size_t[N] lengths, uint alignment)

Allocates an uninitialized aligned array using core.stdc.stdlib.malloc and creates an n-dimensional slice over it.

stdcUninitSlice
Slice!(T*, N) stdcUninitSlice(size_t[N] lengths)

Allocates an uninitialized array using core.stdc.stdlib.malloc and creates an n-dimensional slice over it.

uninitAlignedSlice
auto uninitAlignedSlice(size_t[N] lengths, uint alignment)

GC-Allocates an uninitialized aligned an n-dimensional slice.

uninitRCslice
Slice!(RCI!T, N) uninitRCslice(size_t[N] lengths)

Allocates an n-dimensional reference-counted (thread-safe) slice without memory initialisation.

uninitSlice
auto uninitSlice(size_t[N] lengths)

GC-Allocates an uninitialized n-dimensional slice.

Templates

slice
template slice(Args...)

GC-Allocates an n-dimensional slice.

Detailed Description

Common utilities

shapeReturns a shape of a common n-dimensional array.

GC Allocation utilities

Function NameDescription
sliceAllocates a slice using GC.
bitSliceGC-Allocates a bitwise packed n-dimensional boolean slice.
ndarrayAllocates a common n-dimensional array from a slice.
uninitSliceAllocates an uninitialized slice using GC.

Ref counted allocation utilities

rcsliceAllocates an n-dimensional reference-counted (thread-safe) slice.
bitRcsliceAllocates a bitwise packed n-dimensional reference-counted (thread-safe) boolean slice.
mininitRcsliceAllocates a minimally initialized n-dimensional reference-counted (thread-safe) slice.

Custom allocation utilities

Function NameDescription
makeNdarrayAllocates a common n-dimensional array from a slice using an allocator.
makeSliceAllocates a slice using an allocator.
makeUninitSliceAllocates an uninitialized slice using an allocator.

CRuntime allocation utilities

Function NameDescription
stdcSliceAllocates a slice copy using core.stdc.stdlib.malloc
stdcUninitSliceAllocates an uninitialized slice using core.stdc.stdlib.malloc.
stdcFreeSliceFrees memory using core.stdc.stdlib.free

Aligned allocation utilities

Function NameDescription
uninitAlignedSliceAllocates an uninitialized aligned slice using GC.
stdcUninitAlignedSliceAllocates an uninitialized aligned slice using CRuntime.
stdcFreeAlignedSliceFrees memory using CRuntime

Meta

Authors

Ilia Ki