* DirectAllocator does the underlying syscall for every allocation.
* ArenaAllocator takes another allocator as an argument and
allocates bytes up front, falling back to DirectAllocator with
increasingly large allocation sizes, to avoid calling it too often.
Then the entire arena can be freed at once.
The self hosted parser is updated to take advantage of ArenaAllocator
for the AST that it returns. This significantly reduces the complexity
of cleanup code.
docgen and build runner are updated to use the combination of
ArenaAllocator and DirectAllocator instead of IncrementingAllocator,
which is now deprecated in favor of FixedBufferAllocator combined
with DirectAllocator.
The C allocator calls aligned_alloc instead of malloc, in order to
respect the alignment parameter.
Added asserts in Allocator to ensure that implementors of the
interface return slices of the correct size.
Fixed a bug in Allocator when you call realloc to grow the allocation.
The purpose of this is:
* Only one way to do things
* Changing a function with void return type to return a possible
error becomes a 1 character change, subtly encouraging
people to use errors.
See #632
Here are some imperfect sed commands for performing this update:
remove arrow:
```
sed -i 's/\(\bfn\b.*\)-> /\1/g' $(find . -name "*.zig")
```
add void:
```
sed -i 's/\(\bfn\b.*\))\s*{/\1) void {/g' $(find ../ -name "*.zig")
```
Some cleanup may be necessary, but this should do the bulk of the work.
* fix fstat wrong on darwin
* move std.debug.global_allocator to std.debug.global_allocator_state and make it private
* add std.debug.global_allocator as a pointer (to upgrade your zig code remove
the '&')
* standard library knows if it is linking against libc and will
sometimes call libc functions in that case instead of providing
redundant definitions
* fix infinite loop bug when resolving use declarations
* allow calling the same C function from different C imports.
closes#277
* push more logic from compiler to std/bootstrap.zig
* standard library provides way to access errno
closes#274
* fix compile error in standard library for windows
* add implementation of getRandomBytes for windows