mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
[os2/process]: Make get_args() private and use heap_allocator
This commit is contained in:
@@ -13,20 +13,12 @@ TIMEOUT_INFINITE :: time.MIN_DURATION // Note(flysand): Any negative duration wi
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
Arguments to the current process.
|
Arguments to the current process.
|
||||||
|
|
||||||
See `get_args()` for description of the slice.
|
|
||||||
*/
|
*/
|
||||||
args := get_args()
|
args := get_args()
|
||||||
|
|
||||||
/*
|
@(private="file")
|
||||||
Obtain the process argument array from the OS.
|
|
||||||
|
|
||||||
Slice, containing arguments to the current process. Each element of the
|
|
||||||
slice contains a single argument. The first element of the slice would
|
|
||||||
typically is the path to the currently running executable.
|
|
||||||
*/
|
|
||||||
get_args :: proc() -> []string {
|
get_args :: proc() -> []string {
|
||||||
result := make([]string, len(runtime.args__), allocator = context.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] = cast(string) rt_arg
|
result[i] = cast(string) rt_arg
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user