Commit Graph

4442 Commits

Author SHA1 Message Date
Andrew Kelley
01fb421031 fix regressions on Windows from previous commit 2019-03-15 18:57:07 -04:00
Andrew Kelley
9c13e9b7ed
breaking changes to std.mem.Allocator interface API
Before, allocator implementations had to provide `allocFn`,
`reallocFn`, and `freeFn`.

Now, they must provide only `reallocFn` and `shrinkFn`.
Reallocating from a zero length slice is allocation, and
shrinking to a zero length slice is freeing.

When the new memory size is less than or equal to the
previous allocation size, `reallocFn` now has the option
to return `error.OutOfMemory` to indicate that the allocator
would not be able to take advantage of the new size.

For more details see #1306. This commit closes #1306.

This commit paves the way to solving #2009.

This commit also introduces a memory leak to all coroutines.
There is an issue where a coroutine calls the function and it
frees its own stack frame, but then the return value of `shrinkFn`
is a slice, which is implemented as an sret struct. Writing to
the return pointer causes invalid memory write. We could work
around it by having a global helper function which has a void
return type and calling that instead. But instead this hack will
suffice until I rework coroutines to be non-allocating. Basically
coroutines are not supported right now until they are reworked as
in #1194.
2019-03-15 17:57:21 -04:00
Andrew Kelley
4090fe81f6
Merge pull request #2068 from ziglang/workaround-for-2043
workaround for #2043
2019-03-15 11:19:21 -04:00
Jimmi Holst Christensen
3ef9b899e4 workaround for #2043 2019-03-15 11:17:21 +01:00
Akuli
b1c8c79733 Add /lib/x86_64-linux-gnu or similar to default system library search paths
this makes compiling with libraries like zlib and ncurses easier
2019-03-14 14:51:24 -04:00
Andrew Kelley
080dd27157
breaking: fix @typeInfo handling of global error set type
`builtin.TypeInfo.ErrorSet` is now `?[]Error`
instead of `struct{errors:[]Error}`.

closes #1936
2019-03-14 11:57:56 -04:00
Andrew Kelley
e861da03f9
macho linking: always -dynamic for non-static-libs 2019-03-14 00:07:05 -04:00
Andrew Kelley
862ac42a6e
ignore -lm on darwin because it's handled by libSystem 2019-03-13 23:44:38 -04:00
Andrew Kelley
927efe5f42 force windows to link against dynamic msvcrt
See #2064
2019-03-13 23:35:58 -04:00
Andrew Kelley
20c36949e1
fix target_requires_pic and reloc_mode
disable failing thread local variable test.
see #2063
2019-03-13 23:15:34 -04:00
Andrew Kelley
5d2edac12d
breaking: remove --static; add -dynamic
`--static` is no longer an option. Instead, Zig makes things as static
as possible by default. `-dynamic` can be used to choose a dynamic
library rather than a static one.

`--enable-pic` is a new option. Usually it will be enabled
automatically, but in the case of build-exe with no dynamic libraries
on Linux or freestanding, Zig chooses off by default.

closes #1703
closes #1828
2019-03-13 19:50:41 -04:00
Andrew Kelley
85d0f0d45b
fix @setRuntimeSafety not able to override release modes 2019-03-13 14:46:53 -04:00
Andrew Kelley
d213708333
this empty import workaround no longer necessary 2019-03-13 14:13:09 -04:00
Andrew Kelley
0588fed15f
add documentation for pub
closes #1727
2019-03-13 13:05:23 -04:00
Andrew Kelley
d495dcc3c9
zig test respects --output-dir parameter 2019-03-13 12:35:10 -04:00
Andrew Kelley
4e40bd8633
add documentation for @"" syntax
closes #1614
2019-03-13 12:01:32 -04:00
LemonBoy
49838a9f3e
Fix generation of comptime slices
By erasing the global_refs field we'd trip any codepath using
const_values_equal_ptr to figure if two slices were different.
2019-03-13 11:35:05 -04:00
emekoi
1ed38a682e added z3 and fixed dynamic linker on mingw 2019-03-13 10:37:53 -04:00
Andrew Kelley
26b0d34361
Merge pull request #2055 from ziglang/musl
support musl for all compatible targets
2019-03-13 01:01:26 -04:00
Andrew Kelley
c73cd05468
musl: remove files that have case conflicts 2019-03-13 01:00:12 -04:00
Andrew Kelley
235ded6265
fix gitattributes 2019-03-12 18:40:31 -04:00
Andrew Kelley
cf699ee068
don't resolve dynamic linker for static executables 2019-03-12 18:28:32 -04:00
Andrew Kelley
9741b2aab4
avoid a string that is too long for msvc 2019-03-12 18:09:40 -04:00
Andrew Kelley
5570bc986b
remove accidental swap file 2019-03-12 17:44:03 -04:00
Andrew Kelley
62486c35a4
ability to build musl from source
bundles musl 1.1.21

