7040 Commits

Author SHA1 Message Date
Ryan Liptak
2129f28953 Update all std.mem.split calls to their appropriate function
Everywhere that can now use `splitScalar` should get a nice little performance boost.
2023-05-13 13:45:05 -07:00
Ryan Liptak
815e53b147 Update all std.mem.tokenize calls to their appropriate function
Everywhere that can now use `tokenizeScalar` should get a nice little performance boost.
2023-05-13 13:45:04 -07:00
Ryan Liptak
9da3a9733d std.mem: Split tokenize into 3 versions by delimiter type: full, any, and scalar
This allows users to choose which version they need for their particular use case, as the previous default (now the 'any' version) was (1) not always the desired type of delimiter and (2) performed worse than the scalar version if the delimiter was a single item.
2023-05-13 13:43:50 -07:00
Ryan Liptak
bda645d911 std.mem: Split split and splitBackwards into 3 versions by delimiter type: full, any, and scalar
This allows users to choose which version they need for their particular use case, as the previous default (now the 'full' version) was (1) not always the desired type of delimiter and (2) performed worse than the scalar version if the delimiter was a single item.
2023-05-13 13:43:50 -07:00
Josh Wolfe
018b743c7a
std: Rewrite low-level json api to support streaming (#15602) 2023-05-13 14:31:53 -04:00
David CARLIER
c7bf8bab38 std.os: adding linux's sched_setaffinity and its wrapper 2023-05-13 21:18:18 +03:00
xdBronch
4652729217 std.simd.suggestVectorSizeForCpu: fix missing argument in body 2023-05-13 13:35:50 +03:00
Veikka Tuominen
68bacad804
Merge pull request #15643 from Vexu/fixes
make `@call` compile errors match regular calls
2023-05-13 12:52:16 +03:00
David CARLIER
6f418c11e1 linux adding some NUMA support 2023-05-13 12:13:02 +03:00
David CARLIER
cceadf52ba std.c: further darwin's host statistics data 2023-05-13 11:55:43 +03:00
Andrew Kelley
88d275199c
Merge pull request #15240 from Snektron/spirv-basic
spirv: attempting to get the 'basic' behavior tests running
2023-05-12 14:46:20 -07:00
David CARLIER
6547d23312 std.c: adding basic darwin's host_statistics data. 2023-05-12 20:20:31 +03:00
InKryption
3c2841c202 std.math.atan: fix mistyped magic constant
Co-authored-by: WiserOrb <diego99.masotti@gmail.com>
2023-05-11 15:56:42 -07:00
Andrew Kelley
6c41d43519
Merge pull request #15641 from jacobly0/cache-race
Cache: fix race condition
2023-05-11 12:51:56 -07:00
Ali Chraghi
ccc490ef68
setup spirv backend in behavior tests 2023-05-11 20:31:52 +02:00
Robin Voetter
5e62ba1347
opencl: define size of C types
Define the size of the c types according the OpenCL specification.

Note that OpenCL does not define the size of long double. Clang generates
fp128, even though there is no extension that allows such types. The
llvm-spirv translator simply crashes.
2023-05-11 20:31:50 +02:00
Gregory Mullen
aa9ea61216 Add tc{set,get}pgrp to std.os.linux 2023-05-11 19:43:06 +03:00
Andrew Kelley
7f7bd206dc
Merge pull request #15519 from dweiller/issue-15482
Optimize lowering of `s[start..][0..len]`
2023-05-11 08:59:44 -07:00
Andrew Kelley
3bb3d39fb4
Merge pull request #15487 from truemedian/http-tests
std.http: more http fixes, add standalone http server test
2023-05-11 08:37:42 -07:00
Veikka Tuominen
f0fdaf32d3 fix incorrect use of mutable pointers to temporary values 2023-05-11 17:23:06 +03:00
Veikka Tuominen
d761e6cc7d fix formatting in darwin.zig 2023-05-11 14:59:19 +03:00
David CARLIER
20cc69318f std.c: darwin adding more host_info api data 2023-05-11 11:21:07 +03:00
Jacob Young
6e292f66db Cache: fix unnecessary cache misses
With the old logic, it was possible for a bunch of processes to queue up
to update a cache entry, and then each to do so one at a time.  Now, it
rechecks whether there still a cache miss or another process has
completed the work in the interim.
2023-05-11 00:55:40 -04:00
Jacob Young
fae6290387 Cache: fix race condition
When checking a cache entry with no input files for a hit, if
`createFile` returned `error.WouldBlock` we would forget about the fact
that the file has been created, and all future checks will assume that a
cache hit has happened, even though one never has or does, leading to
rare `FileNotFound` errors trying the access the protected files.

This fix works by writing an extra byte to the manifest file to
distinguish hits and misses when there no input files to write.
2023-05-11 00:55:40 -04:00
Meghan
ac385bd8a6 std.fmt.parseIntSizeSuffix: add R and Q
https://www.nist.gov/pml/owm/metric-si-prefixes

https://www.npl.co.uk/si-prefix
2023-05-10 20:11:18 +03:00
David CARLIER
cd7e2bf57a std.c: adding freebsd's ioctl base operands. 2023-05-10 19:14:51 +03:00
Kyle Coffey
ebc3773542
Add std.mem.indexOfNone
This introduces a parallel set of functions to the std.mem.indexOfAny
functions. They simply invert the logic, yielding the first/last index
which is *not* contained in the "values" slice.

Inverting this logic is useful when you are attempting to determine the
initial span which contains only characters in a particular set.

* Document the `indexOfNone` family.

These descriptions are somewhat brief, but the functions themselves are
also simple enough to describe in such a way.
2023-05-10 17:47:58 +03:00
Evin Yulo
6d7bb255a4 Add std.fmt.parseIntSizeSuffix and use for --maxrss
Fixes #14955
2023-05-10 16:31:51 +03:00
Bogdan Romanyuk
c4dbfd5ae1 std.enums: make Ext parameter optional
According to #8169 optional generic functions work fine in comptime so it's possible
2023-05-10 16:15:41 +03:00
Ali Chraghi
05ceac52c9 std.Build: support #cmakedefine01 pattern 2023-05-10 16:10:03 +03:00
Travis Staloch
5d1e69389c std.enums: add tagName()
This is safe alternative to `@tagName()` for non-exhaustive enums that
doesn't panic when given an enum value that has no tag.
2023-05-10 16:07:34 +03:00
Brett Hill
37f56a4259 Issue 15535. Normalize remainder in math.big.int.Managed.divTrunc 2023-05-10 16:01:17 +03:00
Meghan
0972196f4d std.meta: remove tagName
not used by Zig itself anywhere
2023-05-10 16:00:14 +03:00
0x5a4
11fabc4cbe fix 'zig build test' crashing with no tests
fixes #15553
2023-05-10 00:43:45 -07:00
David CARLIER
5260657230 std.c: add freebsd's kinfo_vmobject 2023-05-10 01:48:35 +03:00
David CARLIER
10a7cf58c1 std.c: adding freebsd's domainset_t bitset 2023-05-10 01:13:15 +03:00
Pyry Kovanen
ffccd70671 tls: update finishRead2 for new @memcpy semantics 2023-05-09 14:47:04 -07:00
David Carlier
e21739dd8c std.fs: selfExePath haiku using constants instead 2023-05-09 14:24:20 +03:00
David CARLIER
e8f76b452b std.c: adding freebsd's domainset api 2023-05-09 14:24:03 +03:00
David Carlier
1585ed637d std.c: openbsd sigcontext/ucontext for arm64. 2023-05-09 14:23:46 +03:00
David CARLIER
3dd0afe787 std.c: adding freebsd's kinfo_proc type. 2023-05-09 12:04:53 +03:00
Jacob Young
0bd92da0e2 target: fix typos in x86 feature descriptions 2023-05-08 07:36:20 -04:00
Jayden
b18b4db709
parse_float: Error when a float is attempted to be parsed into an invalid type
Co-authored-by: Ryan Liptak <squeek502@hotmail.com>
2023-05-08 10:42:24 +00:00
Dominic
5a3eca5d4c
Disallow named test decls with duplicate names 2023-05-08 10:59:06 +03:00
Jacob Young
bac3a28214 fmt: avoid canonicalizing enum fields named @"_" to _
This can be used to escape the usual meaning of `_` to indicate a
non-exhaustive enum and create an enum tag that is a literal underscore,
so zig fmt should allow this syntax.

Before, zig fmt changes

    const E = enum { @"_" };

to the semantically different

    const E = enum { _ };

After, it remains the same.
2023-05-08 10:58:31 +03:00
David CARLIER
ff59c45840 std.c: darwin add host_info based data. 2023-05-07 17:05:03 +03:00
Dominic
e1f5ad3cc8
Fix parsing of hexadecimal literals 2023-05-07 08:05:53 +00:00
Jakub Konka
49c1384bac elf: fix typo in def of SHT_LLVM_ADDRSIG 2023-05-07 09:09:19 +02:00
Jakub Konka
66ff7d9161 elf: add more missing defs for SHT_* and SHF_* 2023-05-07 09:05:18 +02:00
dweiller
bd3360e03d convert s[start..start+len] to s[start..][0..len] 2023-05-07 15:55:21 +10:00