1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/loose.dtd">
5
>Why use g_print, g_malloc, g_strdup and fellow glib
9
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
12
HREF="book1.html"><LINK
15
HREF="c876.html"><LINK
17
TITLE="Memory does not seem to be released when I free the
18
list nodes I've allocated"
19
HREF="x902.html"><LINK
21
TITLE="What's a GScanner and how do I use one?"
22
HREF="x919.html"></HEAD
33
SUMMARY="Header navigation table"
52
><<< Previous</A
66
>Next >>></A
79
>Why use g_print, g_malloc, g_strdup and fellow glib
83
>Thanks to Tim Janik who wrote to gtk-list: (slightly
88
>"Regarding g_malloc(), g_free() and siblings, these
89
functions are much safer than their libc equivalents. For
90
example, g_free() just returns if called with NULL. Also, if
91
USE_DMALLOC is defined, the definition for these functions
92
changes (in glib.h) to use MALLOC(), FREE() etc... If
93
MEM_PROFILE or MEM_CHECK are defined, there are even small
94
statistics made counting the used block sizes (shown by
95
g_mem_profile() / g_mem_check())."</SPAN
100
>"Considering the fact that glib provides an interface for
101
memory chunks to save space if you have lots of blocks that
102
are always the same size and to mark them ALLOC_ONLY if
103
needed, it is just straight forward to create a small saver
104
(debug able) wrapper around the normal malloc/free stuff as
105
well - just like gdk covers Xlib. ;)"</SPAN
110
>"Using g_error() and g_warning() inside of applications
111
like the GIMP that fully rely on gtk even gives the
112
opportunity to pop up a window showing the messages inside of
113
a gtk window with your own handler (by using
114
g_set_error_handler()) along the lines of
127
SUMMARY="Footer navigation table"
140
><<< Previous</A
158
>Next >>></A
166
>Memory does not seem to be released when I free the
167
list nodes I've allocated</TD
181
>What's a GScanner and how do I use one?</TD
b'\\ No newline at end of file'