Commit Graph

1331 Commits

Author SHA1 Message Date
Andrew Kelley
3eb89ee4db
fixups
* zig fmt
 * use canonical parameter order. memcpy has dest first and
   the base64 code follows the pattern.
 * pass correct radix to charToDigit
2018-09-02 19:23:30 -04:00
Andrew Kelley
0d8412d9f0
Merge branch 'std-fmt-hexToBytes' of https://github.com/kristate/zig into kristate-std-fmt-hexToBytes 2018-09-02 19:08:54 -04:00
Andrew Kelley
ab387bb4c7
Merge pull request #1460 from ziglang/Sahnvour-windows-coff-issue721
Stack traces for Windows
2018-09-02 18:47:48 -04:00
Andrew Kelley
832caefc2a fix regressions 2018-09-02 18:35:32 -04:00
Andrew Kelley
4cd50865bf fix source file lookup 2018-09-02 17:58:50 -04:00
Andrew Kelley
98dc943c07 rework code to avoid duplicate operations 2018-09-02 15:58:08 -04:00
kristopher tate
fbd9bac5e7 std/fmt/index.zig: add hexToBytes function under std.fmt;
Depends on #1454 being implemented;
2018-09-03 01:12:52 +09:00
Andrew Kelley
86e55567b4
Merge pull request #1454 from kristate/str-hexbytes-issue1453
std.fmt: print zeroed high-order bytes correctly in hex
2018-09-02 11:31:05 -04:00
Andrew Kelley
78a110cda5
Merge pull request #1452 from shawnl/patch-1
std/rb.zig: fix comment
2018-09-02 11:17:54 -04:00
Shawn Landden
528e3b43a6 these all use futex() (inaccurate comments) 2018-09-01 23:52:52 -07:00
kristopher tate
d1752fbdc0 std/fmt/index.zig: test for printing double width hex bytes with zeros;
Co-Authored-By: Shawn Landden <shawn@git.icu>
2018-09-02 15:04:57 +09:00
kristopher tate
48d3fbef5c std/fmt/index.zig: set width from 0 to 2;
\x00 was printed as 0 and \x0E was printed as E;
\x00 now correctly prints 00 and \x0E correctly prints 0E;
2018-09-02 15:04:20 +09:00
Shawn Landden
4bf54f3010
std/rb.zig: fix comment 2018-09-01 22:23:34 -07:00
kristopher tate
7a633f472d std/fmt/index.zig: #1358: test bytes printed-out as hex; 2018-09-01 19:53:11 +09:00
kristopher tate
454b2362ee std/fmt/index.zig: #1358 allow bytes to be printed-out as hex;
Supports {x} for lowercase and {X} for uppercase;
2018-09-01 19:40:05 +09:00
Andrew Kelley
6ddbd345aa figuring out where /names stream is 2018-08-31 19:50:03 -04:00
Andrew Kelley
b36b93fb3e awareness of debug subsections 2018-08-31 15:02:41 -04:00
Andrew Kelley
99170aa13d finding source file, line, and column info 2018-08-31 01:01:37 -04:00
Andrew Kelley
72185e7dd3 finding the function that an address is in 2018-08-30 16:57:55 -04:00
Andrew Kelley
44f908d2e6 figuring out which module an address belongs in 2018-08-30 15:33:50 -04:00
Andrew Kelley
96117e20cc reading the module information substream 2018-08-30 03:44:34 -04:00
Andrew Kelley
686663239a printing info from the ModuleInfo substream of DebugInfo 2018-08-29 19:00:24 -04:00
Andrew Kelley
f1b71053de use RtlCaptureStackBackTrace on windows 2018-08-29 16:35:51 -04:00
Andrew Kelley
833477abf5 fix unresolved path preventing PDB loading 2018-08-28 18:55:51 -04:00
Andrew Kelley
41723f842c Merge branch 'windows-coff-issue721' of https://github.com/Sahnvour/zig into Sahnvour-windows-coff-issue721 2018-08-28 17:32:32 -04:00
Andrew Kelley
9de0f900e1
Merge pull request #1369 from shawnl/crypto
std/crypto: add chacha20
2018-08-28 16:07:58 -04:00
Marc Tiehuis
87eb95f816 speed up chacha20
The main changes are:

    Unrolling the inner rounds of salsa20_wordtobyte which doubles the speed.
    Passing the slice explicitly instead of returning the array saves a copy (can optimize out in future with copy elision) and gives ~10% improvement.
    Inlining the outer loop gives ~15-20% improvement but it costs an extra 4Kb of code space. I think the tradeoff is worthwhile here.
    The other inline loops are small and can be done by the compiler if it is worthwhile.
    The rotate function replacement doesn't alter the performance from the former.

