|
libcbor 0.12.0
libcbor is a C library for parsing and generating CBOR, the general-purpose schema-less binary data format.
|
Go to the source code of this file.
Functions | |
| size_t | _cbor_highest_bit (size_t number) |
| Highest on bit position. | |
| bool | _cbor_safe_to_multiply (size_t a, size_t b) |
Can a and b be multiplied without overflowing size_t? | |
| bool | _cbor_safe_to_add (size_t a, size_t b) |
Can a and b be added without overflowing size_t? | |
| size_t | _cbor_safe_signaling_add (size_t a, size_t b) |
Adds a and b, propagating zeros and returning 0 on overflow. | |
| void * | _cbor_alloc_multiple (size_t item_size, size_t item_count) |
| Overflow-proof contiguous array allocation. | |
| void * | _cbor_realloc_multiple (void *pointer, size_t item_size, size_t item_count) |
| Overflow-proof contiguous array reallocation. | |
| void * _cbor_alloc_multiple | ( | size_t | item_size, |
| size_t | item_count ) |
Overflow-proof contiguous array allocation.
| item_size | |
| item_count |
Definition at line 42 of file memory_utils.c.
| size_t _cbor_highest_bit | ( | size_t | number | ) |
Highest on bit position.
Definition at line 15 of file memory_utils.c.
| void * _cbor_realloc_multiple | ( | void * | pointer, |
| size_t | item_size, | ||
| size_t | item_count ) |
Overflow-proof contiguous array reallocation.
This implements the OpenBSD reallocarray functionality.
| pointer | |
| item_size | |
| item_count |
Definition at line 50 of file memory_utils.c.
| size_t _cbor_safe_signaling_add | ( | size_t | a, |
| size_t | b ) |
Adds a and b, propagating zeros and returning 0 on overflow.
Definition at line 36 of file memory_utils.c.
| bool _cbor_safe_to_add | ( | size_t | a, |
| size_t | b ) |
Can a and b be added without overflowing size_t?
Definition at line 30 of file memory_utils.c.
| bool _cbor_safe_to_multiply | ( | size_t | a, |
| size_t | b ) |
Can a and b be multiplied without overflowing size_t?
Definition at line 25 of file memory_utils.c.