Commit Graph

2041 Commits

Author SHA1 Message Date
Jakub Konka
d17c9b3591 Fix incorrect byte format of REPARSE_DATA_BUFFER struct 2020-07-22 08:51:22 +02:00
Jakub Konka
9b00dc941b Use windows.CreateFileW to open the reparse point 2020-07-22 08:51:22 +02:00
Jakub Konka
49b5815364 Add windows.ReadLink similar to OpenFile but for reparse points only 2020-07-22 08:51:22 +02:00
Jakub Konka
92d11fd4e9 Debug readlinkW using OpenFile 2020-07-22 08:51:22 +02:00
Jakub Konka
791795a63a Finish symlink implementation on Windows 2020-07-22 08:51:22 +02:00
Jakub Konka
515c663cd6 Add readlink smoke test 2020-07-22 08:51:22 +02:00
Jakub Konka
cc83d92b0b Start drafting out os.readlink on Windows 2020-07-22 08:51:22 +02:00
Andrew Kelley
7a1a924788 stage2: AST: (breaking) flatten out suffix operations 2020-07-21 10:52:24 -07:00
Andrew Kelley
1ac28eed83 stage2 AST: rename OptionalUnwrap to OrElse
preparing to flatten suffix operations AST
2020-07-21 10:46:47 -07:00
purringChaos
094223d634 Fix log.zig example. 2020-07-21 18:53:30 +03:00
data-man
39915ae086 Add trait.isTuple 2020-07-17 17:55:55 +03:00
Vexu
a1e78d0b06
add is_tuple field to struct typeinfo
part of #4335
2020-07-17 00:15:34 +03:00
Vexu
06c08e5219
std.mem.zeroes use std.mem.set instead of @memset
stage1 comptime is not smart enough to remeber the size of the casted
item which leads to out of bounds errors.
2020-07-16 17:05:14 +03:00
Vexu
8fe076daaf
std.mem.zeroInit support initiating with tuples 2020-07-16 16:00:42 +03:00
Andrew Kelley
af12596e8d stage2: breaking AST memory layout modifications
InfixOp is flattened out so that each operator is an independent AST
node tag. The two kinds of structs are now Catch and SimpleInfixOp.

Beginning implementation of supporting codegen for const locals.
2020-07-15 19:39:18 -07:00
Andrew Kelley
f119092273 stage2: breaking AST memory layout modifications
ast.Node.Id => ast.Node.Tag, matching recent style conventions.

Now multiple different AST node tags can map to the same AST node data
structures. In this commit, simple prefix operators now all map top
SimplePrefixOp.

`ast.Node.castTag` is now preferred over `ast.Node.cast`.

Upcoming: InfixOp flattened out.
2020-07-15 18:15:59 -07:00
Andrew Kelley
c5b7322319 TrailerFlags test: fix bad alignment assumption on 32-bit 2020-07-15 04:04:04 -07:00
Andrew Kelley
804b51b179 stage2: VarDecl and FnProto take advantage of TrailerFlags API
These AST nodes now have a flags field and then a bunch of optional
trailing objects. The end result is lower memory usage and consequently
better performance. This is part of an ongoing effort to reduce the
amount of memory parsed ASTs take up.

Running `zig fmt` on the std lib:
 * cache-misses: 2,554,321 => 2,534,745
 * instructions: 3,293,220,119 => 3,302,479,874
 * peak memory: 74.0 MiB => 73.0 MiB

Holding the entire std lib AST in memory at the same time:

  93.9 MiB => 88.5 MiB
2020-07-15 02:07:30 -07:00
Andrew Kelley
eac6280241 add std.meta.TrailerFlags API
This is useful for saving memory when allocating an object that has many
optional components. The optional objects are allocated sequentially in
memory, and a single integer is used to represent each optional object
and whether it is present based on each corresponding bit.
2020-07-14 17:19:17 -07:00
Andrew Kelley
67273cbe76
Merge pull request #5868 from ziglang/stage2-improvements
Stage2 improvements
2020-07-14 09:24:43 +00:00
~nue
03f14c3102
Added octal formatting fo fmt functions. (#5867)
* Added octal formatting (specifier "o") to `formatIntValue` function.
* Added octal specifier test case in `fmt.zig` (under the "int.specifier" case)
2020-07-14 02:27:58 -04:00
Andrew Kelley
14cef9dd3d stage2 parser: split out PrefixOp into separate AST Nodes
This is part of a larger effort to improve the memory layout of AST
nodes of the self-hosted parser to reduce wasted memory. Reduction of
wasted memory also translates to improved performance because of fewer
memory allocations, and fewer cache misses.

Compared to master, when running `zig fmt` on the std lib:

 * cache-misses: 801,829 => 768,624
 * instructions: 3,234,877,167 => 3,232,075,022
 * peak memory: 81480 KB => 75964 KB
2020-07-13 20:13:51 -07:00
pixelherodev
2c882b2e65
CBE: Make C an ObjectFormat instead of a special bool (#5849) 2020-07-12 22:56:31 -04:00
Isaac Freund
ef17af1270 std: add mem.joinZ
currently the only options are doing a second allocation and copying or
implementing this yourself.
2020-07-12 22:17:40 +00:00
xackus
5b570bceb5 document a few functions in std.mem 2020-07-12 21:55:49 +00:00
Andrew Kelley
7adbc11403
Merge pull request #5857 from daurnimator/use-unmanaged
Use unmanaged datastructures from std.http.headers
2020-07-12 21:46:26 +00:00
Sam Tebbs
873e187f05 Make allocator test functions public 2020-07-12 21:45:25 +00:00
Jakub Konka
eea7271c4e Fix incorrect continue condition in PreopeonList
Also, check for overflow on incremented file descriptors. Previously,
we'd trigger a panic if we exceeded the `fd_t` resolution. Now, instead,
we throw an `error.Overflow` to signal that there can be no more
file descriptors available from the runtime. This way we give the user
the ability to still be able to check if their desired preopen exists
in the list or not.
2020-07-12 21:02:33 +00:00
daurnimator
91235b9371
std: don't store allocator inside of std.http.HeaderEntry 2020-07-13 00:38:59 +10:00
daurnimator
f7e4014c82
std: use *Unmanaged data structures in http.Headers object 2020-07-13 00:34:58 +10:00
daurnimator
4b48266bb7
std: add StringHashMapUnmanaged 2020-07-13 00:34:02 +10:00
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