aboutsummaryrefslogtreecommitdiff
path: root/std/heap.zig
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2018-06-29 15:39:55 -0400
committerAndrew Kelley <superjoe30@gmail.com>2018-07-02 14:38:11 -0400
commita3f55aaf34f0a459c8aec4b35e55ad4534eaca30 (patch)
tree5799189e210d53271de654a2f713e7d5f9056fed /std/heap.zig
parent2759c7951da050d825cf765c4b660f5562fb01a4 (diff)
downloadzig-a3f55aaf34f0a459c8aec4b35e55ad4534eaca30.tar.gz
zig-a3f55aaf34f0a459c8aec4b35e55ad4534eaca30.zip
add event loop Channel abstraction
This is akin to channels in Go, except: * implemented in userland * they are lock-free and thread-safe * they integrate with the userland event loop The self hosted compiler is changed to use a channel for events, and made to stay alive, watching files and performing builds when things change, however the main.zig file exits after 1 build. Note that nothing is actually built yet, it just parses the input and then declares that the build succeeded. Next items to do: * add windows and macos support for std.event.Loop * improve the event loop stop() operation * make the event loop multiplex coroutines onto kernel threads * watch source file for updates, and provide AST diffs (at least list the top level declaration changes) * top level declaration analysis
Diffstat (limited to 'std/heap.zig')
-rw-r--r--std/heap.zig1
1 files changed, 1 insertions, 0 deletions
diff --git a/std/heap.zig b/std/heap.zig
index 41d7802fdd..2e02733da1 100644
--- a/std/heap.zig
+++ b/std/heap.zig
@@ -38,6 +38,7 @@ fn cFree(self: *Allocator, old_mem: []u8) void {
}
/// This allocator makes a syscall directly for every allocation and free.
+/// TODO make this thread-safe. The windows implementation will need some atomics.
pub const DirectAllocator = struct {
allocator: Allocator,
heap_handle: ?HeapHandle,