4 ms·
The idea of never free()ing and then taking advantage of that with a dumb allocator to get better performance is pretty clever. Doesn't Erlang do something lik
by gngeal 13y ago
The idea of never free()ing and then taking advantage of that with a dumb allocator to get better performance is pretty clever.
Doesn't Erlang do something like this with processes?
What about doing scratch heaps for data with limited lifetime? Especially if you have a way of somehow reasonably predicting how much heap you're likely going to need (perhaps a heuristics obtained with a bit of machine learning?). Allocate a bit more to give yourself some headroom, use a dumb allocator, and if you run out of space, allocate an emergency area. Obviously, in most cases you won't have to do that, though. (If you're obsessed about speed, you can allocate just blindly and use a memory fault handler to detect that you've run out of space. :-) CLISP does that and it seems to work. Look at GNU libsigsegv.)