Commit Graph

1871 Commits

Author SHA1 Message Date
Andrew Kelley
9c0596e627
Merge pull request #2427 from LemonBoy/linux-tls
Proper support for TLS on linux
2019-05-07 12:26:26 -04:00
Andrew Kelley
097a62555e
Merge pull request #2439 from LemonBoy/fixes-fixes-fixes
A batch of miscellaneous fixes
2019-05-07 12:26:02 -04:00
LemonBoy
043bd71621 Add ARCH_SET_* definitions for x86_64 2019-05-07 13:19:38 +02:00
LemonBoy
b1db696c10 Less error messages
Decrease the overall size of the binary, programming errors are caught
with unreachable.
2019-05-07 13:09:20 +02:00
LemonBoy
2f041239cb Always initialize the TLS 2019-05-07 13:09:20 +02:00
LemonBoy
cfcf02489d std: Implement on-demand TLS allocation 2019-05-07 13:09:19 +02:00
LemonBoy
d8ab301aa8 std: Implement TLS support for Linux
Tested on x86_64, i386, ARM, AARCH64
2019-05-07 13:09:18 +02:00
LemonBoy
4ab7b459df Avoid endless recursion in __extendhfsf2
On some platforms the conversion ended up creating a dangerous recursive
loop that ate all the stack.

The conversion to f16 is also pointless since we're operating on the raw
bits anyway.
2019-05-07 11:47:23 +02:00
LemonBoy
94b504c9e4 Fix float comparison result in __aeabi_{f,d}cmp* 2019-05-07 11:47:23 +02:00
LemonBoy
a3beda27fc Add missing cast to usize 2019-05-07 11:47:23 +02:00
Andrew Kelley
7432fb04d6
Merge pull request #2354 from LemonBoy/iterate_phdr_impl
dl_iterate_phdr implementation
2019-05-06 15:48:37 -04:00
LemonBoy
939ec878a0 Fix edge case in addXf3
The operands may be zero, use the wrapping operators and avoid a
spurious integer-overflow error.
2019-05-06 21:41:08 +02:00
LemonBoy
60242e96df Fix definition of epoll_* struct on non x86_64 arches 2019-05-06 21:39:02 +02:00
LemonBoy
a095db0df7 Add a test case 2019-05-06 18:30:49 +02:00
Andrew Kelley
7a41af2632
Merge pull request #2422 from tgschultz/stdlib-packed-int-array
Added PackedIntArray, PackedIntSlice to std
2019-05-05 15:25:17 -04:00
LemonBoy
07dfccf967 Review 2019-05-05 13:00:20 +02:00
Andrew Kelley
5d347c01cf
Merge pull request #2374 from LemonBoy/fileszoff-reform
Make io offsets/sizes u64 instead of usize
2019-05-04 15:20:42 -04:00
Andrew Kelley
09cbcf8841
std lib sleep APIs: add doc comments and no @intCast
The sleep APIs are now documented as having spurious wakeups and no
precision of timing guaranteed. They also cannot fail. This commit makes
the entire range of u64 legal values to pass to std.os.time.sleep and
std.os.time.posixSleep. Values that do not fit in the native system APIs
will cause a sleep for the longest possible duration and then be handled
as a spurious wakeup.
2019-05-04 15:16:39 -04:00
Andrew Kelley
70a9ee3dd6
Merge branch 'stdlib-32b' of https://github.com/LemonBoy/zig into LemonBoy-stdlib-32b 2019-05-04 14:46:35 -04:00
Andrew Kelley
6f0aa801c8
Merge pull request #2404 from squeek502/hash-map-ensure-cap
std.HashMap: add public ensureCapacity fn
2019-05-04 14:13:18 -04:00
Andrew Kelley
21c8d57fca
Merge pull request #2326 from daurnimator/sendmmsg
Add sendmmsg syscall wrapper
2019-05-04 14:05:55 -04:00
tgschultz
14a00d3825 zig fmt 2019-05-04 16:19:26 +00:00
tgschultz
8c28b59605 Added ability to specify endianess of PackedInt(Array/Slice) 2019-05-04 16:17:12 +00:00
tgschultz
27ed525e03 zig fmt 2019-05-04 13:31:53 +00:00
LemonBoy
98bc2b73bf Implement failsafe logic for posixSleep
Now we'll sleep for the specified amount of time even though the number
of seconds doesn't fit in a `isize` field.
2019-05-04 09:03:01 +02:00
LemonBoy
b612512bb5 std: Remove some assumptions about the host platform
The stdlib is now 32-bit friendly.
2019-05-04 08:44:26 +02:00
Ryan Liptak
cf8dde2d68 std.HashMap: cleanup ensureCapacity + add test
- Cleaned up some comments
- Removed the "is power of two" check from optimizedCapacity since the * 5 / 3 is unlikely to end up with a power of two, so it's a wasted check the majority of the time
- Made ensureCapacity/ensureCapacityExact increment the modification count if they resize the hash map so that we can catch resizes while iterating, which would likely break the iterator state
2019-05-03 21:15:00 -07:00
tgschultz
4dfd1f54db Ugh. I updated these but forgot to git add. 2019-05-04 03:08:33 +00:00
tgschultz
7dc71cdc4a and again 2019-05-04 02:39:55 +00:00
tgschultz
3e3bdd577c Fixed some comments 2019-05-04 02:38:16 +00:00
tgschultz
e2fd37e75b Added PackedIntArray, PackedIntSlice to std 2019-05-04 00:28:51 +00:00
Shritesh Bhattarai
f4798297de wasi: Implement read and write with err checking 2019-05-03 17:35:42 -04:00
LemonBoy
2f3b461703 compiler-rt: Add __modsi3, __umodsi3 2019-05-03 17:12:33 -04:00
LemonBoy
1be4e87f0b compiler-rt: Add __moddi3, __divdi3 2019-05-03 17:12:33 -04:00
LemonBoy
077216b582 Address the comments of the first review round 2019-05-03 22:42:45 +02:00
Andrew Kelley
584dd2863a
Merge pull request #2409 from shritesh/wasi_native
WASI std: implement native os.exit and os.abort
2019-05-03 16:24:00 -04:00
Shritesh Bhattarai
f86b8e4535 WasmAllocator: compileError on non-wasm arch 2019-05-03 16:21:33 -04:00
daurnimator
fca3e3a73f std: add std.ArrayList.orderedRemove 2019-05-03 01:54:49 -04:00
Andrew Kelley
3552180143
optimize @memset with undefined
When using `@memset` to set bytes to `undefined`, Zig notices this
case and does a single Valgrind client request rather than N.

