Function

GLib-2.0GLibmemdup2Since 2.68

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

    This replaces GLib.memdup, which was prone to integer overflows when converting the argument from a gsize to a guint.

    Parameters

    • mem: any

      the memory to copy

    • byte_size: number

      the number of bytes to copy

    Returns any

    a pointer to the newly-allocated copy of the memory

    2.68