Introduce the allocator stuff again
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
|
||||
|
||||
#define AST_NEW(T,ikind,ipos,iflags) \
|
||||
Ast_##T *result = arena_push_type(pctx->perm, Ast_##T, AF_ZeroMemory);\
|
||||
Ast_##T *result = allocate_struct(pctx->perm, Ast_##T); \
|
||||
result->flags = iflags; \
|
||||
result->kind = AST_##ikind; \
|
||||
result->parent_scope = pctx->currently_parsed_scope; \
|
||||
@@ -11,7 +11,7 @@
|
||||
#define ast_new(T,kind,pos,flags) (T *)_ast_new(sizeof(T), kind, pos, flags)
|
||||
CORE_Static Ast *
|
||||
_ast_new(size_t size, Ast_Kind kind, Token *pos, Ast_Flag flags = 0){
|
||||
Ast *result = (Ast *)arena_push_size(pctx->perm, size, AF_ZeroMemory);
|
||||
Ast *result = (Ast *)allocate_size(pctx->perm, size);
|
||||
result->flags = flags;
|
||||
result->kind = kind;
|
||||
result->parent_scope = pctx->currently_parsed_scope;
|
||||
|
||||
Reference in New Issue
Block a user