On 04/07/2013 23:33, Patrick Walton wrote:
stack segment allocation is the slow path in C malloc, because it's in a high storage class.
If the segments are allocated from a selection of standard sizes, can you not have a (hardware) thread-local pool for each size and dump to a shared pool?
I know modern allocators try to perform a similar optimisation but the requirement here is surely more constrained than the general allocation case, and if you ever hit a stop-the-world across threads then you can also balance out the pools if necessary.
Is it actually the allocation that is expensive, or is it the check to see if a new segment is needed?
How much would it hurt to lose a register in calls? If a function made a check on how much stack space there is remaining and it calls some further function, then it could typically tell that function how much space remains.
When functions are inlined, are the stack checks all combined? It seems odd that the impact should be so high. James _______________________________________________ Rust-dev mailing list [email protected] https://mail.mozilla.org/listinfo/rust-dev
