|
BFC-Compiler
A C23 Brainfuck compiler
|
Checked array-allocation helpers. More...
#include <stddef.h>Go to the source code of this file.
Macros | |
| #define | BFC_MALLOC_ARRAY(pointer, count) |
| Allocates an array and infers the element size from the pointer expression. | |
| #define | BFC_CALLOC_ARRAY(pointer, count) |
| #define | BFC_REALLOC_ARRAY(pointer, count) |
Functions | |
| void * | bfc_malloc_array (size_t count, size_t element_size) |
| Allocates an uninitialized array after checking count multiplication. | |
| void * | bfc_calloc_array (size_t count, size_t element_size) |
| Allocates a zero-initialized array after checking count multiplication. | |
| void * | bfc_realloc_array (void *allocation, size_t count, size_t element_size) |
| Resizes a typed array after checking count multiplication. | |
Checked array-allocation helpers.
Provides overflow-checked allocation functions for typed arrays and convenience macros that infer element size from pointer type.
| #define BFC_CALLOC_ARRAY | ( | pointer, | |
| count ) |
| #define BFC_MALLOC_ARRAY | ( | pointer, | |
| count ) |
Allocates an array and infers the element size from the pointer expression.
| #define BFC_REALLOC_ARRAY | ( | pointer, | |
| count ) |
| void * bfc_calloc_array | ( | size_t | count, |
| size_t | element_size ) |
Allocates a zero-initialized array after checking count multiplication.
Allocates a zero-filled typed array after checked size multiplication.
| [in] | count | Number of elements. |
| [in] | element_size | Size of each element in bytes. |
Allocates a zero-initialized array after checking count multiplication.
| void * bfc_malloc_array | ( | size_t | count, |
| size_t | element_size ) |
Allocates an uninitialized array after checking count multiplication.
Allocates an uninitialized typed array after checked size multiplication.
| [in] | count | Number of elements. |
| [in] | element_size | Size of each element in bytes. |
Allocates an uninitialized array after checking count multiplication.
| void * bfc_realloc_array | ( | void * | allocation, |
| size_t | count, | ||
| size_t | element_size ) |
Resizes a typed array after checking count multiplication.
Resizes a typed array after checked size multiplication.
| [in,out] | allocation | Existing allocation, or nullptr. |
| [in] | count | Requested number of elements. |
| [in] | element_size | Size of each element in bytes. |
Resizes a typed array after checking count multiplication.