Re: [eigen] Clean aligned memory allocation

[ Thread Index | Date Index | More Archives ]

2016-02-04 9:46 GMT-05:00 Gael Guennebaud <gael.guennebaud@xxxxxxxxx>:

On Thu, Feb 4, 2016 at 3:07 PM, Benoit Jacob <jacob.benoit.1@xxxxxxxxx> wrote:
So is this the plan that you have in mind?
1. Restrict MALLOC_ALREADY_ALIGNED to C++11 when actually guaranteed to be safe per standard.
2. Fall back to handmade_ only, drop use of any non malloc/realloc allocator entry points?

Yes for the second point..

For the first one, as Christoph said, we did not observe any trouble for a while, so why not keeping the current strategy in non-c++11, and use the c++11 way otherwise. I'm tempted to argue that replacing the system malloc by a custom one that does not respect the alignment of the system malloc is kind of dangerous practice anyway, and such rare advanced users should be able to define MALLOC_ALREADY_ALIGNED.

Yet, bugs 761 and 779, which you mentioned at the start of this thread, are real, and there's no particular reason for them to have gone away, except perhaps as more users build in c++11 mode or with c++11-capable toolchains that are evolving toward this stricter alignment requirement?

I'm OK with your plan, and at least it doesn't worsen this existing problem.

Just one comment on "advanced users": larger software teams/companies can have one person using Eigen in one corner, and one other person switching memory allocators at the other end of the company, and these two people might not even know each other. So I wouldn't rely on such large teams/companies to spontaneously know that they need to define MALLOC_ALREADY_ALIGNED=0.




Mail converted by MHonArc 2.6.19+