#I want to leak memory fast
19 messages · Page 1 of 1 (latest)
How about Box::leak?
Arena allocation is faster
std::mem::forget 
Anecdotally DMD got an overall wall-clock 2x speedup by switching from the equivalent of Box::leak to arena allocation
once_cell 
sorry, not sure I understand 😅
I've never used once_cell before, how would I use it here?
It's recommended over lazy_static
this is a work for C++
I don't think you can be faster than putting an arena in a static and querying data from it
Yes, that is what I want to do :P
I am just asking about the simplest way to do it (like if there are libraries that make it easy)
there was so much library plumbing for thread_local! lazy_static! bumpalo::Bump that I just wrote a simple arena allocator myself
but it would be very nice if there were a crate that did what I want bc then it wouldn't be my job to worry about safety properties
are you using thread_local! and lazy_static! simultaneously for one thing?
I was going to but changed my mind, deleted the dependencies, and just wrote the arena myself
thread_local! and lazy_static! aren't supposed to be used at once, what does your code look like now?
TIL, thanks