|Re: [eigen] Clean aligned memory allocation|
[ Thread Index |
| More lists.tuxfamily.org/eigen Archives
- To: eigen <eigen@xxxxxxxxxxxxxxxxxxx>
- Subject: Re: [eigen] Clean aligned memory allocation
- From: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
- Date: Thu, 4 Feb 2016 09:07:26 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=LOuHr34s0cmFrNaBlAqGlY1tiwgb6tABt6rHauqYfhw=; b=PyrSIwERDgbDAMpxLUpcad+W5cwgk2oAyQLczkDBKSe3bf5v4lPm1CKO1frkQ4m3py LIf+wBOaHdxI9ZI5bGbvMhlMaXdnHy41JfbMbFvYwdgxhNR71QGhF/w9GRZzufOf9gA6 tjcNz0m/+wxEhAChutRPccg1qDW1ECrolamI2rud/fUaavgenEJWfTxUPEfbItlJBEBs Z6mPlvlhe/WOOu0YiRKdE4omylHI1UiNc2RuU9/HnuLdaM/C82E7OdmEk7+WLg0TuAjn ELSy7E89QPkd+jRiJcHSx8HbqzSkbq0hPI+ZWUqR1JQZiEtxU4pbqKS64yWMPxqVCV2r vu1A==
Thanks a lot for getting this data! Very interesting, as I expected the overhead of handmade_ to be larger. Also, you make a good point about the lack of a realloc equivalent for posix_memalign.
So I understand that this makes handmade_ a compelling solution.
On the other hand, I am still concern about the dangerousness of MALLOC_ALREADY_ALIGNED. But it seems that the C++11 rule that you found, could make it safe at least when compiling in C++11 mode, which these days is probably the majority of users (data point: both Google and Mozilla build all their C++ in C++11 mode these days).
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?