zig/std
Tyler Philbrick 16aee1f58a
Fix memory leak in parser tests
The `arena` instance being used bythe parse tree was valid and
pointed to valid memory, but existed as a local variable inside the
stack frame of the `parse` function (the `const arena`), which was never
stored anywhere before leaving the scope.

This meant that code above the `parse` function saw a valid instance of
an `ArenaAllocator` that pointed to the same backing memory, but didn't
posess any of the local state built up after the call to `parseRoot`,
basically the caller saw an empty arena.

This meant that when `deinit` was called, it saw an Arena with 0
allocations in it's `buffer_list` and wasn't able to destroy any of the
memory.  This caused it to leak and caused FailingAllocator to balk.

The fix is to make sure the parse tree is using the same instance of
ArenaAllocator as is reported up the call stack, the one inside the
`Tree{}` object.  I'm not sure why that field is marked with a comment
to remove it, as it's used by the `std.ast.Tree.deinit()` function, but
this change seems to solve the problem.
2019-05-12 01:54:30 -07:00
..
atomic rename std lib files to new convention 2019-03-02 16:46:04 -05:00
build rename std lib files to new convention 2019-03-02 16:46:04 -05:00
c rename std lib files to new convention 2019-03-02 16:46:04 -05:00
crypto rename std lib files to new convention 2019-03-02 16:46:04 -05:00
debug breaking changes to std.mem.Allocator interface API 2019-03-15 17:57:21 -04:00
event fixed broken casts in std 2019-03-31 16:47:34 -05:00
fmt rename std lib files to new convention 2019-03-02 16:46:04 -05:00
hash rename std lib files to new convention 2019-03-02 16:46:04 -05:00
io rename std lib files to new convention 2019-03-02 16:46:04 -05:00
math Simplify math.isnan 2019-04-05 11:03:57 -04:00
meta rename std lib files to new convention 2019-03-02 16:46:04 -05:00
os Fix getCurrentId test for pthreads (#2197) 2019-04-05 18:12:46 -04:00
rand rename std lib files to new convention 2019-03-02 16:46:04 -05:00
special build: usageAndErr clean exit (#2194) 2019-04-05 18:38:11 -04:00
valgrind remove the valgrind integration with std.mem.Allocator 2019-03-11 13:34:51 -04:00
zig Fix memory leak in parser tests 2019-05-12 01:54:30 -07:00
array_list.zig breaking changes to std.mem.Allocator interface API 2019-03-15 17:57:21 -04:00
ascii.zig fix std.ascii type error and inverted logic 2019-03-29 12:18:42 -04:00
atomic.zig rename std lib files to new convention 2019-03-02 16:46:04 -05:00
base64.zig rename std lib files to new convention 2019-03-02 16:46:04 -05:00
buf_map.zig rename std lib files to new convention 2019-03-02 16:46:04 -05:00
buf_set.zig rename std lib files to new convention 2019-03-02 16:46:04 -05:00
buffer.zig breaking changes to std.mem.Allocator interface API 2019-03-15 17:57:21 -04:00
build.zig zig build: support single-threaded builds 2019-04-05 14:54:37 -04:00
c.zig munmap allows address 0 2019-03-25 16:04:25 -04:00
coff.zig rename std lib files to new convention 2019-03-02 16:46:04 -05:00
crypto.zig rename std lib files to new convention 2019-03-02 16:46:04 -05:00
cstr.zig rename std lib files to new convention 2019-03-02 16:46:04 -05:00
debug.zig print a message instead of returning an error when debug info comes from a source file not found (for example compiled on another computer) 2019-03-16 15:34:14 +01:00
dwarf.zig
dynamic_library.zig rename std lib files to new convention 2019-03-02 16:46:04 -05:00
elf.zig rename std lib files to new convention 2019-03-02 16:46:04 -05:00
event.zig
fmt.zig support comptime_int in formatInt{,Value} 2019-04-05 11:11:04 -04:00
hash_map.zig introduce the enum literal type 2019-03-24 00:44:18 -04:00
hash.zig rename std lib files to new convention 2019-03-02 16:46:04 -05:00
heap.zig fix regressions on Windows from previous commit 2019-03-15 18:57:07 -04:00
io_test.zig (De)serializer now uses enum instead of bool to determine packing mode (byte/bit). 2019-04-03 15:47:46 +00:00
io.zig Changes as suggested by andrewrk 2019-04-03 20:05:24 +00:00
json_test.zig rename std lib files to new convention 2019-03-02 16:46:04 -05:00
json.zig rename std lib files to new convention 2019-03-02 16:46:04 -05:00
lazy_init.zig rename std lib files to new convention 2019-03-02 16:46:04 -05:00
linked_list.zig rename std lib files to new convention 2019-03-02 16:46:04 -05:00
macho.zig
math.zig fix tests for math.mulWide 2019-03-29 12:17:48 -04:00
mem.zig breaking changes to std.mem.Allocator interface API 2019-03-15 17:57:21 -04:00
meta.zig breaking: fix @typeInfo handling of global error set type 2019-03-14 11:57:56 -04:00
mutex.zig rename std lib files to new convention 2019-03-02 16:46:04 -05:00
net.zig rename std lib files to new convention 2019-03-02 16:46:04 -05:00
os.zig fix incorrect Thread.getCurrentId test 2019-04-05 16:06:35 -04:00
pdb.zig rename std lib files to new convention 2019-03-02 16:46:04 -05:00
priority_queue.zig breaking changes to std.mem.Allocator interface API 2019-03-15 17:57:21 -04:00
rand.zig rename std lib files to new convention 2019-03-02 16:46:04 -05:00
rb.zig rename std lib files to new convention 2019-03-02 16:46:04 -05:00
segmented_list.zig breaking changes to std.mem.Allocator interface API 2019-03-15 17:57:21 -04:00
sort.zig rename std lib files to new convention 2019-03-02 16:46:04 -05:00
spinlock.zig rename std lib files to new convention 2019-03-02 16:46:04 -05:00
statically_initialized_mutex.zig rename std lib files to new convention 2019-03-02 16:46:04 -05:00
std.zig add std.ascii to std.std test "std" 2019-03-29 12:18:42 -04:00
testing.zig introduce the enum literal type 2019-03-24 00:44:18 -04:00
unicode.zig rename std lib files to new convention 2019-03-02 16:46:04 -05:00
valgrind.zig remove the valgrind integration with std.mem.Allocator 2019-03-11 13:34:51 -04:00
zig.zig Recursive rewrite of stage2 parser, part 1 2019-05-12 01:52:16 -07:00