From 822b511cb660feca4bb73598dd49d418d42f97c5 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Mon, 9 Jul 2018 10:07:07 +0100 Subject: [PATCH] Update rcbox annotations for acquire/release functions The accepted behaviour for reference counting functions can be described as such: - acquire: takes a pointer to a memory area and returns the same pointer with its reference count increased; this means that the returned value's ownership is fully transfered from the callee to the caller - release: takes a pointer to a memory area and drops the reference count; this means that the caller transfers the ownership of the argument to the callee These annotations are mostly meant for documentation purposes: high level language bindings are unlikely to use them, as they have their own reference counting semantics on top of GLib's own, and they should not expose this API to their own consumers. --- glib/garcbox.c | 6 +++--- glib/grcbox.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/glib/garcbox.c b/glib/garcbox.c index ddbf04c83..9c1bd8fe5 100644 --- a/glib/garcbox.c +++ b/glib/garcbox.c @@ -274,7 +274,7 @@ gpointer * * Atomically acquires a reference on the data pointed by @mem_block. * - * Returns: (transfer none) (not nullable): a pointer to the data, + * Returns: (transfer full) (not nullable): a pointer to the data, * with its reference count increased * * Since: 2.58 @@ -298,7 +298,7 @@ gpointer /** * g_atomic_rc_box_release: - * @mem_block: (not nullable): a pointer to reference counted data + * @mem_block: (transfer full) (not nullable): a pointer to reference counted data * * Atomically releases a reference on the data pointed by @mem_block. * @@ -315,7 +315,7 @@ g_atomic_rc_box_release (gpointer mem_block) /** * g_atomic_rc_box_release_full: - * @mem_block: (not nullable): a pointer to reference counted data + * @mem_block: (transfer full) (not nullable): a pointer to reference counted data * @clear_func: (not nullable): a function to call when clearing the data * * Atomically releases a reference on the data pointed by @mem_block. diff --git a/glib/grcbox.c b/glib/grcbox.c index 448bc0c6a..204f4bc9e 100644 --- a/glib/grcbox.c +++ b/glib/grcbox.c @@ -351,7 +351,7 @@ gpointer * * Acquires a reference on the data pointed by @mem_block. * - * Returns: (transfer none) (not nullable): a pointer to the data, + * Returns: (transfer full) (not nullable): a pointer to the data, * with its reference count increased * * Since: 2.58 @@ -375,7 +375,7 @@ gpointer /** * g_rc_box_release: - * @mem_block: (not nullable): a pointer to reference counted data + * @mem_block: (transfer full) (not nullable): a pointer to reference counted data * * Releases a reference on the data pointed by @mem_block. * @@ -392,7 +392,7 @@ g_rc_box_release (gpointer mem_block) /** * g_rc_box_release_full: - * @mem_block: (not nullable): a pointer to reference counted data + * @mem_block: (transfer full) (not nullable): a pointer to reference counted data * @clear_func: (not nullable): a function to call when clearing the data * * Releases a reference on the data pointed by @mem_block.