fixed: clone not using memory cache

This commit is contained in:
Sven Vogel 2024-06-07 12:37:50 +02:00
parent b9226ad3f5
commit f51e72d154
2 changed files with 4 additions and 8 deletions

View File

@ -143,9 +143,11 @@ static void build_target(ModuleFileStack *unit, const TargetConfig *target) {
print_ast_to_file(ast, target); print_ast_to_file(ast, target);
Module * test = create_set(ast); Module * test = create_set(ast);
free(test);
// TODO: parse AST to semantic values // TODO: parse AST to semantic values
// TODO: backend codegen // TODO: backend codegen
mem_free(test);
} }
} }

View File

@ -536,13 +536,7 @@ TypeValue createTypeValue(AST_NODE_PTR currentNode){
return value; return value;
} }
static inline void* clone(int size, void* ptr) { #define CLONE(x) mem_clone(MemoryNamespaceSet, (void*)&(x), sizeof(x))
char* data = mem_alloc(MemoryNamespaceSet,size);
memcpy(data, ptr, size);
return data;
}
#define CLONE(x) clone(sizeof(x), (void*)&(x))
TypeValue createString(AST_NODE_PTR currentNode) { TypeValue createString(AST_NODE_PTR currentNode) {
DEBUG("create String"); DEBUG("create String");