|
casacore
|
#include <AlignMemory.h>
Public Member Functions | |
| AlignMemory (uInt alignment=0) | |
| Default alignment is none. | |
| uInt | alignment () const |
| Get the alignment. | |
| void * | alloc (size_t size) const |
| Allocate the given amount of memory with the correct alignment. | |
Private Attributes | |
| uInt | itsAlign |
Definition at line 34 of file AlignMemory.h.
|
inlineexplicit |
Default alignment is none.
Definition at line 37 of file AlignMemory.h.
References alignment(), and itsAlign.
|
inline |
Get the alignment.
Definition at line 40 of file AlignMemory.h.
References itsAlign.
Referenced by AlignMemory().
| void * casacore::AlignMemory::alloc | ( | size_t | size | ) | const |
Allocate the given amount of memory with the correct alignment.
If alignment < sizeof(void*), malloc will be used, otherwise posix_memalign. The alignment must be a power of 2 for posix_memalign to succeed. It can be freed with the normal free.
References casacore::size().
|
private |
Definition at line 49 of file AlignMemory.h.
Referenced by AlignMemory(), and alignment().