Memory allocation

Starting to think about a memory allocation interface – not an allocator as such, but rather an API which offers useful functionality for memory allocation.

Right now, the library is still ugly. Memory allocation (and SMR) are sort of half-in, half-out.

But I don’t want to put memory allocation really into the data structures – it stops them from doing just one thing.

So what about a memory allocator API and having the data structures always just being passed memory.

The MA (memory allocator) API would have some simple NUMA info – which logical cores belong to which NUMA nodes and the latency from a logical core to a given NUMA node.

The user when allocating would indicate which logical cores he cared about with regard to the performance of the allocation, e.g. “ALL”, or a list which is a subset of logical cores. We then work out which is the NUMA node to use.

Open question is large page support. On Windows, it’s easier to use than Linux – it’s a function call, just like malloc. On Linux, you have to do some OS-level configuration before you can issue the function calls to try to allocate large pages.

Perhaps we have an allocation option to obtain large pages, and in the Linux case, the user has to have performed the OS config or of course it will fail at run-time.

Comments are closed.