|
BFC-Compiler
A C23 Brainfuck compiler
|
Checked array-allocation implementation. More...
Functions | |
| void * | bfc_malloc_array (size_t count, size_t element_size) |
| Allocates an uninitialized typed array after checked size multiplication. | |
| void * | bfc_calloc_array (size_t count, size_t element_size) |
| Allocates a zero-filled typed array after checked size multiplication. | |
| void * | bfc_realloc_array (void *allocation, size_t count, size_t element_size) |
| Resizes a typed array after checked size multiplication. | |
Checked array-allocation implementation.
Uses C23 checked arithmetic to reject element-count multiplication overflow before allocation.
| void * bfc_calloc_array | ( | size_t | count, |
| size_t | element_size ) |
Allocates a zero-filled typed array after checked size multiplication.
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. |
| void * bfc_malloc_array | ( | size_t | count, |
| size_t | element_size ) |
Allocates an uninitialized typed array after checked size multiplication.
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. |
| void * bfc_realloc_array | ( | void * | allocation, |
| size_t | count, | ||
| size_t | element_size ) |
Resizes a typed array after checked size multiplication.
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. |