Commit Graph

22 Commits

Author SHA1 Message Date
Andrew Kelley
0489d06c24
make the std lib support event-based I/O
also add -fstack-report
2019-09-10 10:26:52 -04:00
Andrew Kelley
c175e53564
add std.c.printf 2019-08-20 14:42:39 -04:00
Andrew Kelley
e24cc2e77b
std.event.Loop: fix not waking up after file system I/O
for single threaded event loops
2019-08-16 23:19:13 -04:00
Andrew Kelley
3dce41b61a
improvements to std lib for event-based I/O 2019-08-16 21:29:29 -04:00
Andrew Kelley
6096dc5f94
move some of the installation from cmake to zig build
This moves the installation of shipped source files from large
CMakeLists.txt lists to zig build recursive directory installation.

On my computer a cmake `make install` takes 2.4 seconds even when it has
to do nothing, and prints a lot of unnecessary lines to stdout that say
"up-to-date: [some file it is installing]".

After this commit, the default output of `make` is down to 1
second, and it does not print any junk to stdout. Further, a `make
install` is no longer required and `make` is sufficient.

This closes #2874.

It also closes #2585. `make` now always invokes `zig build` for
installing files and libuserland.a, and zig's own caching system makes
that go fast.
2019-07-15 01:45:26 -04:00
Andrew Kelley
fc9e28ea37
std.os.getrandom does a libc version check
closes #397
2019-07-08 14:42:28 -04:00
Andrew Kelley
bfc86776d5
run zig fmt to update use to usingnamespace 2019-05-29 19:09:58 -04:00
Andrew Kelley
3640303ce1
freebsd fixes 2019-05-27 17:28:59 -04:00
Andrew Kelley
86bb7e5984 fixes for windows to build self hosted compiler 2019-05-27 15:55:15 -04:00
Andrew Kelley
b3dc1c380d
use close$NOCANCEL on darwin 2019-05-27 14:41:13 -04:00
Andrew Kelley
0c6ab61b22
tests passing on linux 2019-05-26 23:35:26 -04:00
Andrew Kelley
2b42e910bf
behavior tests passing on Linux 2019-05-26 19:56:37 -04:00
Andrew Kelley
ca6debcaf4
starting to fix the regressions 2019-05-26 18:32:44 -04:00
Andrew Kelley
3d61e42282
rename "posix" to "bits" 2019-05-26 18:32:44 -04:00
Andrew Kelley
daae7e1f5a
more progress on posix API layer
see #2380
2019-05-26 18:32:43 -04:00
Andrew Kelley
67726e36b0
extract posix functions from std/os.zig to std/os/posix.zig
See #2380
2019-05-26 18:32:40 -04:00
Andrew Kelley
17ffe166c2
add preliminary windows support to std.io.COutStream 2019-04-25 00:24:25 -04:00
Andrew Kelley
976080462c
translate-c: a little closer to self-hosted implementation 2019-04-25 00:06:54 -04:00
Andrew Kelley
1d09cdaa6a munmap allows address 0
fixes test suite regression on macOS from previous commit
2019-03-25 16:04:25 -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
d213708333
this empty import workaround no longer necessary 2019-03-13 14:13:09 -04:00
Andrew Kelley
e402455704
rename std lib files to new convention 2019-03-02 16:46:04 -05:00