diff --git a/docs/hacking.html.in b/docs/hacking.html.in index f3ad43eee7..0f4587522d 100644 --- a/docs/hacking.html.in +++ b/docs/hacking.html.in @@ -1051,6 +1051,27 @@ BAD:
virStrerror
g_strerror()
function should be used instead,
which has a simpler calling convention as an added benefit.deprecated version | GLib version | Notes |
---|---|---|
VIR_ALLOC(var) | g_new0(var_t, 1) |
+ the type needs to be passed explicitly |
VIR_ALLOC_N | g_new0(var_t, n) | |
VIR_REALLOC_N | g_renew(var_t, ptr, n) |
+ the newly added memory is not zeroed |
VIR_EXPAND_N | g_renew(var_t, ptr, n) |
+ zero the new memory manually or use an array type |
VIR_SHRINK_N | g_renew(var_t, ptr, n) | +|
VIR_APPEND_ELEMENT | g_array_append_val |
+ g_ptr_array_add or g_byte_array_append |
VIR_INSERT_ELEMENT | g_array_insert_val |
+ g_ptr_array_insert |
VIR_DELETE_ELEMENT | g_array_remove_index |
+ g_ptr_array_remove_index or g_byte_array_remove_index |
VIR_FREE | g_free |
+ g_free does not zero the pointer |