Clean up allocator stuff into allocators.odin

This commit is contained in:
gingerBill
2024-05-14 17:10:53 +01:00
parent e05315831f
commit ecd7846ec3
8 changed files with 75 additions and 76 deletions
+4 -4
View File
@@ -19,9 +19,9 @@ _lookup_env :: proc(key: string, allocator: runtime.Allocator) -> (value: string
return "", true
}
_TEMP_ALLOCATOR_GUARD()
TEMP_ALLOCATOR_GUARD()
b := make([]u16, n+1, _temp_allocator())
b := make([]u16, n+1, temp_allocator())
n = win32.GetEnvironmentVariableW(wkey, raw_data(b), u32(len(b)))
if n == 0 {
@@ -50,8 +50,8 @@ _unset_env :: proc(key: string) -> bool {
}
_clear_env :: proc() {
_TEMP_ALLOCATOR_GUARD()
envs := environ(_temp_allocator())
TEMP_ALLOCATOR_GUARD()
envs := environ(temp_allocator())
for env in envs {
for j in 1..<len(env) {
if env[j] == '=' {