Boost logo

Boost :

From: Doug Gregor (dgregor_at_[hidden])
Date: 2007-09-14 17:14:40


On Sep 14, 2007, at 3:24 PM, Gottlob Frege wrote:
> By the way, it also looks like boost.function is sensitive to
> packing/alignment (in particular, the small-object optimizations).
>
> So if I include function into 2 pieces of code and pass functions back
> and forth, they better have the same alignment!

Well, yes.

> (And considering that boost.threads is typically compiled into a
> separate dll, and uses boost.function, it is not hard to run into the
> problem).
>
> I was working on a test and/or patch and/or etc to make sure I
> understand it correctly, but since function was brought up anyhow...
>
> Has this been seen yet? Do you think it is a boost issue, or a client
> issue? What do you think the best fix is? I think you could re-order
> the members (largest first), but that would still make arrays of
> functions suspect. Otherwise, should you be using the boost pre/post
> alignment headers?

I would typically consider this a client issue, but if a fix such as
using Boost's pre/post alignment headers would make life easier for
clients, I'll be happy to make the change. Test and patch would be
greatly appreciated, of course :)

        - Doug


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk