Andrew Kelley
fe08a4d065
Merge pull request #5846 from Vexu/anytype
...
Rename 'var' type to 'anytype'
2020-07-12 07:35:01 +00:00
Vexu
be1507a7af
update compile error tests and some doc comments
2020-07-12 00:54:07 +03:00
Vexu
3e095d8ef3
use 'anytype' in translate-c
2020-07-11 22:04:38 +03:00
Vexu
1a989ba39d
fix parser tests and add test for anytype conversion
2020-07-11 21:20:50 +03:00
Vexu
e85fe13e44
run zig fmt on std lib and self hosted
2020-07-11 20:41:19 +03:00
Vexu
9907116478
use typeInfo instead of hardcoded tables in std.Target
2020-07-11 20:11:20 +03:00
Vexu
c2fb4bfff3
add 'anytype' to self-hosted parser
2020-07-11 17:41:16 +03:00
Josh Wolfe
eddc68ad94
remove stray allocator parameter
2020-07-10 06:27:07 +00:00
Andrew Kelley
bf56cdd9ed
start to make test runner aware of logging
...
by default the test runner will only print logs with "warning" or
higher. this can be configured via the std.testing API.
See #5738 for future plans
2020-07-08 21:01:13 -07:00
Andrew Kelley
7bd0500589
Merge remote-tracking branch 'origin/master' into register-allocation
2020-07-08 20:46:06 -07:00
Andrew Kelley
8e425c0c8d
stage2: if AST=>ZIR
2020-07-08 20:33:33 -07:00
Andrew Kelley
ab9df5b04b
stage2: machine code for condbr jumps
2020-07-08 05:35:41 +00:00
Andrew Kelley
597a363673
Merge pull request #5755 from kubkon/dir-iter-tests
...
[libstd]: add Dir.Iterator tests
2020-07-07 23:13:58 +00:00
Jakub Konka
417c928952
Add comment about memory invalidation in Iterator.next on Win
2020-07-08 00:03:45 +02:00
Vexu
485231deae
fix HashMap.clone()
2020-07-06 16:51:53 +03:00
Andrew Kelley
ad2ed457dd
std: expose unmanaged hash maps
...
These are useful when you have many of them in memory, and already have
the allocator stored elsewhere.
2020-07-06 06:10:03 +00:00
Andrew Kelley
a2fd8f72c1
std: add new array list functions
2020-07-06 06:09:47 +00:00
Alluet
a0a93f2091
Rewrite std.fmt.parseInt
2020-07-05 22:56:06 +00:00
Andrew Kelley
86ef3202dd
add doc comment for std.Target.Os.WindowsVersion
2020-07-05 22:44:25 +00:00
emekoi
68be229917
added custom format method for WindowsVersion
2020-07-05 22:43:10 +00:00
Jonathan Marler
27c1e0b453
Fix issue 5757: increase branch quota for formatting enums
2020-07-05 22:27:50 +00:00
Andrew Kelley
dcca5cf1a9
Merge pull request #5797 from xackus/intcast-runtime-safety
...
stage1: `@intcast` runtime safety for unsigned -> signed of same bit count
2020-07-05 22:24:25 +00:00
Andrew Kelley
289eab9177
Merge pull request #5786 from ziglang/std-hash-map
...
reimplement std.HashMap
2020-07-05 21:12:20 +00:00
Andrew Kelley
3a89f214aa
update more HashMap API usage
2020-07-05 21:11:42 +00:00
Andrew Kelley
3c8b13d998
std hash map: do the pow2 improvement again
...
it's a noticeable speedup
2020-07-05 21:11:42 +00:00
Andrew Kelley
632acffcbd
update std lib to new hash map API
2020-07-05 21:11:42 +00:00
Andrew Kelley
b3b6ccba50
reimplement std.HashMap
...
* breaking changes to the API. Some of the weird decisions from before
are changed to what would be more expected.
- `get` returns `?V`, use `getEntry` for the old API.
- `put` returns `!void`, use `fetchPut` for the old API.
* HashMap now has a comptime parameter of whether to store hashes with
entries. AutoHashMap has heuristics on whether to set this parameter.
For example, for integers, it is false, since equality checking is
cheap, but for strings, it is true, since equality checking is
probably expensive.
* The implementation has a separate array for entry_index /
distance_from_start_index. Entries no longer has holes; it is an
ArrayList, and iteration is simpler and more cache coherent.
This is inspired by Python's new dictionaries.
* HashMap is separated into an "unmanaged" and a "managed" API. The
unmanaged API is where the actual implementation is; the managed API
wraps it and provides a more convenient API, storing the allocator.
* Memory usage: When there are less than or equal to 8 entries, HashMap
now incurs only a single pointer-size integer as overhead, opposed to
using an ArrayList.
* Since the entries array is separate from the indexes array, the holes
in the indexes array take up less room than the holes in the entries
array otherwise would. However the entries array also allocates
additional capacity for appending into the array.
* HashMap now maintains insertion order. Deletion performs a "swap
remove". It's now possible to modify the HashMap while iterating.
2020-07-05 21:11:42 +00:00
xackus
b8553b4813
compiler-rt: fix bugs uncovered by previous commit
2020-07-05 20:44:08 +02:00
joachimschmidt557
0ae1157e45
std.mem.dupe is deprecated, move all references in std
...
Replaced all occurences of std.mem.dupe in stdlib with
Allocator.dupe/std.mem.dupeZ -> Allocator.dupeZ
2020-07-04 21:40:06 +03:00
heidezomp
672b4d5c24
zig build --help: Consistent capitalization/punctuation
2020-07-04 13:00:53 +00:00
Jakub Konka
e7d02eae4d
Update lib/std/fs/test.zig
...
Co-authored-by: Joachim Schmidt <joachim.schmidt557@outlook.com>
2020-07-02 20:54:57 +02:00
Jakub Konka
b5badd1122
Fix memory corruption in Dir.Iterator test
2020-07-02 10:35:44 +02:00
Jakub Konka
64bd134818
Add Dir.Iterator tests
...
This commit adds some `std.fs.Dir.Iterator` tests.
2020-07-02 10:35:44 +02:00
Andrew Kelley
6f98ef09e3
Merge pull request #5717 from squeek502/fs-dir-file-ops
...
Add tests for using file operations on directories
2020-07-01 23:20:50 +00:00
Andrew Kelley
d2a4e5e226
Merge pull request #5749 from kubkon/wasi-notcapable
...
[libstd]: handle ENOTCAPABLE in WASI
2020-07-01 23:12:26 +00:00
Alexandros Naskos
30ae7f7573
Corrected default value field initialization in std.zeroInit
2020-07-01 23:09:08 +00:00
Jakub Konka
8306826d53
Map ENOTCAPABLE into error.AccessDenied instead of error.NotCapable
...
This is direct result of review comments left by andrewrk and
daurnimator. It makes sense to map `ENOTCAPABLE` into a more generic
`error.AccessDenied`.
2020-06-30 18:21:38 +02:00
Jakub Konka
5bc99dd7e8
Fix more compilation errors
2020-06-29 21:42:11 +02:00
Jakub Konka
b96882c57a
Fix compilation errors
2020-06-29 18:09:22 +02:00
Jakub Konka
bf8bf528c6
Handle ENOTCAPABLE in WASI
...
This commit adds `error.NotCapable` enum value and makes sure that
every applicable WASI syscall that can return `ENOTCAPABLE` errno
remaps it to `error.NotCapable.
2020-06-29 17:10:01 +02:00
Jonathan Marler
67e97a1f0f
ArenaAllocator: use full capacity
2020-06-29 05:12:30 -04:00
Jonathan Marler
35e8876c23
Revert "arena_allocator: refactor and use full capacity"
...
This reverts commit e120b07a524f1accd4975f5206018c61c4be9345.
2020-06-29 05:12:30 -04:00
Jonathan Marler
e120b07a52
arena_allocator: refactor and use full capacity
2020-06-28 18:40:15 -04:00
Jonathan Marler
c2eead9629
Fix issue 5741, use after free
2020-06-28 18:05:18 -04:00
Ryan Liptak
74c245aea9
Disable wasi 'readFileAlloc on a directory' assertion for now
2020-06-28 13:56:00 -07:00
Jonathan Marler
374e3e42e0
WasmPageAllocator: fix bug not aligning allocations
2020-06-28 14:25:39 -04:00
Andrew Kelley
581d16154b
Merge pull request #5696 from alexnask/async_call_tuple
...
@asyncCall now takes arguments as a tuple instead of varargs
2020-06-28 01:00:58 -04:00
Andrew Kelley
0cfe8e5d6f
Merge pull request #5064 from marler8997/newAllocator
...
new allocator interface
2020-06-27 18:21:00 -04:00
Jonathan Marler
a728436992
new allocator interface after Andrew Kelley review
2020-06-27 08:57:35 -06:00
Ryan Liptak
626b5eccab
Move fs-specific tests from os/test.zig to fs/test.zig
...
The moved tests do not use `std.os` directly and instead use `std.fs` functions, so it makes more sense for them to be in `fs/test.zig`
2020-06-27 10:17:08 +00:00