mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 11:35:19 +00:00
docs: glib-adoption: add links to GLib documentation
Make life a bit easier for people unfamiliar with GLib. Signed-off-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Andrea Bolognani <abologna@redhat.com>
This commit is contained in:
parent
900e54ed2e
commit
674f6dcb9d
@ -18,6 +18,8 @@ Memory allocation
|
|||||||
``VIR_ALLOC``, ``VIR_REALLOC``, ``VIR_RESIZE_N``,
|
``VIR_ALLOC``, ``VIR_REALLOC``, ``VIR_RESIZE_N``,
|
||||||
``VIR_EXPAND_N``, ``VIR_SHRINK_N``, ``VIR_FREE``
|
``VIR_EXPAND_N``, ``VIR_SHRINK_N``, ``VIR_FREE``
|
||||||
|
|
||||||
|
https://developer.gnome.org/glib/stable/glib-Memory-Allocation.html
|
||||||
|
|
||||||
Prefer the GLib APIs ``g_new0``/``g_renew``/ ``g_free`` in most
|
Prefer the GLib APIs ``g_new0``/``g_renew``/ ``g_free`` in most
|
||||||
cases. There should rarely be a need to use
|
cases. There should rarely be a need to use
|
||||||
``g_malloc``/``g_realloc``. **NEVER MIX** use of the classic
|
``g_malloc``/``g_realloc``. **NEVER MIX** use of the classic
|
||||||
@ -28,6 +30,8 @@ Memory allocation
|
|||||||
Array operations
|
Array operations
|
||||||
``VIR_APPEND_ELEMENT``, ``VIR_INSERT_ELEMENT``, ``VIR_DELETE_ELEMENT``
|
``VIR_APPEND_ELEMENT``, ``VIR_INSERT_ELEMENT``, ``VIR_DELETE_ELEMENT``
|
||||||
|
|
||||||
|
https://developer.gnome.org/glib/stable/glib-Arrays.html
|
||||||
|
|
||||||
Instead of using plain C arrays, it is preferrable to use one of
|
Instead of using plain C arrays, it is preferrable to use one of
|
||||||
the GLib types, ``GArray``, ``GPtrArray`` or ``GByteArray``.
|
the GLib types, ``GArray``, ``GPtrArray`` or ``GByteArray``.
|
||||||
These all use a struct to track the array memory and size
|
These all use a struct to track the array memory and size
|
||||||
|
Loading…
Reference in New Issue
Block a user