Browse Source

Correct core library usage of the new `mem.new` behaviour

gingerBill 4 years ago
parent
commit
ce7698c20e
2 changed files with 2 additions and 2 deletions
  1. 1 1
      core/math/big/internal.odin
  2. 1 1
      core/odin/ast/clone.odin

+ 1 - 1
core/math/big/internal.odin

@@ -1866,7 +1866,7 @@ internal_int_grow :: proc(a: ^Int, digits: int, allow_shrink := false, allocator
 		If not yet iniialized, initialize the `digit` backing with the allocator we were passed.
 		If not yet iniialized, initialize the `digit` backing with the allocator we were passed.
 	*/
 	*/
 	if raw.cap == 0 {
 	if raw.cap == 0 {
-		a.digit = mem.make_dynamic_array_len_cap([dynamic]DIGIT, needed, needed, allocator);
+		a.digit = make([dynamic]DIGIT, needed, allocator);
 	} else if raw.cap != needed {
 	} else if raw.cap != needed {
 		/*
 		/*
 			`[dynamic]DIGIT` already knows what allocator was used for it, so resize will do the right thing.
 			`[dynamic]DIGIT` already knows what allocator was used for it, so resize will do the right thing.

+ 1 - 1
core/odin/ast/clone.odin

@@ -5,7 +5,7 @@ import "core:fmt"
 import "core:odin/tokenizer"
 import "core:odin/tokenizer"
 
 
 new :: proc($T: typeid, pos, end: tokenizer.Pos) -> ^T {
 new :: proc($T: typeid, pos, end: tokenizer.Pos) -> ^T {
-	n := mem.new(T);
+	n, _ := mem.new(T);
 	n.pos = pos;
 	n.pos = pos;
 	n.end = end;
 	n.end = end;
 	n.derived = n^;
 	n.derived = n^;