Boost logo

Boost :

From: Stephen Cleary (scleary_at_[hidden])
Date: 2000-03-03 12:02:01

"reid sweatman" wrote:
> Hope this isn't off-target, but have you considered instances where
> programmer might want to specify data alignments that don't
correspond to
> any native data type? For instance, some architectures make it
possible to
> trade off packing space for access speed, often as a result of a cache
> issue. I'm not proposing any attempt to do the sort of thing we do
> writing highly-optimzed cache-handling code, which is usually in
> anyway, but it would be nice to have the option of specifying an
> value as an argument, and if no argument is specified, it would
default to
> the scheme you specify.

The scheme we have will work for the alignment requirements of any
native or user-defined type. It would be possible (almost trivial) to
add programmer specifying of alignment requirements, but I have to
question if this is necessary.

Even when dealing with embedded systems, there's usually some form of
#pragma "packed" or keyword "__packed__" that will inform the compiler
to pack and align the structures in a more memory-efficient way. If
the compiler is aware of it, our code will automatically conform; so I
would recommend just informing the compiler, making the overrides in
our class unnecessary.


Boost list run by bdawes at, gregod at, cpdaniel at, john at