We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
const simdjzon = @import("simdjzon"); const dom = simdjzon.dom; const std = @import("std"); const testing = std.testing; const allr = std.testing.allocator; const ondemand = simdjzon.ondemand;
test "ondemand get with struct" { const S = struct { a: struct { b: []const u8 } }; const input = \\{"a": {"b": "b-string"}} ; var src = std.io.StreamSource{ .const_buffer = std.io.fixedBufferStream(input) }; var parser = try ondemand.Parser.init(&src, allr, "<fba>", .{}); defer parser.deinit(); var doc = try parser.iterate(); var s: S = undefined; try doc.get(&s, .{ .allocator = allr }); std.debug.print("s.a.b '{s}'\n", .{s.a.b}); defer allr.free(s.a.b]); try testing.expectEqualStrings("b-string", s.a.b); }
$ zig build test test └─ run test failure thread 1154051 panic: Invalid free ~/Documents/Code/zig/zig/download/0.14.0/files/lib/std/heap/debug_allocator.zig:870:49: 0x1064377 in free (test) if (bucket.canary != config.canary) @panic("Invalid free"); ^ ~/Documents/Code/zig/zig/download/0.14.0/files/lib/std/mem/Allocator.zig:147:25: 0x108dffb in free__anon_11897 (test) return a.vtable.free(a.ptr, memory, alignment, ret_addr); ^ /tmp/asdf2/src/main.zig:51:20: 0x110de8b in test.ondemand get with struct (test) defer allr.free(s.a.b); ^
The text was updated successfully, but these errors were encountered:
I only noticed this today with zig 0.14.
Sorry, something went wrong.
No branches or pull requests
const simdjzon = @import("simdjzon");
const dom = simdjzon.dom;
const std = @import("std");
const testing = std.testing;
const allr = std.testing.allocator;
const ondemand = simdjzon.ondemand;
The text was updated successfully, but these errors were encountered: