Callbacks

Allocator (data, length)

Details

Gck.Allocator(data, length)
Parameters:
  • data (object or None) – Memory to allocate or deallocate.

  • length (int) – New length of memory.

Returns:

The allocated memory, or None when freeing.

Return type:

object or None

An allocator used to allocate data for the attributes in this [struct`Attributes`] set.

This is a function that acts like GLib.realloc. Specifically it frees when length is set to zero, it allocates when data is set to None, and it reallocates when both are valid.