Speeds up all allocators in safe modes.

Closes #2388
2019-05-03 01:25:03 -04:00
Ryan Liptak
13a7b8586a std.HashMap: make ensureCapacityExact private 2019-05-02 17:43:51 -07:00
Ryan Liptak
26591d4f22 std.HashMap: add putAssumeCapacity fn 2019-05-02 17:42:38 -07:00
Ryan Liptak
4d42275d03 std.HashMap: make ensureCapacity optimize for the expected count, add ensureCapacityExact 2019-05-02 17:01:30 -07:00
Shritesh Bhattarai
a530a111a5 wasi: remove posix-y exit 2019-05-02 11:33:10 -05:00
Shritesh Bhattarai
84682eb862 wasi: implement os.exit 2019-05-02 11:26:33 -05:00
Shritesh Bhattarai
6fb677c4f6 wasi: native os.abort 2019-05-02 11:25:25 -05:00
Ryan Liptak
0afa2d040a make std.HashMap.ensureCapacity round up to the nearest power of two 2019-05-02 00:58:26 -07:00
Marc Tiehuis
3370e60dd9 std.math: Correct math.nan usage in cos 2019-05-02 19:03:49 +12:00
Ryan Liptak
8b7c59a414 std.HashMap: add public ensureCapacity fn 2019-05-01 23:46:52 -07:00
Marc Tiehuis
89d71a960b std.math: Add documentation for all functions and algorithm sources 2019-05-01 18:37:46 +12:00
Marc Tiehuis
f94964cd05 std.math: Add upstream changes/fixes and simplify go derived code
This also starts the documentation effort for the math/ subdirectory.
The intent is to use this as a somewhat representative test-case for any
work on the documentation generator.
2019-05-01 18:13:33 +12:00