Blame docs/reference/glib/html/glib-Trash-Stacks.html

Packit ae235b
Packit ae235b
<html>
Packit ae235b
<head>
Packit ae235b
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
Packit ae235b
<title>Trash Stacks: GLib Reference Manual</title>
Packit ae235b
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
Packit ae235b
<link rel="home" href="index.html" title="GLib Reference Manual">
Packit ae235b
<link rel="up" href="glib-data-types.html" title="GLib Data Types">
Packit ae235b
<link rel="prev" href="glib-Sequences.html" title="Sequences">
Packit ae235b
<link rel="next" href="glib-Hash-Tables.html" title="Hash Tables">
Packit ae235b
<meta name="generator" content="GTK-Doc V1.27 (XML mode)">
Packit ae235b
<link rel="stylesheet" href="style.css" type="text/css">
Packit ae235b
</head>
Packit ae235b
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
Packit ae235b
Packit ae235b
Packit ae235b
Top  | 
Packit ae235b
                  Description
Packit ae235b
Packit ae235b
Home
Packit ae235b
Up
Packit ae235b
Prev
Packit ae235b
Next
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

Trash Stacks

Packit ae235b

Trash Stacks — maintain a stack of unused allocated memory chunks

Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

Functions

Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
void
Packit ae235b
Packit ae235b
Packit ae235b
g_trash_stack_push ()
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
gpointer
Packit ae235b
Packit ae235b
Packit ae235b
g_trash_stack_pop ()
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
gpointer
Packit ae235b
Packit ae235b
Packit ae235b
g_trash_stack_peek ()
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
guint
Packit ae235b
Packit ae235b
Packit ae235b
g_trash_stack_height ()
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

Types and Values

Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
struct
Packit ae235b
GTrashStack
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

Includes

Packit ae235b
#include <gmodule.h>
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

Description

Packit ae235b

A GTrashStack is an efficient way to keep a stack of unused allocated

Packit ae235b
memory chunks. Each memory chunk is required to be large enough to hold
Packit ae235b
a gpointer. This allows the stack to be maintained without any space
Packit ae235b
overhead, since the stack pointers can be stored inside the memory chunks.

Packit ae235b

There is no function to create a GTrashStack. A NULL GTrashStack*

Packit ae235b
is a perfectly valid empty stack.

Packit ae235b

There is no longer any good reason to use GTrashStack. If you have

Packit ae235b
extra pieces of memory, free() them and allocate them again later.

Packit ae235b
Packit ae235b
Packit ae235b

Functions

Packit ae235b
Packit ae235b

g_trash_stack_push ()

Packit ae235b
void
Packit ae235b
g_trash_stack_push (GTrashStack **stack_p,
Packit ae235b
                    gpointer data_p);
Packit ae235b
Packit ae235b

g_trash_stack_push has been deprecated since version 2.48 and should not be used in newly-written code.

Packit ae235b

GTrashStack is deprecated without replacement

Packit ae235b
Packit ae235b

Pushes a piece of memory onto a GTrashStack.

Packit ae235b
Packit ae235b

Parameters

Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

stack_p

Packit ae235b

a GTrashStack

Packit ae235b
 
Packit ae235b
Packit ae235b
Packit ae235b

data_p

Packit ae235b

the piece of memory to push on the stack.

Packit ae235b
[not nullable]
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

Packit ae235b
Packit ae235b

g_trash_stack_pop ()

Packit ae235b
gpointer
Packit ae235b
g_trash_stack_pop (GTrashStack **stack_p);
Packit ae235b
Packit ae235b

g_trash_stack_pop has been deprecated since version 2.48 and should not be used in newly-written code.

Packit ae235b

GTrashStack is deprecated without replacement

Packit ae235b
Packit ae235b

Pops a piece of memory off a GTrashStack.

Packit ae235b
Packit ae235b

Parameters

Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

stack_p

Packit ae235b

a GTrashStack

Packit ae235b
 
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

Returns

Packit ae235b

the element at the top of the stack

Packit ae235b
Packit ae235b
Packit ae235b

Packit ae235b
Packit ae235b

g_trash_stack_peek ()

Packit ae235b
gpointer
Packit ae235b
g_trash_stack_peek (GTrashStack **stack_p);
Packit ae235b
Packit ae235b

g_trash_stack_peek has been deprecated since version 2.48 and should not be used in newly-written code.

Packit ae235b

GTrashStack is deprecated without replacement

Packit ae235b
Packit ae235b

Returns the element at the top of a GTrashStack

Packit ae235b
which may be NULL.

Packit ae235b
Packit ae235b

Parameters

Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

stack_p

Packit ae235b

a GTrashStack

Packit ae235b
 
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

Returns

Packit ae235b

the element at the top of the stack

Packit ae235b
Packit ae235b
Packit ae235b

Packit ae235b
Packit ae235b

g_trash_stack_height ()

Packit ae235b
guint
Packit ae235b
g_trash_stack_height (GTrashStack **stack_p);
Packit ae235b
Packit ae235b

g_trash_stack_height has been deprecated since version 2.48 and should not be used in newly-written code.

Packit ae235b

GTrashStack is deprecated without replacement

Packit ae235b
Packit ae235b

Returns the height of a GTrashStack.

Packit ae235b

Note that execution of this function is of O(N) complexity

Packit ae235b
where N denotes the number of items on the stack.

Packit ae235b
Packit ae235b

Parameters

Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

stack_p

Packit ae235b

a GTrashStack

Packit ae235b
 
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

Returns

Packit ae235b

the height of the stack

Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

Types and Values

Packit ae235b
Packit ae235b

struct GTrashStack

Packit ae235b
struct GTrashStack {
Packit ae235b
  GTrashStack *next;
Packit ae235b
};
Packit ae235b
Packit ae235b
Packit ae235b

GTrashStack has been deprecated since version 2.48 and should not be used in newly-written code.

Packit ae235b

GTrashStack is deprecated without replacement

Packit ae235b
Packit ae235b

Each piece of memory that is pushed onto the stack

Packit ae235b
is cast to a GTrashStack*.

Packit ae235b
Packit ae235b

Members

Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

GTrashStack *next;

Packit ae235b

pointer to the previous element of the stack,

Packit ae235b
gets stored in the first sizeof (gpointer)
Packit ae235b
bytes of the element

Packit ae235b
 
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

Generated by GTK-Doc V1.27
Packit ae235b
</body>
Packit ae235b
</html>