3 ms·
What if I'm writing code that's strictly single-threaded? Presumably malloc could be simpler and/or faster in this special case? Is there a production-ready al
by bakery2k 7y ago
What if I'm writing code that's strictly single-threaded? Presumably malloc could be simpler and/or faster in this special case?
Is there a production-ready allocator that's optimized for single-threaded use?
- gok 7y agoIt's very hard to not accidentally pull in a dependency that makes your code multithreaded.
- 01100011 7y agoYou guys could argue this all day and both be right. Depending on what type of system you're working on, you are either very likely to pull in a multithreaded dependency or you are not. Systems programming is different from game programming is different from web client programming is different from kernel development. In most of my career, I would have never accidentally pulled in a multithreaded dependency, but I could see how that could be easy to do in some cases.
- imtringued 7y agoIt is already faster because there is no lock congestion.
- rurban 7y agoFor this use case a good copying collector would be best. Beats any malloc by miles.