Correct context.allocator usage
This commit is contained in:
1 parent
2b77f5b72f
commit
ceebd7b23c
4 files changed
+18
-10
No files matched your search
@@ -5,12 +5,14 @@ import win32 "core:sys/windows"
|
||||
|
||||
@(private)
|
||||
full_path_from_name :: proc(name: string, allocator := context.allocator) -> (path: string, err: Errno) {
|
||||
context.allocator = allocator
|
||||
|
||||
name := name
|
||||
if name == "" {
|
||||
name = "."
|
||||
}
|
||||
p := win32.utf8_to_utf16(name, context.temp_allocator)
|
||||
buf := make([dynamic]u16, 100, allocator)
|
||||
buf := make([dynamic]u16, 100)
|
||||
defer delete(buf)
|
||||
for {
|
||||
n := win32.GetFullPathNameW(raw_data(p), u32(len(buf)), raw_data(buf), nil)
|
||||
|
||||
Reference in new issue
Block a user