|
Boost : |
From: Peter Dimov (pdimov_at_[hidden])
Date: 2000-12-04 11:01:55
> > In some cases I have felt the need to define an std::vector<float> that
> > aligns their elements on, say, 128-bit boundaries (the Intel SSE, AMD
> 3DNow
> > extensions like their floats aligned.) Is it possible to pass a stricter
> > alignment requirement to pool_alloc?
>
> No. There is no obvious way to allow this in pool. Pool will use
operator
> new[] for arrays of char; this is supposed to guarantee alignment.
new[] will guarantee alignment for C++ types; unfortunately, SIMD types do
not map to C++ and the default new[] is not guaranteed to work for them.
[...]
> Pool itself passes off the alignment issues to operator new[]. Thus, it
> should be possible to tackle alignment issues by overloading operator
new[],
> if you know your compiler doesn't provide proper alignment.
Yes, this is an option; but wouldn't it be better to allow user-supplied
allocation/deallocation functions?
-- Peter Dimov Multi Media Ltd.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk