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 |
|---|---|---|
|
|
Initial size of the buffer’s allocated memory. |
|
|
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