fixed: clone not using memory cache
This commit is contained in:
parent
b9226ad3f5
commit
f51e72d154
|
@ -143,9 +143,11 @@ static void build_target(ModuleFileStack *unit, const TargetConfig *target) {
|
|||
|
||||
print_ast_to_file(ast, target);
|
||||
Module * test = create_set(ast);
|
||||
free(test);
|
||||
|
||||
// TODO: parse AST to semantic values
|
||||
// TODO: backend codegen
|
||||
|
||||
mem_free(test);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -536,13 +536,7 @@ TypeValue createTypeValue(AST_NODE_PTR currentNode){
|
|||
return value;
|
||||
}
|
||||
|
||||
static inline void* clone(int size, void* ptr) {
|
||||
char* data = mem_alloc(MemoryNamespaceSet,size);
|
||||
memcpy(data, ptr, size);
|
||||
return data;
|
||||
}
|
||||
|
||||
#define CLONE(x) clone(sizeof(x), (void*)&(x))
|
||||
#define CLONE(x) mem_clone(MemoryNamespaceSet, (void*)&(x), sizeof(x))
|
||||
|
||||
TypeValue createString(AST_NODE_PTR currentNode) {
|
||||
DEBUG("create String");
|
||||
|
|
Loading…
Reference in New Issue