mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 15:18:49 +00:00
Make get_args contextless
This commit is contained in:
@@ -16,7 +16,8 @@ Arguments to the current process.
|
|||||||
args := get_args()
|
args := get_args()
|
||||||
|
|
||||||
@(private="file")
|
@(private="file")
|
||||||
get_args :: proc() -> []string {
|
get_args :: proc "contextless" () -> []string {
|
||||||
|
context = runtime.default_context()
|
||||||
result := make([]string, len(runtime.args__), heap_allocator())
|
result := make([]string, len(runtime.args__), heap_allocator())
|
||||||
for rt_arg, i in runtime.args__ {
|
for rt_arg, i in runtime.args__ {
|
||||||
result[i] = string(rt_arg)
|
result[i] = string(rt_arg)
|
||||||
@@ -24,6 +25,12 @@ get_args :: proc() -> []string {
|
|||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@(fini, private="file")
|
||||||
|
delete_args :: proc "contextless" () {
|
||||||
|
context = runtime.default_context()
|
||||||
|
delete(args, heap_allocator())
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Exit the current process.
|
Exit the current process.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user