memdup

fun memdup(mem: <Error class: unknown class>? = null, byteSize: <Error class: unknown class>): <Error class: unknown class>?(source)

⚠️ Deprecated ⚠️

This is deprecated since version 2.68.

Use func@GLib.memdup2 instead, as it accepts a gsize argument for @byte_size, avoiding the possibility of overflow in a gsizeguint conversion

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

Return

a pointer to the newly-allocated copy of the memory

Parameters

mem

the memory to copy

byteSize

the number of bytes to copy