Re:Taming Go’s memory usage, or how we avoided rewriting our...
by slaymaker1907 on Tuesday September 21, 2021 @03:40PM
(#28608989)
I never thought about using a Vec for these, but that is a great idea for keeping the memory management sane for tree/linked lists.
One thing I would add that you need to be wary of destructors with large pointer data structures in Rust since it can easily stack overflow. When using Option<Box<T>> you need to be careful to call Option::take on the pointers in a loop to avoid stack overflow.
One thing I would add that you need to be wary of destructors with large pointer data structures in Rust since it can easily stack overflow. When using Option<Box<T>> you need to be careful to call Option::take on the pointers in a loop to avoid stack overflow.