Add runtime.DEFAULT_TEMP_ALLOCATOR_TEMP_GUARD where appropriate

This commit is contained in:
gingerBill
2023-02-10 16:23:33 +00:00
parent b427a4c8c9
commit 986cba584e
31 changed files with 201 additions and 60 deletions
+3
View File
@@ -4,6 +4,7 @@ package sysinfo
import "core:c"
import sys "core:sys/unix"
import "core:intrinsics"
import "core:runtime"
import "core:os"
import "core:strings"
import "core:strconv"
@@ -69,6 +70,8 @@ init_os_version :: proc () {
l := strings.builder_len(b)
strings.write_string(&b, string(cstring(&uts.release[0])))
runtime.DEFAULT_TEMP_ALLOCATOR_TEMP_GUARD()
// Parse kernel version, as substrings of the version info in `version_string_buf`
version_bits := strings.split_n(strings.to_string(b)[l:], "-", 2, context.temp_allocator)
if len(version_bits) > 1 {