diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2018-02-26 21:14:15 -0500 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2018-02-26 21:14:15 -0500 |
| commit | 4ac6c4d6bfb8f7ada2799ddb5ce3a9797be0518d (patch) | |
| tree | 4ab97ddfa6d660de755eec346162df5125919d23 /std | |
| parent | 3e86fb500dc918618a2ccaa5d942de98bd5fea47 (diff) | |
| download | zig-4ac6c4d6bfb8f7ada2799ddb5ce3a9797be0518d.tar.gz zig-4ac6c4d6bfb8f7ada2799ddb5ce3a9797be0518d.zip | |
workaround llvm coro transformations
by making alloc and free functions be parameters to async
functions instead of using getelementptr in the DynAlloc block
See #727
Diffstat (limited to 'std')
| -rw-r--r-- | std/mem.zig | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/std/mem.zig b/std/mem.zig index 2adb647ef6..07521bfcb8 100644 --- a/std/mem.zig +++ b/std/mem.zig @@ -116,22 +116,6 @@ pub const Allocator = struct { const non_const_ptr = @intToPtr(&u8, @ptrToInt(bytes.ptr)); self.freeFn(self, non_const_ptr[0..bytes.len]); } - - pub const AsyncAllocator = struct { - allocator: &Allocator, - - fn alloc(self: &const AsyncAllocator, byte_count: usize, alignment: u29) Error![]u8 { - return self.allocator.allocFn(self.allocator, byte_count, alignment); - } - - fn free(self: &const AsyncAllocator, old_mem: []u8) void { - return self.allocator.freeFn(self.allocator, old_mem); - } - }; - - fn toAsync(self: &Allocator) AsyncAllocator { - return AsyncAllocator { .allocator = self }; - } }; /// Copy all of source into dest at position 0. |
