Commit Graph

21313 Commits

Author SHA1 Message Date
Andrew Kelley
abd9089aa6 std.build: simpler fix to options implementation
Instead of messing with ArrayList and more logic, just unwrap the error
of toOwnedSlice().
2022-11-30 13:22:04 -07:00
GethDW
747f64b3fb std.build.Builder: fix for Allocator changes 2022-11-30 13:04:32 -07:00
Andrew Kelley
44ee1c885f std.os.windows.ReadLink: add missing alignment of local data buffer 2022-11-30 12:55:23 -07:00
Andrew Kelley
71038c42f5
Merge pull request #13513 from ziglang/faster-wasm-gpa
WebAssembly-only fast allocator
2022-11-30 01:46:37 -05:00
Andrew Kelley
7f063b2c52 WasmAllocator: simplify thanks to new Allocator interface
Now it can refuse to resize when it would disturb the metadata tracking
strategy, resulting in smaller code size, a simpler implementation, and
less fragmentation.
2022-11-29 23:46:02 -07:00
Andrew Kelley
931261752d rename a couple variables 2022-11-29 23:46:02 -07:00
Andrew Kelley
e2e60f5ff9 std.heap.WasmAllocator: redo
The previous version had a fatal flaw: it did ensureCapacity(1) on the
freelist when allocating, but I neglected to consider that you could
free() twice in a row. Silly!

This strategy allocates an intrusive freelist node with every
allocation, big or small. It also does not have the problems with resize
because in this case we can push the upper areas of freed stuff into the
corresponding freelist.
2022-11-29 23:46:02 -07:00
Andrew Kelley
3dcea95ffe std.heap.WasmAllocator: implement resizing 2022-11-29 23:46:02 -07:00
Andrew Kelley
d4a1ae474a std.heap.WasmAllocator: resize in place without force shrinking 2022-11-29 23:46:02 -07:00
Andrew Kelley
0c0c70ee82 std.heap.WasmAllocator: large allocations 2022-11-29 23:46:02 -07:00
Andrew Kelley
3ea04ed64c introduce std.heap.WasmAllocator
fast allocator for WebAssembly

eventually this is intended to be merged into
`std.heap.GeneralPurposeAllocator`
2022-11-29 23:46:02 -07:00
Andrew Kelley
9f8c19210b std.heap: extract PageAllocator, WasmPageAllocator 2022-11-29 23:46:02 -07:00
Andrew Kelley
e35f297aeb
Merge pull request #13666 from ziglang/allocator-interface
std.mem.Allocator: allow shrink to fail
2022-11-30 01:44:34 -05:00
Andrew Kelley
f466667888 stage2: fix crash on comptime lazy @ctz and @clz 2022-11-29 23:30:38 -07:00
Andrew Kelley
ceb0a632cf std.mem.Allocator: allow shrink to fail
closes #13535
2022-11-29 23:30:38 -07:00
Andrew Kelley
deda6b5146 LLVM: fix canElideLoad behavior with loops
closes #13546
2022-11-30 00:20:49 -05:00
Andrew Kelley
b8473ae7d3
Merge pull request #13693 from Vexu/safety
Safety panic improvements & some bug fixes
2022-11-29 19:59:55 -05:00
Jakub Konka
648579b330 libstd: skip problematic tests on aarch64-windows 2022-11-30 00:26:40 +01:00
Jakub Konka
37a9b78bc1
Merge pull request #13701 from ziglang/arm-win-more-features
Improve aarch64 feature detection based on the readouts from privileged system registers
2022-11-30 00:20:38 +01:00
Loris Cro
52e1be9c68 Revert "ci: add markers for collapsing log sections in GH web UI"
This reverts commit 6028adda4b.
2022-11-29 22:55:04 +01:00
Loris Cro
6028adda4b ci: add markers for collapsing log sections in GH web UI 2022-11-29 22:03:30 +01:00
Veikka Tuominen
b2b1d421c3 Sema: add missing failWithBadMemberAccess to zirExport
The assumption that AstGen would error only holds when exporting
a identifier not a namespace member.
2022-11-29 21:44:08 +02:00
Veikka Tuominen
4b0ef6a409 Sema: make non-existent field error point to field name
Closes #13698
2022-11-29 21:44:08 +02:00
Veikka Tuominen
6f5a438946 AstGen: unstack block scope when creating opaque type
Closes #13697
2022-11-29 21:44:08 +02:00
Veikka Tuominen
e60db701d1 Sema: add option to disable formatted panics
Closes #13174
2022-11-29 21:44:08 +02:00
Veikka Tuominen
ed73429926 Sema: explain why parameter must be declared comptime
Closes #13692
2022-11-29 21:44:08 +02:00
Veikka Tuominen
17ff002bc0 Sema: improve safety panic for access of inactive union field 2022-11-29 21:44:08 +02:00
Jakub Konka
9d0ea0e3f1 arm: implement CPU feature detection by parsing system registers
Also add an incomplete table implementing instruction fusions according
to official optimisation programming manuals.
2022-11-29 19:24:42 +01:00
Jakub Konka
988fff260e windows: map CP 40xx registry values to system ID registers 2022-11-29 19:24:42 +01:00
Jakub Konka
152202da77 windows: if detecting CPU feature set and model fails, use generic with overrides 2022-11-29 19:24:42 +01:00
Veikka Tuominen
6337c04244 Sema: improve panic for slice start index being greater than end index
Closes #13689
2022-11-29 15:47:02 +02:00
Veikka Tuominen
6f9c7e33b9 llvm: implement union_init for packed unions
Closes #13664
2022-11-29 15:47:02 +02:00
Veikka Tuominen
34be5784a3 parser: disallow defer and variable declaration as else branch
Closes #13658
2022-11-29 15:47:02 +02:00
Jakub Konka
1829b6eab8
Merge pull request #13625 from kcbanner/windows_disable_symlink_tests
Skip linker tests requiring symlinks on Windows
2022-11-29 02:57:37 +01:00
Jakub Konka
033aa1d761 aarch64-windows: skip failing standalone tests 2022-11-28 19:45:53 -05:00
Jakub Konka
870872dd63 aarch64-windows: skip failing floatop behavior test 2022-11-28 18:10:51 -05:00
Jakub Konka
07bf4de6a9 aarch64-windows: skip failing align behavior test 2022-11-28 18:10:51 -05:00
Jakub Konka
7bcc1282e2
Update build.zig 2022-11-28 22:04:42 +01:00
Jakub Konka
d3b1cdf508
Merge pull request #13659 from ziglang/arm-win-cpu-features
windows: add native CPU and features detection for Armv8 chips
2022-11-28 21:36:56 +01:00
Veikka Tuominen
a660df4900 llvm: improve emitted debug info
* ensure parameter debug info is in the subroutine di scope
* slit sub file path into basename and dirname

