Commit Graph

6 Commits

Author SHA1 Message Date
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