Open ljamzin opened 7 months ago
var final = try allocator.alloc(u8, d);
@memcpy(final, dst[0..d]);
allocator.free(dst);
return final;
// return dst[0..d];
crude workaround
Thanks for finding this! I should have had a test to catch this earlier. I added one in and fixed it with your suggestion. We can leave this issue open if you'd like to share your results. It'd be interesting to see!
Caught in following test code:
The specifics code probably doesn't matter though, the leak should be reported by testing.allocator with pretty much any net positive encode invocation:
I'm also fairly new to zig and slowly trying to write a shitty parquet file reader. This seems to work for page decompression! I intend to at some point test if/how much using this and other pure zig codec implementations affects bundle size compared to using the C versions. I can share the results if you're curious.