|
@@ -154,7 +154,7 @@ foreign dl {
|
|
|
open_simple :: proc(path: string, mode: int) -> (Handle, Errno) {
|
|
|
cstr := strings.new_cstring(path);
|
|
|
handle := _unix_open(cstr, mode);
|
|
|
- free(cstr);
|
|
|
+ delete(cstr);
|
|
|
if(handle == -1) {
|
|
|
return 0, 1;
|
|
|
}
|
|
@@ -205,7 +205,7 @@ last_write_time_by_name :: proc(name: string) -> File_Time {}
|
|
|
|
|
|
stat :: inline proc(path: string) -> (Stat, int) {
|
|
|
cstr := strings.new_cstring(path);
|
|
|
- defer free(cstr);
|
|
|
+ defer delete(cstr);
|
|
|
|
|
|
s: Stat;
|
|
|
ret_int := _unix_stat(cstr, &s);
|
|
@@ -214,7 +214,7 @@ stat :: inline proc(path: string) -> (Stat, int) {
|
|
|
|
|
|
access :: inline proc(path: string, mask: int) -> bool {
|
|
|
cstr := strings.new_cstring(path);
|
|
|
- defer free(cstr);
|
|
|
+ defer delete(cstr);
|
|
|
return _unix_access(cstr, mask) == 0;
|
|
|
}
|
|
|
|
|
@@ -233,7 +233,7 @@ heap_free :: proc(ptr: rawptr) {
|
|
|
|
|
|
getenv :: proc(name: string) -> (string, bool) {
|
|
|
path_str := strings.new_cstring(name);
|
|
|
- defer free(path_str);
|
|
|
+ defer delete(path_str);
|
|
|
cstr := _unix_getenv(path_str);
|
|
|
if cstr == nil {
|
|
|
return "", false;
|
|
@@ -252,14 +252,14 @@ current_thread_id :: proc() -> int {
|
|
|
|
|
|
dlopen :: inline proc(filename: string, flags: int) -> rawptr {
|
|
|
cstr := strings.new_cstring(filename);
|
|
|
- defer free(cstr);
|
|
|
+ defer delete(cstr);
|
|
|
handle := _unix_dlopen(cstr, flags);
|
|
|
return handle;
|
|
|
}
|
|
|
dlsym :: inline proc(handle: rawptr, symbol: string) -> rawptr {
|
|
|
assert(handle != nil);
|
|
|
cstr := strings.new_cstring(symbol);
|
|
|
- defer free(cstr);
|
|
|
+ defer delete(cstr);
|
|
|
proc_handle := _unix_dlsym(handle, cstr);
|
|
|
return proc_handle;
|
|
|
}
|