|
unilink
0.4.3
A simple C++ library for unified async communication
|
Memory validation utilities for enhanced safety. More...
Functions | |
| bool | is_memory_accessible (const void *ptr, size_t size) |
| Validate memory region accessibility. More... | |
| bool | is_memory_aligned (const void *ptr, size_t alignment) |
| Validate memory alignment. More... | |
| bool | check_buffer_bounds (const void *ptr, size_t size, size_t canary_size=8) |
| Check for buffer overflow/underflow patterns. More... | |
| void | initialize_canary_bytes (void *ptr, size_t size, size_t canary_size=8) |
| Initialize canary bytes around buffer. More... | |
| bool | validate_canary_bytes (const void *ptr, size_t size, size_t canary_size=8) |
| Validate canary bytes around buffer. More... | |
| void | safe_memcpy_validated (void *dest, const void *src, size_t size) |
| Safe memory copy with comprehensive validation. More... | |
| void | safe_memmove_validated (void *dest, const void *src, size_t size) |
| Safe memory move with comprehensive validation. More... | |
| void | safe_memset_validated (void *ptr, int value, size_t size) |
| Safe memory set with comprehensive validation. More... | |
| bool | is_double_free (void *ptr) |
| Check for double-free conditions. More... | |
| bool | is_use_after_free (const void *ptr) |
| Check for use-after-free conditions. More... | |
Memory validation utilities for enhanced safety.
| bool unilink::memory::memory_validator::check_buffer_bounds | ( | const void * | ptr, |
| size_t | size, | ||
| size_t | canary_size = 8 |
||
| ) |
Check for buffer overflow/underflow patterns.
| ptr | Pointer to buffer |
| size | Buffer size |
| canary_size | Size of canary bytes to check |
| void unilink::memory::memory_validator::initialize_canary_bytes | ( | void * | ptr, |
| size_t | size, | ||
| size_t | canary_size = 8 |
||
| ) |
Initialize canary bytes around buffer.
| ptr | Pointer to buffer |
| size | Buffer size |
| canary_size | Size of canary bytes |
| bool unilink::memory::memory_validator::is_double_free | ( | void * | ptr | ) |
Check for double-free conditions.
| ptr | Pointer that was freed |
| bool unilink::memory::memory_validator::is_memory_accessible | ( | const void * | ptr, |
| size_t | size | ||
| ) |
Validate memory region accessibility.
| ptr | Pointer to memory region |
| size | Size of memory region |
| bool unilink::memory::memory_validator::is_memory_aligned | ( | const void * | ptr, |
| size_t | alignment | ||
| ) |
Validate memory alignment.
| ptr | Pointer to check |
| alignment | Required alignment |
| bool unilink::memory::memory_validator::is_use_after_free | ( | const void * | ptr | ) |
Check for use-after-free conditions.
| ptr | Pointer to check |
| void unilink::memory::memory_validator::safe_memcpy_validated | ( | void * | dest, |
| const void * | src, | ||
| size_t | size | ||
| ) |
Safe memory copy with comprehensive validation.
| dest | Destination buffer |
| src | Source buffer |
| size | Number of bytes to copy |
| std::invalid_argument | if validation fails |
| void unilink::memory::memory_validator::safe_memmove_validated | ( | void * | dest, |
| const void * | src, | ||
| size_t | size | ||
| ) |
Safe memory move with comprehensive validation.
| dest | Destination buffer |
| src | Source buffer |
| size | Number of bytes to move |
| std::invalid_argument | if validation fails |
| void unilink::memory::memory_validator::safe_memset_validated | ( | void * | ptr, |
| int | value, | ||
| size_t | size | ||
| ) |
Safe memory set with comprehensive validation.
| ptr | Pointer to buffer |
| value | Value to set |
| size | Number of bytes to set |
| std::invalid_argument | if validation fails |
| bool unilink::memory::memory_validator::validate_canary_bytes | ( | const void * | ptr, |
| size_t | size, | ||
| size_t | canary_size = 8 |
||
| ) |
Validate canary bytes around buffer.
| ptr | Pointer to buffer |
| size | Buffer size |
| canary_size | Size of canary bytes |