### Struct

# GLib TrashStack

deprecated: 2.48 since: 2.0

#### Description

    struct GTrashStack {
      GTrashStack* next;
    }

A `GTrashStack` is an efficient way to keep a stack of unused allocated memory chunks. Each memory chunk is required to be large enough to hold a `gpointer`. This allows the stack to be maintained without any space overhead, since the stack pointers can be stored inside the memory chunks.

There is no function to create a `GTrashStack`. A `NULL` `GTrashStack*` is a perfectly valid empty stack.

Each piece of memory that is pushed onto the stack is cast to a `GTrashStack*`.

There is no longer any good reason to use `GTrashStack`. If you have extra pieces of memory, `free()` them and allocate them again later.

###### Structure members

`next`

  Pointer to the previous element of the stack, gets stored in the first `sizeof (gpointer)` bytes of the element.

Available since: 2.0

Deprecated since: 2.48

`GTrashStack` is deprecated without replacement.

#### Functions

###### g_trash_stack_height

Returns the height of a `GTrashStack`.

deprecated: 2.48 since: 2.0

###### g_trash_stack_peek

Returns the element at the top of a `GTrashStack` which may be `NULL`.

deprecated: 2.48 since: 2.0

###### g_trash_stack_pop

Pops a piece of memory off a `GTrashStack`.

deprecated: 2.48 since: 2.0

###### g_trash_stack_push

Pushes a piece of memory onto a `GTrashStack`.

deprecated: 2.48 since: 2.0