Boost logo

Boost Users :

Subject: Re: [Boost-users] [Pool] Problems using Boost.Pool with the Eigen matrix library
From: joel falcou (joel.falcou_at_[hidden])
Date: 2010-10-14 15:34:42


On 14/10/10 21:28, lfrfly_at_[hidden] wrote:
> Since Eigen matrices and vectors use SSE and therefore require a
> particular alignment, Eigen requires that when these types
> (specifically, the compile-time sized versions) are within a struct or
> class, that struct be given the EIGEN_MAKE_ALIGNED_OPERATOR_NEW macro.
>
> But here's the problem. What if that struct is allocated by a
> boost::pool_allocator<T>? Is there any way to enforce alignment then?
> I'm trying it and it just isn't working. I keep getting breakpoints
> hit inside of Eigen calls, presumably due to unaligned accesses.
>
> Has anyone investigated this, and are there any reasonable options?
> Perhaps a way to force the pool's start to be aligned, and a way to
> make sure the sizeof() my type as a whole is aligned? (But what about
> allocator conversion, eg, std::allocate_shared<T> may take an
> allocator<T> but it converts it internally to an
> allocator<somewrapper<T>>?)
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users

You may want to make a custom allcoator that inherit from pool then use
the poitner stashing memory alignement trick to align it afterward.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net