GLib.PtrArray.new_full
Description: Reference for GLib.PtrArray.new_full

### Function

# GLib PtrArraynew_full

since: 2.30

#### Declaration [src]

    GPtrArray*
    g_ptr_array_new_full (
      guint reserved_size,
      GDestroyNotify element_free_func
    )

#### Description [src]

Creates a new `GPtrArray` with `reserved_size` pointers preallocated and a reference count of 1. This avoids frequent reallocation, if you are going to add many pointers to the array. Note however that the size of the array is still 0. It also sets `element_free_func` for freeing each element when the array is destroyed either via `g_ptr_array_unref()`, when `g_ptr_array_free()` is called with `free_segment` set to true or when removing elements.

Available since: 2.30

This function is not directly available to language bindings.

#### Parameters

`reserved_size`

  Type: `guint`

  The number of pointers preallocated.

`element_free_func`

  Type: `GDestroyNotify`

  A function to free elements with destroy `array`.

#### Return value

Type: An array of `gpointer`

The new `GPtrArray`.

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