ssm
0.0.2
Runtime Library for the Sparse Synchronous Model
|
The struct template of a heap-allocated blob. More...
#include <ssm.h>
Data Fields | |
struct ssm_mm | mm |
Size-flavored memory management header. More... | |
char | payload [SSM_BLOB_SIZE_SCALE] |
Payload of heap-allocated blob. More... | |
The struct template of a heap-allocated blob.
Blobs are just arbitrary chunks of memory in the heap where any kind of data can be stored, with any layout. Since the memory manager will not scan blobs for pointers, any resources maintained within blobs must be managed via other means.
Though this struct's payload is only declared with 4 bytes, actual heap-allocated blobs may have large payloads. For instance, a 48-byte blob might look like:
The memory layout of all blobs is the same save for the size of the payload, so we use this struct definition as the "base case" of blobs.
To allow even larger blobs, the actual size of the payload is divided by SSM_BLOB_SIZE_SCALE while stored in the size field.
char payload[SSM_BLOB_SIZE_SCALE] |