cymem
cymem copied to clipboard
Aligned allocation
This seems like a very nice and useful little library. Definitely fills a need.
Would you be willing to include support for aligned allocation? This is handled a little differently on each platform, and providing a nice, platform independent interface to it that "just works" would be quite useful.
For instance, if you see lines 12-43 in this file, you can see my own attempt at this. Frankly, I have no confidence that I've done this the right way. :-)
(I'm considering using cymem in the library linked to above. Intel's Embree library requires memory to be allocated with alignment.)
Yes I'd be interested in that. We have support for changing the allocation function, so in theory aligned allocation shouldn't be so hard.
The problem I have with aligned allocation is I never feel like I've done it properly =/. So I've never really seen a big performance increase.
I don't have enough experience with it to know when exactly to expect a performance boost. You need to use it in order to take full advantage of SIMD vectorization. I understand your uncertainty... In my case, it's simply a requirement for using Embree---memory that the user allocates must be allocated with a specific alignment.
What can I do to help?
Sorry for the very late reply here, but if you want to start work on a PR for this I think we'd be happy to look at it.