### Function

# GLib rc_box_dup

since: 2.58

#### Declaration

    gpointer
    g_rc_box_dup (
      gsize block_size,
      gconstpointer mem_block
    )

#### Description

Allocates a new block of data with reference counting semantics, and copies `block_size` bytes of `mem_block` into it.

Available since: 2.58

#### Parameters

`block_size`

  Type: `gsize`

  The number of bytes to copy, must be greater than 0

`mem_block`

  Type: `gconstpointer`

  The memory to copy.

  The data is owned by the caller of the function.

#### Return value

Type: `gpointer`

A pointer to the allocated memory.

The caller of the function takes ownership of the data, and is responsible for freeing it.