|
Serene Runtime 1.0.0
C runtime for the Serene programming language
|
#include <stdbool.h>#include <stddef.h>#include <stdint.h>Go to the source code of this file.
Data Structures | |
| struct | srn_context_t |
Macros | |
| #define | SRN_HASH_TYPE uint32_t |
| #define | SRN_SEED_TYPE uint32_t |
| #define | ALLOC(ctx, T) |
| #define | ALLOCN(ctx, T, N) |
Typedefs | |
| typedef size_t | srn_block_id_t |
The block id is effectively just an index in the blocks array in srn_mm_t. | |
| typedef uintptr_t | object_id_t |
| typedef SRN_HASH_TYPE | srn_hash_t |
| typedef SRN_SEED_TYPE | srn_seed_t |
| typedef struct srn_context_t | srn_context_t |
Functions | |
| srn_context_t * | srn_context_make (srn_engine_t *engine) |
| Make an empty context, by allocating a new memory block. | |
| int | srn_context_release (srn_context_t *ctx) |
| void * | srn_allocate (const srn_context_t *ctx, size_t size, size_t alignment) |
| void | srn_release (const srn_context_t *ctx, void *ptr) |
| #define ALLOC | ( | ctx, | |
| T ) |
| #define ALLOCN | ( | ctx, | |
| T, | |||
| N ) |
| typedef uintptr_t object_id_t |
| typedef size_t srn_block_id_t |
The block id is effectively just an index in the blocks array in srn_mm_t.
NOTE: We use the value SIZE_MAX to indicate NO BLOCK ID. For example, when embedding a srn_block_id_t field in a data structure. If the value of the field is SIZE_MAX ((size_t) -1), it indicates that no block id is present.
| typedef struct srn_context_t srn_context_t |
| typedef SRN_HASH_TYPE srn_hash_t |
| typedef SRN_SEED_TYPE srn_seed_t |
| void * srn_allocate | ( | const srn_context_t * | ctx, |
| size_t | size, | ||
| size_t | alignment ) |
Definition at line 72 of file context.c.
| srn_context_t * srn_context_make | ( | srn_engine_t * | engine | ) |
Make an empty context, by allocating a new memory block.
The returning context is a root context (no parent).
Definition at line 38 of file context.c.
| int srn_context_release | ( | srn_context_t * | ctx | ) |
Definition at line 63 of file context.c.
| void srn_release | ( | const srn_context_t * | ctx, |
| void * | ptr ) |