Serene Runtime 1.0.0
C runtime for the Serene programming language
Loading...
Searching...
No Matches
base.h File Reference
#include <serene/rt/context.h>
#include <serene/rt/engine.h>
#include <serene/rt/mm/interface.h>
#include <serene/utils.h>
#include "acutest.h"
Include dependency graph for base.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define ENTRY(name, test)
 
#define ASSERT_NOT_NULL(x)
 
#define MAKE_ENGINE(mm, engine)
 
#define SHUTDOWN_ENGINE(mm, engine)
 
#define MAKE_CONTEXT(engine, x)
 
#define RELEASE_CONTEXT(x)
 

Macro Definition Documentation

◆ ASSERT_NOT_NULL

#define ASSERT_NOT_NULL ( x)
Value:
TEST_ASSERT(x != nullptr)
#define TEST_ASSERT(cond)
Definition acutest.h:119

Definition at line 30 of file base.h.

◆ ENTRY

#define ENTRY ( name,
test )
Value:
{name, test}

Definition at line 28 of file base.h.

◆ MAKE_CONTEXT

#define MAKE_CONTEXT ( engine,
x )
Value:
TEST_ASSERT(x != nullptr)
srn_context_t * srn_context_make(srn_engine_t *engine)
Make an empty context, by allocating a new memory block.
Definition context.c:38

Definition at line 42 of file base.h.

42#define MAKE_CONTEXT(engine, x) \
43 srn_context_t *x = srn_context_make(engine); \
44 TEST_ASSERT(x != nullptr)

◆ MAKE_ENGINE

#define MAKE_ENGINE ( mm,
engine )
Value:
srn_mm_t *mm = srn_mm_init(); \
TEST_ASSERT(mm != nullptr); \
srn_engine_t *engine = srn_engine_make(mm); \
TEST_ASSERT(engine != nullptr)
srn_mm_t * srn_mm_init()
Initialize the memory manager, this function will panic on error.
Definition default.c:294
srn_engine_t * srn_engine_make(srn_mm_t *mm)
Definition engine.c:92
Engine is a structure to own the long living and main pieces of the compiler.
Definition engine.h:49
Main memory manager structure that will own all the allocated blocks and data.
Definition interface.h:112

Definition at line 32 of file base.h.

32#define MAKE_ENGINE(mm, engine) \
33 srn_mm_t *mm = srn_mm_init(); \
34 TEST_ASSERT(mm != nullptr); \
35 srn_engine_t *engine = srn_engine_make(mm); \
36 TEST_ASSERT(engine != nullptr)

◆ RELEASE_CONTEXT

#define RELEASE_CONTEXT ( x)
Value:
int srn_context_release(srn_context_t *ctx)
Definition context.c:63

Definition at line 46 of file base.h.

◆ SHUTDOWN_ENGINE

#define SHUTDOWN_ENGINE ( mm,
engine )
Value:
srn_mm_shutdown(mm)
void srn_engine_shutdown(srn_engine_t *engine)
Definition engine.c:123

Definition at line 38 of file base.h.

38#define SHUTDOWN_ENGINE(mm, engine) \
39 srn_engine_shutdown(engine); \
40 srn_mm_shutdown(mm)