|
Serene Runtime 1.0.0
C runtime for the Serene programming language
|
Engine is a structure to own the long living and main pieces of the compiler. More...
#include <engine.h>
Data Fields | |
| _Atomic srn_object_id_t | object_id_counter |
| An unsigned counter to allocate object ids atomically. | |
| srn_mm_t * | mm |
| Memory manager. | |
| srn_scheduler_t * | scheduler |
| The fiber scheduler, set by srn_sched_init. | |
| srn_seed_t | seed |
| We use the seed for hashing and the value will be generated at random for each new context. | |
Engine is a structure to own the long living and main pieces of the compiler.
There will be only oe instance of the engine at anytime.
| _Atomic srn_object_id_t srn_engine_t::object_id_counter |
An unsigned counter to allocate object ids atomically.
Any object in Serene must have a unique id, this id is not guaranteed to be the same on each run. We use this id as the routing key on the context level to connect different pieces of information related to the same object together. ONLY INTERACT WITH THIS VIA allocate_object_id.
| srn_scheduler_t* srn_engine_t::scheduler |
| srn_seed_t srn_engine_t::seed |
We use the seed for hashing and the value will be generated at random for each new context.
There's concern about hashmap collioson DoS attacks but as far as I can see other compilers are doing a similar thing with a non-cryptographic hashing function. we use xxHash but others are using the non-cryptographic version of SipHash with a random seed as well.