mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
Remove TEMP_ALLOCATOR_GUARD wrapper
This commit is contained in:
@@ -109,7 +109,7 @@ _open_internal :: proc(name: string, flags: File_Flags, perm: int) -> (handle: u
|
||||
err = .Not_Exist
|
||||
return
|
||||
}
|
||||
temp_allocator := get_temp_allocator(TEMP_ALLOCATOR_GUARD({}))
|
||||
temp_allocator := TEMP_ALLOCATOR_GUARD({})
|
||||
|
||||
path := _fix_long_path(name, temp_allocator) or_return
|
||||
access: u32
|
||||
@@ -580,7 +580,7 @@ _truncate :: proc(f: ^File, size: i64) -> Error {
|
||||
}
|
||||
|
||||
_remove :: proc(name: string) -> Error {
|
||||
temp_allocator := get_temp_allocator(TEMP_ALLOCATOR_GUARD({}))
|
||||
temp_allocator := TEMP_ALLOCATOR_GUARD({})
|
||||
p := _fix_long_path(name, temp_allocator) or_return
|
||||
err, err1: Error
|
||||
if !win32.DeleteFileW(p) {
|
||||
@@ -618,7 +618,7 @@ _remove :: proc(name: string) -> Error {
|
||||
}
|
||||
|
||||
_rename :: proc(old_path, new_path: string) -> Error {
|
||||
temp_allocator := get_temp_allocator(TEMP_ALLOCATOR_GUARD({}))
|
||||
temp_allocator := TEMP_ALLOCATOR_GUARD({})
|
||||
from := _fix_long_path(old_path, temp_allocator) or_return
|
||||
to := _fix_long_path(new_path, temp_allocator) or_return
|
||||
if win32.MoveFileExW(from, to, win32.MOVEFILE_REPLACE_EXISTING) {
|
||||
@@ -629,7 +629,7 @@ _rename :: proc(old_path, new_path: string) -> Error {
|
||||
}
|
||||
|
||||
_link :: proc(old_name, new_name: string) -> Error {
|
||||
temp_allocator := get_temp_allocator(TEMP_ALLOCATOR_GUARD({}))
|
||||
temp_allocator := TEMP_ALLOCATOR_GUARD({})
|
||||
o := _fix_long_path(old_name, temp_allocator) or_return
|
||||
n := _fix_long_path(new_name, temp_allocator) or_return
|
||||
if win32.CreateHardLinkW(n, o, nil) {
|
||||
@@ -692,7 +692,7 @@ _normalize_link_path :: proc(p: []u16, allocator: runtime.Allocator) -> (str: st
|
||||
return "", _get_platform_error()
|
||||
}
|
||||
|
||||
temp_allocator := get_temp_allocator(TEMP_ALLOCATOR_GUARD({ allocator }))
|
||||
temp_allocator := TEMP_ALLOCATOR_GUARD({ allocator })
|
||||
|
||||
buf := make([]u16, n+1, temp_allocator)
|
||||
n = win32.GetFinalPathNameByHandleW(handle, raw_data(buf), u32(len(buf)), win32.VOLUME_NAME_DOS)
|
||||
@@ -718,7 +718,7 @@ _read_link :: proc(name: string, allocator: runtime.Allocator) -> (s: string, er
|
||||
@thread_local
|
||||
rdb_buf: [MAXIMUM_REPARSE_DATA_BUFFER_SIZE]byte
|
||||
|
||||
temp_allocator := get_temp_allocator(TEMP_ALLOCATOR_GUARD({ allocator }))
|
||||
temp_allocator := TEMP_ALLOCATOR_GUARD({ allocator })
|
||||
|
||||
p := _fix_long_path(name, temp_allocator) or_return
|
||||
handle := _open_sym_link(p) or_return
|
||||
@@ -785,7 +785,7 @@ _fchown :: proc(f: ^File, uid, gid: int) -> Error {
|
||||
}
|
||||
|
||||
_chdir :: proc(name: string) -> Error {
|
||||
temp_allocator := get_temp_allocator(TEMP_ALLOCATOR_GUARD({}))
|
||||
temp_allocator := TEMP_ALLOCATOR_GUARD({})
|
||||
p := _fix_long_path(name, temp_allocator) or_return
|
||||
if !win32.SetCurrentDirectoryW(p) {
|
||||
return _get_platform_error()
|
||||
@@ -834,7 +834,7 @@ _fchtimes :: proc(f: ^File, atime, mtime: time.Time) -> Error {
|
||||
}
|
||||
|
||||
_exists :: proc(path: string) -> bool {
|
||||
temp_allocator := get_temp_allocator(TEMP_ALLOCATOR_GUARD({}))
|
||||
temp_allocator := TEMP_ALLOCATOR_GUARD({})
|
||||
wpath, _ := _fix_long_path(path, temp_allocator)
|
||||
attribs := win32.GetFileAttributesW(wpath)
|
||||
return attribs != win32.INVALID_FILE_ATTRIBUTES
|
||||
|
||||
Reference in New Issue
Block a user