diff --git a/core/runtime/core.odin b/core/runtime/core.odin index c4d3dd920..30f3b200a 100644 --- a/core/runtime/core.odin +++ b/core/runtime/core.odin @@ -166,7 +166,7 @@ Allocator :: struct { Context :: struct { - allocator: mem.Allocator, + allocator: Allocator, thread_id: int, user_data: any, @@ -494,7 +494,7 @@ __dynamic_array_reserve :: proc(array_: rawptr, elem_size, elem_align: int, cap: new_size := cap * elem_size; allocator := array.allocator; - new_data := allocator.procedure(allocator.data, mem.Allocator_Mode.Resize, new_size, elem_align, array.data, old_size, 0, loc); + new_data := allocator.procedure(allocator.data, Allocator_Mode.Resize, new_size, elem_align, array.data, old_size, 0, loc); if new_data == nil do return false; array.data = new_data; diff --git a/examples/demo/demo.odin b/examples/demo/demo.odin index 0c6d654f5..98b425fb1 100644 --- a/examples/demo/demo.odin +++ b/examples/demo/demo.odin @@ -14,6 +14,7 @@ import "core:strings" import "core:types" import "core:unicode/utf16" import "core:unicode/utf8" +import "core:c" import "core:atomics" import "core:thread" diff --git a/src/check_expr.cpp b/src/check_expr.cpp index b7a8c2cfc..fd4abdfbd 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -2583,7 +2583,7 @@ Entity *check_selector(Checker *c, Operand *operand, AstNode *node, Type *type_h String entity_name = selector->Ident.token.string; check_op_expr = false; - entity = scope_lookup_entity(import_scope, entity_name); + entity = current_scope_lookup_entity(import_scope, entity_name); bool is_declared = entity != nullptr; if (is_declared) { if (entity->kind == Entity_Builtin) { diff --git a/src/parser.cpp b/src/parser.cpp index 61aac5a97..4f35568d7 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -4366,6 +4366,11 @@ struct ParserThreadWork { isize import_index; }; +void add_shared_package(Parser *p, String name, TokenPos pos, PackageKind kind) { + String s = get_fullpath_core(heap_allocator(), name); + try_add_import_path(p, s, s, pos, kind); +} + ParseFileError parse_packages(Parser *p, String init_filename) { GB_ASSERT(init_filename.text[init_filename.len] == 0); @@ -4384,9 +4389,7 @@ ParseFileError parse_packages(Parser *p, String init_filename) { isize shared_package_count = 0; if (!build_context.generate_docs) { - String s = get_fullpath_core(heap_allocator(), str_lit("runtime")); - try_add_import_path(p, s, s, init_pos, Package_Runtime); - shared_package_count++; + add_shared_package(p, str_lit("runtime"), init_pos, Package_Runtime); shared_package_count++; } array_add(&p->imports, init_imported_package);