How is data freed when using lazy_static
? The documentation states that no destructors (drop-fn) are called when using lazy_static. I've also read somewhere that Rust doesn't allow any user defined code before or after main execution.
So what happens with any data allocated on the heap via lazy_static
?
Does this mean that there is a memory leak and Rust doesn't free this memory by purpose? Or are there any special ways this is done? Or does the OS need to take care of this when the process ends?