glib收录(一)

在此收录一些遇到过的关于glib的知识点:

g_mem_set_vtable ()

void                g_mem_set_vtable                    (GMemVTable *vtable);

Sets the GMemVTable to use for memory allocation. You can use this to providecustom memory allocation routines. This function must be calledbefore using any other GLib functions. The vtable only needs toprovide malloc(), realloc(), and free() functions; GLib can provide defaultimplementations of the others. The malloc() and realloc() implementationsshould return NULL on failure, GLib will handle error-checking for you.vtable is copied, so need not persist after this function has been called.

上面的解释来自:https://developer.gnome.org/glib/2.28/glib-Memory-Allocation.html#g-mem-set-vtable


你可能感兴趣的:(glib收录(一))