See #514
2019-03-12 17:32:32 -04:00
Andrew Kelley
5734b7a37a
building musl start files from source 2019-03-12 13:18:52 -04:00
Andrew Kelley
b7c331eb61
add musl headers 2019-03-12 10:30:12 -04:00
Andrew Kelley
761356209b
add test cases to cover switching on u0 values
closes #1563
2019-03-11 19:42:07 -04:00
Andrew Kelley
1a94dec50e
docs: finish initial documentation for implicit casts
closes #1514
2019-03-11 19:34:58 -04:00
Sahnvour
9b99356551 translate-c: additional test case for integer suffixes on 0 2019-03-11 16:36:27 -04:00
Andrew Kelley
f2ca2ace09
zig build: do a better job of detecting system paths
See #2041
2019-03-11 15:22:05 -04:00
Andrew Kelley
a909efae9f
Merge branch 'daurnimator-valgrind' 2019-03-11 13:42:54 -04:00
Andrew Kelley
d633dcd07a
remove the valgrind integration with std.mem.Allocator
See #1837
2019-03-11 13:34:51 -04:00
Andrew Kelley
5362ca204f
Merge branch 'valgrind' of https://github.com/daurnimator/zig into daurnimator-valgrind 2019-03-11 13:27:04 -04:00
Andrew Kelley
80e5af2be2
Merge pull request #2049 from ziglang/problematic-mtime-detection
stage1 caching system: detect problematic mtimes
2019-03-11 12:47:55 -04:00
Andrew Kelley
9efa18f687 enable C ABI tests on macOS 2019-03-11 12:21:30 -04:00
Andrew Kelley
e1fbb24d64
add test for spawning child process with empty environment
thanks to BenoitJGirard for pointing out the child process
implementation needs 3 extra null bytes in #2031
2019-03-11 11:56:08 -04:00
Andrew Kelley
b4e6e301e1
Merge branch 'fix-1600'
closes #2036
2019-03-11 11:09:55 -04:00
Andrew Kelley
1d5e349a52
ir: fix handling of OnePossibleValueInvalid
this is the poison value which means a compile error has
already been reported
2019-03-11 11:09:15 -04:00
Jimmi HC
bcbb2650c5
check for type_has_one_possible_value and added correct caching to TypeInfo 2019-03-11 10:55:43 -04:00
Jimmi Holst Christensen
357813b193
added tests 2019-03-11 10:55:43 -04:00
Jimmi Holst Christensen
2d7f0ca387
fixed enum to union code 2019-03-11 10:55:10 -04:00
Jimmi Holst Christensen
5a52613caf
use cached const_void_val 2019-03-11 10:55:10 -04:00
Jimmi Holst Christensen
29accac74c
removed wild tab 2019-03-11 10:55:10 -04:00
Jimmi Holst Christensen
8eedec4f93
fixed #1600 2019-03-11 10:55:04 -04:00
Andrew Kelley
3ff0e8bd96
Revert "docgen: --cache off for tests"
This reverts commit 0a8a7a57e7.

This workaround is no longer necessary.
2019-03-11 10:35:42 -04:00
Andrew Kelley
6a5c2b249d
Revert "use unique test source names for test-gen-h"
This reverts commit 264b03d570.

This workaround is no longer necessary.
2019-03-11 10:35:39 -04:00
Andrew Kelley
895fab156a fix build on windows 2019-03-11 10:35:04 -04:00
Andrew Kelley
3a6f19de48
stage1 caching system: detect problematic mtimes
closes #2045
2019-03-11 10:26:08 -04:00
Marc Tiehuis
83b79522d2 Mark third-party dependencies as vendored 2019-03-11 08:16:50 -04:00