Re: [AD] malloc() vs align_malloc()

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


AJ wrote:


a quick look through allegro, i found many instances were an aligned malloc *may* improve performace, many of these would not have any side effects as they are internally viewable vars, and would not break user viewable structs etc.


I doubt it would improve performance with our current code, but it should be benchmarked.

anyone from linux land able to offer the linux view or this proposal?


There is this:

   int posix_memalign(void **memptr, size_t alignment, size_t size);

However, some older Unices might not have it so we need a fallback. In the same man page it mentions two obsoleted functions (memalign() and valloc()). Failing that we'll need to fall back to malloc().

Peter




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/