-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgc.h
More file actions
23 lines (21 loc) · 620 Bytes
/
Copy pathgc.h
File metadata and controls
23 lines (21 loc) · 620 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#ifndef GC_H
#define GC_H
#include <stddef.h>
#include "value.h"
typedef struct Runtime Runtime;
typedef struct Environment Environment;
void* gcAllocateObject(
Runtime* runtime,
size_t size,
GcObjectType type
);
int gcPushRoot(Runtime* runtime, Value value);
void gcPopRoot(Runtime* runtime);
void gcMarkValue(Runtime* runtime, const Value* value);
void gcMarkEnvironment(Runtime* runtime, Environment* env);
void gcMarkRoots(Runtime* runtime);
void gcTraceReferences(Runtime* runtime);
void gcCollect(Runtime* runtime);
void gcSafePoint(Runtime* runtime);
void gcFreeAllObjects(Runtime* runtime);
#endif