mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-15 03:08:46 +00:00
Added tests + fixed bunch of bugs in GC implementation
This commit is contained in:
parent
3826c8dd32
commit
313997496d
9 changed files with 1577 additions and 1534 deletions
33
runtime/virt_stack.h
Normal file
33
runtime/virt_stack.h
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
//
|
||||
// Created by egor on 24.04.23.
|
||||
//
|
||||
|
||||
#ifndef LAMA_RUNTIME_VIRT_STACK_H
|
||||
#define LAMA_RUNTIME_VIRT_STACK_H
|
||||
#define RUNTIME_VSTACK_SIZE 100000
|
||||
|
||||
#include <stddef.h>
|
||||
#include <assert.h>
|
||||
|
||||
struct {
|
||||
size_t buf[RUNTIME_VSTACK_SIZE + 1];
|
||||
size_t cur;
|
||||
} typedef virt_stack;
|
||||
|
||||
virt_stack *vstack_create();
|
||||
|
||||
void vstack_destruct(virt_stack *st);
|
||||
|
||||
void vstack_init(virt_stack *st);
|
||||
|
||||
void vstack_push(virt_stack *st, size_t value);
|
||||
|
||||
size_t vstack_pop(virt_stack *st);
|
||||
|
||||
void* vstack_top(virt_stack *st);
|
||||
|
||||
size_t vstack_size(virt_stack *st);
|
||||
|
||||
size_t vstack_kth_from_start(virt_stack *st, size_t k);
|
||||
|
||||
#endif //LAMA_RUNTIME_VIRT_STACK_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue