mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-01 12:18:15 +00:00
Add free for maps (a previous oversight)
This commit is contained in:
+3
-1
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user