Closes #12257
Closes #12665
2022-11-28 21:58:41 +02:00
Frank Denis
da9c530d99
Update wasi-libc to a00bf321eeeca836ee2a0d2d25aeb8524107b8cc (#13626)
* Update wasi-libc to a00bf321eeeca836ee2a0d2d25aeb8524107b8cc

It includes a port of emscripten's allocator that performs
performs much better than the old one.

Most importantly, it includes the prerequisites to later add
support for POSIX threads.
2022-11-28 19:58:03 +01:00
Ryan Liptak
4e078941d0 os.windows.OpenFile: Add USER_MAPPED_FILE as a possible error
Ran into this when using a program that uses CreateFileMapping and then trying to call `std.fs.createFile` on the mapped file. More info can be found here:

https://stackoverflow.com/questions/41844842/when-error-1224-error-user-mapped-file-occurs

Before:

```
error.Unexpected NTSTATUS=0xc0000243
C:\Users\Ryan\Programming\Zig\zig\lib\std\os\windows.zig:138:40: 0x7ff74e957466 in OpenFile (test.exe.obj)
        else => return unexpectedStatus(rc),
                                       ^
```

After:

```
FAIL (AccessDenied)
C:\Users\Ryan\Programming\Zig\zig\lib\std\os\windows.zig:137:30: 0x7ff7f5b776ea in OpenFile (test.exe.obj)
        .USER_MAPPED_FILE => return error.AccessDenied,
                             ^
```
2022-11-28 18:56:11 +01:00
zooster
a27bfae036 std.Thread.Futex.PosixImpl.Address.from: fix alignment type
Fixes #13673
2022-11-28 18:49:33 +02:00
Jakub Konka
2528189101 windows: fix signature of kernel32.RegOpenKeyExW to use *HKEY 2022-11-28 17:09:03 +01:00
Jakub Konka
7bf12b1197 arm: move cpu model table into system/arm.zig
Now we can reuse the table between CPU model parsers on Linux and
Windows.

Use similar parsing structure for Windows as we do for Linux. On
Windows, we rely on two entries in the registry per CPU core:
`CP 4000` and `Identifier`. Collating the data from the two allows
us recreating most of the `/proc/cpuinfo` data natively on Windows.
Additionally, we still allow for overwriting any CPU features as flagged
by pulling the feature data embedded in `SharedUserData`.
2022-11-28 17:07:35 +01:00
Jakub Konka
7fbd2955fa windows: pull QWORD and SZ identifiers from registry in one syscall
At the same time, do not assume the values necessarily exist, and
use defaults as markers for the lack of keys in the registry.
2022-11-28 17:07:34 +01:00
Jakub Konka
d64d7aaac7 windows: drive the registry helper with actual value set for reg entries 2022-11-28 17:07:34 +01:00
Jakub Konka
57bda6524b windows: make registry helper generic over value types 2022-11-28 17:07:34 +01:00
Jakub Konka
49ce86bddf windows: fix logic for pulling info for each core 2022-11-28 17:07:34 +01:00
Jakub Konka
f348fbc024 windows: revert changes to definition of HKEY 2022-11-28 17:07:34 +01:00