switch (action) {
case bh_allocator_action_alloc: {
-
+ bh_align(size, alignment);
bh_align(alloc_arena->size, alignment);
- // TODO: Do this better because right now bh__align is bad
- // size = bh__align(size, alignment);
if (size > alloc_arena->arena_size - size_of(ptr)) {
// Size too large for the arena
return NULL;
typedef struct Package Package;
typedef struct Scope {
+ u64 id;
struct Scope *parent;
OnyxFilePos created_at;
bh_table(AstNode *) symbols;
return Check_Success;
}
+ if (expr->kind == Ast_Kind_Polymorphic_Proc) {
+ // Polymoprhic procedures do not need to be checked. Their concrete instantiations
+ // will be checked when they are created.
+ return Check_Success;
+ }
+
fill_in_type(expr);
CheckStatus retval = Check_Success;
//
// Scoping
//
+static u64 next_scope_id = 1;
+
Scope* scope_create(bh_allocator a, Scope* parent, OnyxFilePos created_at) {
Scope* scope = bh_alloc_item(a, Scope);
+ scope->id = next_scope_id++;
scope->parent = parent;
scope->created_at = created_at;
- scope->symbols = NULL;
+ scope->symbols = NULL;
bh_table_init(global_heap_allocator, scope->symbols, 64);
return scope;