PtrArray.this

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 set 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. Since 2.30

  1. this(GPtrArray* gPtrArray)
  2. this()
  3. this(GDestroyNotify elementFreeFunc)
  4. this(uint reservedSize, GDestroyNotify elementFreeFunc)

Parameters

reservedSize uint

number of pointers preallocated.

elementFreeFunc GDestroyNotify

A function to free elements with destroy array or NULL. [allow-none]

Throws

ConstructionException GTK+ fails to create the object.

Meta