Function Macro

GLibGNUC_ALLOC_SIZE2

since: 2.18

Declaration

#define G_GNUC_ALLOC_SIZE2 (
  x,
  y
)

Description

Expands to the GNU C alloc_size function attribute if the compiler is a new enough gcc. This attribute tells the compiler that the function returns a pointer to memory of a size that is specified by the product of two function parameters.

Place the attribute after the function declaration, just before the semicolon.

gpointer g_malloc_n (gsize n_blocks,
                     gsize n_block_bytes) G_GNUC_MALLOC G_GNUC_ALLOC_SIZE2(1, 2);

See the GNU C documentation for more details.

Available since: 2.18

This function is not directly available to language bindings.

Parameters

x

Type: -

The index of the argument specifying one factor of the allocation size.

y

Type: -

The index of the argument specifying the second factor of the allocation size.