aboutsummaryrefslogtreecommitdiff
path: root/lib/std/packed_int_array.zig
diff options
context:
space:
mode:
authorJakub Konka <kubkon@jakubkonka.com>2020-05-29 08:40:32 +0200
committerJakub Konka <kubkon@jakubkonka.com>2020-05-29 10:48:03 +0200
commit6f48842ddb2d8ca8fec639dc11a47753058ae325 (patch)
treeeb029f7190abb21b1e048e84750ddb0a68008935 /lib/std/packed_int_array.zig
parentf1a4e1a70f4ecefbae7813d7170f465234c03273 (diff)
downloadzig-6f48842ddb2d8ca8fec639dc11a47753058ae325.tar.gz
zig-6f48842ddb2d8ca8fec639dc11a47753058ae325.zip
Make ArgIterator.init() a compile error in WASI
Given that the previous design would require the use of a default allocator to have `ArgIterator.init()` work in WASI, and since in Zig we're trying to avoid default allocators, I've changed the design slightly in that now `init()` is a compile error in WASI, and instead in its message it points to `initWithAllocator(*mem.Allocator)`. The latter by virtue of requiring an allocator as an argument can safely be used in WASI as well as on other OSes (where the allocator argument is simply unused). When using `initWithAllocator` it is then natural to remember to call `deinit()` after being done with the iterator. Also, to make use of this, I've also added `argsWithAllocator` function which is equivalent to `args` minus the requirement of supplying an allocator and being fallible. Finally, I've also modified the WASI only test `process.ArgWasiIterator` to test all OSes.
Diffstat (limited to 'lib/std/packed_int_array.zig')
0 files changed, 0 insertions, 0 deletions