1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/loose.dtd">
5
>Memory Management</TITLE
8
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
10
TITLE="GTK+ 2.0 Tutorial"
11
HREF="book1.html"><LINK
14
HREF="c2025.html"><LINK
16
TITLE="Singly Linked Lists"
17
HREF="x2057.html"><LINK
20
HREF="x2078.html"></HEAD
31
SUMMARY="Header navigation table"
40
>GTK+ 2.0 Tutorial</TH
50
><<< Previous</A
64
>Next >>></A
76
NAME="SEC-MEMORYMANAGEMENT"
86
CLASS="PROGRAMLISTING"
87
>gpointer g_malloc( gulong size );</PRE
92
>This is a replacement for malloc(). You do not need to check the return
93
value as it is done for you in this function. If the memory allocation
94
fails for whatever reasons, your applications will be terminated.</P
102
CLASS="PROGRAMLISTING"
103
>gpointer g_malloc0( gulong size );</PRE
108
>Same as above, but zeroes the memory before returning a pointer to it.</P
116
CLASS="PROGRAMLISTING"
117
>gpointer g_realloc( gpointer mem,
123
>Relocates "size" bytes of memory starting at "mem". Obviously, the
124
memory should have been previously allocated.</P
132
CLASS="PROGRAMLISTING"
133
>void g_free( gpointer mem );</PRE
138
>Frees memory. Easy one. If <TT
141
> is NULL it simply returns.</P
149
CLASS="PROGRAMLISTING"
150
>void g_mem_profile( void );</PRE
155
>Dumps a profile of used memory, but requires that you add <TT
159
> to the top of glib/gmem.c and re-make and make install.</P
167
CLASS="PROGRAMLISTING"
168
>void g_mem_check( gpointer mem );</PRE
173
>Checks that a memory location is valid. Requires you add <TT
177
> to the top of gmem.c and re-make and make install.</P
184
SUMMARY="Footer navigation table"
197
><<< Previous</A
215
>Next >>></A
223
>Singly Linked Lists</TD
b'\\ No newline at end of file'