Function

GLib-2.0GLibmemdupDeprecated 2.68

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

    Parameters

    • Deprecatedmem: any

      the memory to copy

    • Deprecatedbyte_size: number

      the number of bytes to copy

    Returns any

    a pointer to the newly-allocated copy of the memory

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