refactor: Use default_context() over removing "contextless"

This commit is contained in:
Alexander Cusaac (MightyChubz)
2026-06-04 13:17:42 -04:00
parent c9621748a4
commit 9942625c63
2 changed files with 5 additions and 2 deletions

View File

@@ -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

View File

@@ -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()
}