-
Notifications
You must be signed in to change notification settings - Fork 0
Memory
Spotandjake edited this page Aug 3, 2021
·
7 revisions
- Store
- Malloc
- Read
- Function: 1
- Closure: 2
- Boolean: 3
- String: 4
- Number: 5
- Array: 6
- Parameters: 7
interface CommonHeader {
rtSize: i32;
refs: i32; //reference count for gc
rtId: i32;
// Payload starts here
}
interface Function {
CommonHeader: CommonHeader[];
index: i32[];
moduleId: i32[];
closure: i32[];
}
interface Closure {
CommonHeader: CommonHeader[];
mem_ptr: [length];
}
interface Boolean {
CommonHeader: CommonHeader[];
value: [];
}
interface String {
CommonHeader: CommonHeader[];
char: i32[length];
}
interface Number {
CommonHeader: CommonHeader[];
boxedType: i32; // i32 = 1, i64 = 2, f32 = 3, f64 = 4
value: (i32|i64|f32|f64);
}
interface Array {
CommonHeader: CommonHeader[];
mem_ptr: [length];
}
interface Parameter {
CommonHeader: CommonHeader[];
mem_ptr: [length];
}