![]() |
Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
|
Memory operations. More...
#include <roc_core/memory_ops.h>
Public Types | |
enum | { Pattern_BeforeUse = 0x7a , Pattern_AfterUse = 0x7d , Pattern_Canary = 0x7b } |
Some good filler patterns for memory. If we fill memory with these values and interpret it as 16-bit or 32-bit integers, or as floats, the values will be rather high and will sound loudly when trying to play them on sound card. We use a few different patterns to make it easy to distinguish between them in debugger. More... | |
Static Public Member Functions | |
static void | poison_before_use (void *data, size_t size) |
Poison memory that is going to be used. Helps catching uninitialized access bugs. | |
static void | poison_after_use (void *data, size_t size) |
Poison memory that is no more used. Helps catching use after free bugs. | |
static void | prepare_canary (void *data, size_t size) |
Prepare canary memory. Helps catching buffer overflow/underflow bugs. | |
static bool | check_canary (void *data, size_t size) |
Check canary memory. | |
Memory operations.
Definition at line 21 of file memory_ops.h.
Some good filler patterns for memory. If we fill memory with these values and interpret it as 16-bit or 32-bit integers, or as floats, the values will be rather high and will sound loudly when trying to play them on sound card. We use a few different patterns to make it easy to distinguish between them in debugger.
Definition at line 45 of file memory_ops.h.
Check canary memory.
Poison memory that is no more used. Helps catching use after free bugs.
Poison memory that is going to be used. Helps catching uninitialized access bugs.
Prepare canary memory. Helps catching buffer overflow/underflow bugs.