MemorySlice.alloc

Allocates a block of memory from the slice allocator. The block adress handed out can be expected to be aligned to at least 1 * sizeof (void*), though in general slices are 2 * sizeof (void*) bytes aligned, if a malloc() fallback implementation is used instead, the alignment may be reduced in a libc dependent fashion. Note that the underlying slice allocation mechanism can be changed with the G_SLICE=always-malloc environment variable. Since 2.10

class MemorySlice
static
void*
alloc

Parameters

blockSize gsize

the number of bytes to allocate

Return Value

Type: void*

a pointer to the allocated memory block

Meta