Add free for maps (a previous oversight)

This commit is contained in:
Ginger Bill
2017-07-05 13:51:25 +01:00
parent 3d2d461867
commit eed873c6ec
8 changed files with 223 additions and 197 deletions
+3 -1
View File
@@ -1,3 +1,5 @@
import "mem.odin";
new_string :: proc(s: string) -> string {
c := make([]u8, len(s)+1);
copy(c, []u8(s));
@@ -15,5 +17,5 @@ new_c_string :: proc(s: string) -> ^u8 {
to_odin_string :: proc(c: ^u8) -> string {
len := 0;
for (c+len)^ != 0 do len++;
return string(slice_ptr(c, len));
return string(mem.slice_ptr(c, len));
}