memdup

fnvoid * memdup(const(void) * mem, uint byteSize)

Allocates byte_size bytes of memory, and copies byte_size bytes into it from mem. If mem is NULL it returns NULL.

Parameters

memthe memory to copy
byteSizethe number of bytes to copy

Returns

a pointer to the newly-allocated copy of the memory

Deprecated

Use funcGLib.memdup2 instead, as it accepts a gsize argument

for byte_size, avoiding the possibility of overflow in a [gobject.types.size_t] → [gda.types.uint] conversion