gbuffer_create()

gbuffer_create()#

gbuffer_create() allocates and initializes a new gbuffer_t structure with a specified data size and maximum memory size.

Prototype

gbuffer_t *gbuffer_create(
    size_t data_size,
    size_t max_memory_size
);

Parameters

Key

Type

Description

data_size

size_t

Initial size of the buffer’s allocated memory.

max_memory_size

size_t

Maximum allowed memory size for the buffer.


Return Value

Returns a pointer to the newly allocated gbuffer_t structure, or NULL if memory allocation fails.

Notes

If memory allocation for the buffer fails, an error is logged, and NULL is returned.

Prototype

// Not applicable in JS

Prototype

# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples