Jacob Young
e78d7704a4
math.big.int: document the purpose of limb_len in scalar methods
...
Ideally this duplicated code could be factored out into a function, but
there doesn't seem to be any way in the Zig type system to represent an
argument to a function called at comptime that is only needed if it is
comptime-known. Instead, we document what is going on in an adjacent
comment in case it gets copy-pasted into new methods in the future.
2022-10-12 08:56:13 -04:00
Jacob Young
38ee512a25
math.big.int: add calcLimbLen doc comment note
...
When trying to allocate memory for functions like `Managed.init` and
`Managed.set` on the stack, a comptime-known allocation size is desired.
The doc comments for these functions indicate that `calcLimbLen` can be
used to determine how many limbs to allocate, but if `value` is not
comptime-known, then neither is `calcLimbLen(value)`. However, an upper
bound on the allocation size is still computable at comptime in this
case, so this note documents an expression that can be used, rather than
trying to add it to every doc comment that mentions `calcLimbLen`.
2022-10-12 08:18:47 -04:00
Jacob Young
2fe5bdb9ed
big.int: rewrite confusing code in an equivalent but less confusing way
2022-10-11 19:57:13 -04:00
Jacob Young
5c49341f09
big.int: add support for non-comptime scalars
2022-10-11 19:51:03 -04:00
Jacob Young
7a89eebfc6
std.math: add support to cast for a comptime_int argument
...
This allows converting a comptime_int to an optional integer type, which
either behaves the same as an implicit cast or produces null if the
argument is outside the range of the destination type.
2022-10-11 19:51:03 -04:00
GethDW
01b9fa2c25
std: fix memory leak on OutOfMemory error in math.big.int and math.big.rationa
2022-10-11 20:12:03 +03:00
Ali Chraghi
d086b371f0
Compilation: strip debug info from ReleaseSmall by default
2022-10-11 17:51:25 +02:00
mllken
42a3b60c33
io_uring: allow for nullable arguments
2022-10-11 17:49:30 +02:00
r00ster91
697e22caa4
fix: resolve data race in std.Progress.maybeRefresh()
...
It seems we can simply lock the update mutex a little earlier.
2022-10-11 17:46:39 +02:00
Eric Milliken
0b7b4b7e97
std: add linux support for packet sockaddr
2022-10-11 18:46:24 +03:00
Andrew Kelley
c3d67c5c4e
Merge pull request #13117 from topolarity/compiler-rt-cmul
...
compiler-rt: Implement complex multiply/division
2022-10-11 05:51:47 -04:00
Rekai Nyangadzayi Musuka
dacdc95ea2
std/math.zig: use previous rotate code with non-power-of-two integers
2022-10-11 00:22:35 +03:00
Cody Tapscott
879fb0c57c
Manually construct denormal constants in tests
...
Constructing these at runtime can cause them to be flushed to zero,
which was triggering a CI failure for Windows.
2022-10-09 20:29:30 -07:00
Cody Tapscott
eac1e613be
compiler_rt: Re-implement ldexp/ilogb using bit-ops
...
This re-write was needed to fix deficiencies in the existing ldexp,
which was failing to compute correct results for both f16 and f80.
It would be nice to add a fast multiplication-based fallback in the
future for targets that have a hardware FPU, but this implementation
should be much faster than the existing for targets without one.
2022-10-09 11:09:02 -07:00
Luuk de Gram
3beef5a94f
CheckObjectStep: parsing and dumping producers
2022-10-08 09:43:40 +02:00
Ali Chraghi
11dce78944
std.http: fix typo
2022-10-06 21:22:20 +03:00
Andrew Kelley
ff534d2267
Merge pull request #12979 from Vexu/inline-switch
...
Implement inline switch cases
2022-10-03 23:43:09 -04:00
GethDW
9d5462dcb5
std: fix memory leak in ArrayHashMap ( #13001 )
2022-10-03 22:57:53 -04:00
Luuk de Gram
8bbb022500
std: WASI - update to latest snapshot preview 1
...
This implements the new addition to the API: `sock_accept`.
Reference commit of WASI spec:
0ba0c5e2e37625ca5a6d3e4255a998dfaa3efc52
For full details:
0ba0c5e2e3
For entire spec at this commit:
0ba0c5e2e3/phases/snapshot/docs.md
2022-10-03 22:48:57 -04:00
zooster
db5562deb0
std.os.windows: fix HANDLER_ROUTINE callconv
2022-10-03 13:05:38 +03:00
alex
2eb0909206
std.ChildProcess: correct fn getUserInfo pkg in setUserName
...
17b0166e moved getUserInfo from std.os to std.process
but ChildProcess.setUserName never updated the pkg name.
2022-10-03 12:59:47 +03:00
zooster
91b05ad473
std.math: allow comptime_float for radiansToDegrees and degreesToRadians
...
And some other minor things.
2022-10-01 13:46:20 +03:00
r00ster91
f6312e4b69
docs: minor improvements
...
Just some minor improvements when passing by.
2022-09-29 21:40:25 +02:00
r00ster91
fda0b2c372
fix(std.testing.refAllDeclsRecursive): silently return if !builtin.is_test
2022-09-29 21:40:25 +02:00
ominitay
295451dfe5
std: Replace use of stage1 function pointers
2022-09-29 21:45:30 +03:00
Chris Boesch
9c99a88796
std.math: add "Greatest common divisor" (gcd)
2022-09-29 21:42:56 +03:00
zooster
12896d36cb
std.builtin: un-pub testVersionParse()
2022-09-29 14:47:41 +03:00
Lee Cannon
8d288a5fa7
Fix Step.cast for OptionsStep and CheckObjectStep
2022-09-29 14:41:39 +03:00
Jacob Young
5e0d8a435e
testing: fix copy paste typo
2022-09-29 14:39:10 +03:00
Evin Yulo
779c2daa19
Remove outdated comment
2022-09-28 13:00:00 +03:00
Silver
f3a1b5c481
std/meta: make FieldEnum(T) == Tag(T) for tagged unions when values match field indices
2022-09-27 18:42:20 +03:00
Veikka Tuominen
0e77259f44
add inline switch union tag captures
2022-09-27 18:33:23 +03:00
Veikka Tuominen
b4d81857f3
stage1+2: parse inline switch cases
2022-09-27 18:05:08 +03:00
Jacob Young
e915b905e0
use @ptrCast to assigned generic type to default_value
...
If the type happens to be a pointer, then the double pointer will not
coerce implicitly.
2022-09-27 13:21:01 +03:00
Lee Cannon
38a50f819c
make runPkgConfig pub
2022-09-27 13:20:32 +03:00
Bill Nagel
eeeda53423
add missing darwin types
2022-09-23 12:25:40 +03:00
ノYuh
eaaaceaf3c
make fmt.formatAsciiChar respect options parameter
2022-09-23 12:20:38 +03:00
noiryuh
0be46866fe
use std.ascii instead of defining ascii functions in std.fs.path
2022-09-23 12:19:09 +03:00
Evin Yulo
dab5bb9247
Fix docstring for std.fs.path.extension
2022-09-22 20:13:09 -04:00
Ali Chraghi
0799e98562
std: update NativeTargetInfo.detect doc comments
...
`detect` doesn't take allocator anymore
2022-09-21 20:14:39 +03:00
Veikka Tuominen
694fab4848
std: add return address parameter to panic fn
2022-09-20 19:05:00 -07:00
Andrew Kelley
62ecc154d9
Merge pull request #12904 from Vexu/ptrcast
...
stage2: pointer casting fixes and improvements
2022-09-20 22:02:36 -04:00
Meghan
521c753fda
std: fix os.linux.S function signatures to use mode_t
2022-09-20 17:54:32 -04:00
Veikka Tuominen
541b3e3a31
Sema: check pointer qualifiers before implicit cast
...
Closes #12881
2022-09-20 00:50:13 +03:00
Jakub Konka
e601969244
macho: rewrite how we allocate space in incremental context
2022-09-18 10:00:04 +02:00
billzez
dfcadd22bb
fix android definition of pthread_rwlock_t ( #12830 )
2022-09-16 20:20:24 -05:00
Veikka Tuominen
b2aedb0709
Merge pull request #12796 from Vexu/referenced-by-v2
...
stage2: add referenced by trace to compile errors attempt #2 (+ some fixes)
2022-09-16 23:49:00 +03:00
Andrew Kelley
d3d24874c9
std: remove deprecated API for the upcoming release
...
See #3811
2022-09-16 14:46:53 -04:00
cod1r
7b32aacbaf
fix ChildProcess crash when PATH is empty.
2022-09-15 22:54:17 -04:00
Stephen Gregoratto
7ccb94fac8
Audit FreeBSD structs to match header files/ABI
...
The big outliers were `Stat` and `mcontext_t`. Also adds doc-comments
from the headers where possible.
2022-09-14 20:05:54 -04:00