Glib Memory

glib wraps the standard malloc() and free() with its own g_ variants, g_malloc() and g_free(), shown in Figure 2-5. These are nice in several small ways: • g_malloc() always returns a gpointer, never a char*, so there’s no need to cast the return value. • g_malloc() aborts the program if the underlying malloc() fails, so…