Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of boost. Click here for the latest Boost documentation.
PrevUpHomeNext

Function aligned_alloc

boost::alignment::aligned_alloc

Synopsis

// In header: <boost/align/aligned_alloc.hpp>


void * aligned_alloc(std::size_t alignment, std::size_t size);

Description

Allocates space for an object whose alignment is specified by alignment, whose size is specified by size, and whose value is indeterminate.

Note: On certain platforms, the alignment may be rounded up to alignof(void*) and the space allocated may be slightly larger than size bytes, by an additional sizeof(void*) and alignment - 1 bytes.

Parameters:

alignment

Shall be a power of two.

size

Size of space to allocate.

Returns:

A null pointer or a pointer to the allocated space.


PrevUpHomeNext