From 893b86b93941d5034eee63ee67469a32f1e764b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Fri, 3 Feb 2023 16:24:18 +0100 Subject: [PATCH] gslice: Mark memory arguments and return values as nullable when it's the case GSlice can handle NULL arguments or return NULL values, but we did not properly mark them all the times. --- glib/gslice.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/glib/gslice.c b/glib/gslice.c index 63a048458..6bcb2020b 100644 --- a/glib/gslice.c +++ b/glib/gslice.c @@ -188,7 +188,7 @@ g_slice_get_config_state (GSliceConfig ckey, /** * g_slice_free: * @type: the type of the block to free, typically a structure name - * @mem: a pointer to the block to free + * @mem: (nullable): a pointer to the block to free * * A convenience macro to free a block of memory that has * been allocated from the slice allocator. @@ -208,7 +208,7 @@ g_slice_get_config_state (GSliceConfig ckey, /** * g_slice_free_chain: * @type: the type of the @mem_chain blocks - * @mem_chain: a pointer to the first block of the chain + * @mem_chain: (nullable): a pointer to the first block of the chain * @next: the field name of the next pointer in @type * * Frees a linked list of memory blocks of structure type @type. @@ -239,7 +239,7 @@ g_slice_get_config_state (GSliceConfig ckey, * Since GLib 2.76 this always uses the system malloc() implementation * internally. * - * Returns: a pointer to the allocated memory block, which will + * Returns: (nullable): a pointer to the allocated memory block, which will * be %NULL if and only if @mem_size is 0 * * Since: 2.10 @@ -265,8 +265,8 @@ g_slice_alloc (gsize mem_size) * Since GLib 2.76 this always uses the system malloc() implementation * internally. * - * Returns: a pointer to the allocated block, which will be %NULL if and only - * if @mem_size is 0 + * Returns: (nullable): a pointer to the allocated block, which will be %NULL + * if and only if @mem_size is 0 * * Since: 2.10 */ @@ -292,8 +292,8 @@ g_slice_alloc0 (gsize mem_size) * Since GLib 2.76 this always uses the system malloc() implementation * internally. * - * Returns: a pointer to the allocated memory block, which will be %NULL if and - * only if @mem_size is 0 + * Returns: (nullable): a pointer to the allocated memory block, + * which will be %NULL if and only if @mem_size is 0 * * Since: 2.14 */ @@ -310,7 +310,7 @@ g_slice_copy (gsize mem_size, /** * g_slice_free1: * @block_size: the size of the block - * @mem_block: a pointer to the block to free + * @mem_block: (nullable): a pointer to the block to free * * Frees a block of memory. * @@ -340,7 +340,7 @@ g_slice_free1 (gsize mem_size, /** * g_slice_free_chain_with_offset: * @block_size: the size of the blocks - * @mem_chain: a pointer to the first block of the chain + * @mem_chain: (nullable): a pointer to the first block of the chain * @next_offset: the offset of the @next field in the blocks * * Frees a linked list of memory blocks of structure type @type.