The modified throughput test I've used to benchmark is as follows. Interestingly we need to allocate memory instead of using a fixed buffer else Zig optimizes the whole thing out.

https://github.com/ziglang/zig/pull/1369#issuecomment-416456628
2018-08-27 22:55:53 -07:00
Shawn Landden
444edd9aed std.crypto: add chaCha20
v3
2018-08-27 19:44:11 -07:00
Andrew Kelley
fb6d3859e8
zig fmt 2018-08-27 19:25:40 -04:00
Andrew Kelley
4f2d49fd13
std.zig.parse: fix parsing of doc comments after fields
closes #1404
2018-08-27 19:21:38 -04:00
tgschultz
ecc5464024 Handle unions differently in std.fmt (#1432)
* Handle unions differently in std.fmt

Print the active tag's value in tagged unions. Untagged unions considered unsafe to print and treated like a pointer or an array.
2018-08-27 17:25:33 -04:00
Andrew Kelley
2cce171448 add test for previous commit 2018-08-25 17:28:30 -04:00
tgschultz
61c0c6d502
Fixed compile error when passing enum to fmt
Caused by struct printing behavior. Enums are different enough from structs and unions that the field iteration behavior doesn't do what we want even if @memberName didn't error on enums.
2018-08-25 10:51:49 -05:00
Andrew Kelley
815950996d Merge remote-tracking branch 'origin/master' into macos-stack-traces 2018-08-25 04:48:58 -04:00
Andrew Kelley
ac36f98e72 fix stack traces on linux 2018-08-25 03:07:37 -04:00
Andrew Kelley
32901926f0 compilation unit cwd dir appears to be unnecessary on macos 2018-08-24 15:43:48 -04:00
Andrew Kelley
4e7c255e4d macos stack traces have address-to-line translation 2018-08-24 14:55:55 -04:00
Andrew Kelley
bf1f91595d std.debug: remove workaround for fixed bug 2018-08-24 13:00:28 -04:00
Andrew Kelley
6b31b178a6 fix regression from 2f7f7d815d 2018-08-24 12:59:31 -04:00
Andrew Kelley
95e197667e macos stack traces have the compilation unit in them 2018-08-24 11:30:36 -04:00
Andrew Kelley
3173c90f14 macos stack traces: read debug info sections from .o files 2018-08-23 23:08:34 -04:00
Andrew Kelley
6c064cfd88
Merge pull request #1405 from shawnl/path-max
missing PATH_MAX change
2018-08-23 20:16:13 -04:00
Shawn Landden
2f7f7d815d missing PATH_MAX change 2018-08-23 17:00:50 -07:00
Andrew Kelley
5c1ec20c9a MacOS stack traces use the already mmapped executable
...rather than trying to find the executable on the file system.

Also use a more robust PIE offset calculation based on the
available metadata.

And for the last function, use the data that tells the end
rather than assuming 4K.

Also they print in a consistent way with Linux stack traces.
2018-08-23 16:23:33 -04:00
Andrew Kelley
327482c3a4
Merge pull request #1402 from ziglang/default-fp-ieee-strict
Default to strict IEEE floating point
2018-08-23 08:26:09 -04:00
Marc Tiehuis
353419f82d Default to strict IEEE floating point
Closes #1227.
2018-08-23 22:54:46 +12:00
Andrew Kelley
8f96553be8 rename std.debug.ElfStackTrace to std.debug.DebugInfo 2018-08-22 21:35:49 -04:00
kristopher tate
e95345b3dc std/mem.zig: test writing u64 integers; 2018-08-23 09:03:02 +09:00
Andrew Kelley
478db39866 fix selfExePath on macosx 2018-08-21 20:52:21 -04:00
Andrew Kelley
ea1b21dbdb fix linux
* error.BadFd is not a valid error code. it would always be a bug to
   get this error code.
 * merge error.Io with existing error.InputOutput
 * merge error.PathNotFound with existing error.FileNotFound.
   Not all OS's support both.
 * add os.File.openReadC
 * add error.BadPathName for windows file operations with invalid
   characters
 * add os.toPosixPath to help stack allocate a null terminating byte
 * add some TODOs for other functions to investigate removing the
   allocator requirement
 * optimize some implementations to use the alternate functions when
   a null byte is already available
 * add a missing error.SkipZigTest
 * os.selfExePath uses a non-allocating API
 * os.selfExeDirPath uses a non-allocating API
 * os.path.real uses a non-allocating API
 * add os.path.realAlloc and os.path.realC
 * convert many windows syscalls to use the W versions (See #534)
2018-08-21 20:31:50 -04:00