Branchless memory manager?

Posted by Richard Fabian on Stack Overflow See other posts from Stack Overflow or by Richard Fabian
Published on 2010-03-22T10:21:18Z Indexed on 2010/03/22 17:31 UTC
Read the original article Hit count: 338

Anyone thought about how to write a memory manager (in C++) that is completely branch free? I've written a pool, a stack, a queue, and a linked list (allocating from the pool), but I am wondering how plausible it is to write a branch free general memory manager.

This is all to help make a really reusable framework for doing solid concurrent, in-order CPU, and cache friendly development.

Edit: by branchless I mean without doing direct or indirect function calls, and without using ifs. I've been thinking that I can probably implement something that first changes the requested size to zero for false calls, but haven't really got much more than that. I feel that it's not impossible, but the other aspect of this exercise is then profiling it on said "unfriendly" processors to see if it's worth trying as hard as this to avoid branching.

© Stack Overflow or respective owner

Related posts about c++

Related posts about concurrent