mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-04 18:26:19 +01:00
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.
This commit is contained in:
parent
6af6f3eb9b
commit
893b86b939
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user