From 9942625c63e6757b9a67d12e59726a46df86734e Mon Sep 17 00:00:00 2001 From: "Alexander Cusaac (MightyChubz)" Date: Thu, 4 Jun 2026 13:17:42 -0400 Subject: [PATCH] refactor: Use `default_context()` over removing `"contextless"` --- core/sys/info/platform_linux.odin | 5 ++++- core/sys/info/sysinfo.odin | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/core/sys/info/platform_linux.odin b/core/sys/info/platform_linux.odin index 5901abd67..ed476a9cd 100644 --- a/core/sys/info/platform_linux.odin +++ b/core/sys/info/platform_linux.odin @@ -80,7 +80,10 @@ _os_version :: proc (allocator: runtime.Allocator, loc := #caller_location) -> ( } @(private) -_ram_stats :: proc() -> (total_ram, free_ram, total_swap, free_swap: i64, ok: bool) { +_ram_stats :: proc "contextless" () -> (total_ram, free_ram, total_swap, free_swap: i64, ok: bool) { + // This is here for some of the strings procedures + context = runtime.default_context() + // The approach is to read /proc/meminfo for the memory information. We do this over // reading sysinfo() since sysinfo() only returns MemFree, which is based on the amount // of free pages. The value we actually want is MemAvailable inside meminfo since it is diff --git a/core/sys/info/sysinfo.odin b/core/sys/info/sysinfo.odin index 5be40a3a8..ad120b264 100644 --- a/core/sys/info/sysinfo.odin +++ b/core/sys/info/sysinfo.odin @@ -59,7 +59,7 @@ Returns: - free_swap: Free SWAP reported by the operating system, in bytes - ok: `true` when we could retrieve RAM statistics, `false` otherwise */ -ram_stats :: proc() -> (total_ram, free_ram, total_swap, free_swap: i64, ok: bool) { +ram_stats :: proc "contextless" () -> (total_ram, free_ram, total_swap, free_swap: i64, ok: bool) { return _ram_stats() }