Allow for nested temp_allocator() calls to flip between arenas on TEMP_ALLOCATOR_GUARDs

This commit is contained in:
gingerBill
2024-08-04 17:14:24 +01:00
parent f427f040fd
commit d0709a7de2
3 changed files with 30 additions and 12 deletions
+4 -4
View File
@@ -4,7 +4,7 @@ package os2
import "core:sys/linux"
@(rodata)
_errno_strings := [linux.Error]string{
_errno_strings := [linux.Errno]string{
.NONE = "",
.EPERM = "Operation not permitted",
.ENOENT = "No such file or directory",
@@ -142,7 +142,7 @@ _errno_strings := [linux.Error]string{
}
_get_platform_error :: proc(errno: linux.Error) -> Error {
_get_platform_error :: proc(errno: linux.Errno) -> Error {
#partial switch errno {
case .NONE:
return nil
@@ -158,8 +158,8 @@ _get_platform_error :: proc(errno: linux.Error) -> Error {
}
_error_string :: proc(errno: i32) -> string {
if errno >= 0 && errno <= i32(max(linux.Error)) {
return _errno_strings[linux.Error(errno)]
if errno >= 0 && errno <= i32(max(linux.Errno)) {
return _errno_strings[linux.Errno(errno)]
}
return "Unknown Error"
}