Boost logo

Boost :

Subject: [boost] Boost.Align review begins today
From: Ahmed Charles (acharles_at_[hidden])
Date: 2014-04-11 23:48:02


Hi all,

1. Function align() to align a pointer, for implementations which do not provide C++11's std::align().
2. Functions aligned_alloc() and aligned_free() for dynamic allocation with specified alignment. { For use in place of ::operator new() and ::operator delete(). }
3. Class template aligned_allocator as an alignment-aware allocator that also allows specifying a minimum alignment. { For use in place of std::allocator. }
4. Class template aligned_allocator_adaptor to turn any existing allocator into an alignment-aware allocator that also allows specifying a minimum alignment. { For use in place of any existing allocator type. }
5. Function is_aligned() to test the alignment of a pointer.

Rationale:
C++11 added the ability to specify increased alignment (over-alignment) for class types. Unfortunately, ::operator new allocation functions, new expressions, and the default allocator, std::allocator, do not support dynamic memory allocation of over-aligned data.

Notes:
This library also meets needs in existing Boost libraries.
- Boost.Smart_Ptr has its own implementation of align().
- Boost.Interprocess and Boost.Log each have their own implementation of aligned_alloc() and aligned_free().

doc: http://glenfe.github.io/align
git: http://github.com/glenfe/align
zip: http://github.com/glenfe/align/archive/master.zip


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