4 ms·
> If you are hell-bent on using FixedBufferAllocator only and you want to avoid copies, there is a way. Using two buffers (and separate allocators backed by the
by rntz 4y ago
> If you are hell-bent on using FixedBufferAllocator only and you want to avoid copies, there is a way. Using two buffers (and separate allocators backed by them), it is possible to keep swapping between them after every iteration.
I found this bit lovely: the author has independently reinvented the core idea of semispace copying garbage collectors (see eg https://wingolog.org/archives/2022/12/10/a-simple-semi-space-collector https://wingolog.org/archives/2022/12/10/a-simple-semi-space...).
- krut-patel 4y agoAnd I am not the only one :) https://old.reddit.com/r/Zig/comments/11vbiv1/the_curious_case_of_a_memory_leak_in_a_zig_program/jct0ond/ https://old.reddit.com/r/Zig/comments/11vbiv1/the_curious_ca...
- gonzus 4y agoThat would be me... Cheers!