aboutsummaryrefslogtreecommitdiff
path: root/core/os
diff options
context:
space:
mode:
authorgingerBill <gingerBill@users.noreply.github.com>2025-08-08 12:25:58 +0100
committergingerBill <gingerBill@users.noreply.github.com>2025-08-08 12:25:58 +0100
commitd3f649d244529d93b489140e5c7a1aaff97bedb2 (patch)
tree462194c63ad8abecd9b26e7fd1509448c1ef3fb5 /core/os
parent06e48099ca808dc9d5b3fbcaebebd4123f097a86 (diff)
Make `get_args` contextless
Diffstat (limited to 'core/os')
-rw-r--r--core/os/os2/process.odin9
1 files changed, 8 insertions, 1 deletions
diff --git a/core/os/os2/process.odin b/core/os/os2/process.odin
index 3c84f3539..635befc64 100644
--- a/core/os/os2/process.odin
+++ b/core/os/os2/process.odin
@@ -16,7 +16,8 @@ Arguments to the current process.
args := get_args()
@(private="file")
-get_args :: proc() -> []string {
+get_args :: proc "contextless" () -> []string {
+ context = runtime.default_context()
result := make([]string, len(runtime.args__), heap_allocator())
for rt_arg, i in runtime.args__ {
result[i] = string(rt_arg)
@@ -24,6 +25,12 @@ get_args :: proc() -> []string {
return result
}
+@(fini, private="file")
+delete_args :: proc "contextless" () {
+ context = runtime.default_context()
+ delete(args, heap_allocator())
+}
+
/*
Exit the current process.
*/