3 ms·
> allocate a buffer at startup and let the system clean it up when the program exits This is possible with the lazy_static library or (not yet in stable Rust)
by alpaca128 4y ago
> allocate a buffer at startup and let the system clean it up when the program exits
This is possible with the lazy_static library or (not yet in stable Rust) OnceCell. It allows you to allocate & initialize any datastructure once during runtime and get global read-only access.