Browse Source

Rename os.default_allocator to os.heap_allocator

gingerBill 7 years ago
parent
commit
e46662a546
4 changed files with 6 additions and 6 deletions
  1. 3 3
      core/os/os.odin
  2. 1 1
      core/runtime/core.odin
  3. 1 1
      src/checker.cpp
  4. 1 1
      src/ir.cpp

+ 3 - 3
core/os/os.odin

@@ -66,7 +66,7 @@ read_ptr :: proc(fd: Handle, data: rawptr, len: int) -> (int, Errno) {
 }
 }
 
 
 
 
-default_allocator_proc :: proc(allocator_data: rawptr, mode: mem.Allocator_Mode,
+heap_allocator_proc :: proc(allocator_data: rawptr, mode: mem.Allocator_Mode,
                                size, alignment: int,
                                size, alignment: int,
                                old_memory: rawptr, old_size: int, flags: u64 = 0, loc := #caller_location) -> rawptr {
                                old_memory: rawptr, old_size: int, flags: u64 = 0, loc := #caller_location) -> rawptr {
 	using mem.Allocator_Mode;
 	using mem.Allocator_Mode;
@@ -91,9 +91,9 @@ default_allocator_proc :: proc(allocator_data: rawptr, mode: mem.Allocator_Mode,
 	return nil;
 	return nil;
 }
 }
 
 
-default_allocator :: proc() -> mem.Allocator {
+heap_allocator :: proc() -> mem.Allocator {
 	return mem.Allocator{
 	return mem.Allocator{
-		procedure = default_allocator_proc,
+		procedure = heap_allocator_proc,
 		data = nil,
 		data = nil,
 	};
 	};
 }
 }

+ 1 - 1
core/runtime/core.odin

@@ -276,7 +276,7 @@ __init_context_from_ptr :: proc "contextless" (c: ^Context, other: ^Context) {
 __init_context :: proc "contextless" (c: ^Context) {
 __init_context :: proc "contextless" (c: ^Context) {
 	if c == nil do return;
 	if c == nil do return;
 
 
-	c.allocator = os.default_allocator();
+	c.allocator = os.heap_allocator();
 	c.thread_id = os.current_thread_id();
 	c.thread_id = os.current_thread_id();
 }
 }
 
 

+ 1 - 1
src/checker.cpp

@@ -1334,7 +1334,7 @@ void generate_minimum_dependency_set(Checker *c, Entity *start) {
 
 
 	AstPackage *os = get_core_package(&c->info, str_lit("os"));
 	AstPackage *os = get_core_package(&c->info, str_lit("os"));
 	String required_os_entities[] = {
 	String required_os_entities[] = {
-		str_lit("default_allocator"),
+		str_lit("heap_allocator"),
 	};
 	};
 	for (isize i = 0; i < gb_count_of(required_os_entities); i++) {
 	for (isize i = 0; i < gb_count_of(required_os_entities); i++) {
 		add_dependency_to_set(c, scope_lookup_entity(os->scope, required_mem_entities[i]));
 		add_dependency_to_set(c, scope_lookup_entity(os->scope, required_mem_entities[i]));

+ 1 - 1
src/ir.cpp

@@ -1637,7 +1637,7 @@ irValue *ir_find_or_generate_context_ptr(irProcedure *proc) {
 
 
 	irValue *ep = ir_emit_struct_ep(proc, c, 0);
 	irValue *ep = ir_emit_struct_ep(proc, c, 0);
 	Array<irValue *> args = {};
 	Array<irValue *> args = {};
-	irValue *v = ir_emit_package_call(proc, "os", "default_allocator", args);
+	irValue *v = ir_emit_package_call(proc, "os", "heap_allocator", args);
 	ir_emit_store(proc, ep, v);
 	ir_emit_store(proc, ep, v);
 
 
 	return c;
 	return c;