SPH
Classes | Functions
AlignedStorage.h File Reference

Base class for utility wrappers (Optional, Variant, ...) More...

#include "common/Assert.h"
#include "common/Traits.h"
#include <mm_malloc.h>

Go to the source code of this file.

Classes

class  AlignedStorage< Type >
 Simple block of memory on stack with size and alignment given by template type. More...
 
class  AlignedStorage< Type & >
 Specialization for l-value references, a simple wrapper of ReferenceWrapper with same interface to allow generic usage of AlignedStorage for both values and references. More...
 

Functions

template<typename T , typename... TArgs>
NAMESPACE_SPH_BEGIN INLINE T * alignedNew (TArgs &&... args)
 Creates a new object of type T on heap, using aligned allocation. More...
 
template<typename T >
INLINE void alignedDelete (T *ptr)
 Deletes an object previously allocated using alignedNew. More...
 
template<typename T >
INLINE bool isAligned (const T &value)
 

Detailed Description

Base class for utility wrappers (Optional, Variant, ...)

Author
Pavel Sevecek (sevecek at sirrah.troja.mff.cuni.cz)
Date
2016-2021

Definition in file AlignedStorage.h.

Function Documentation

◆ alignedDelete()

template<typename T >
INLINE void alignedDelete ( T *  ptr)

Deletes an object previously allocated using alignedNew.

Definition at line 26 of file AlignedStorage.h.

◆ alignedNew()

template<typename T , typename... TArgs>
NAMESPACE_SPH_BEGIN INLINE T* alignedNew ( TArgs &&...  args)

Creates a new object of type T on heap, using aligned allocation.

Definition at line 16 of file AlignedStorage.h.

◆ isAligned()

template<typename T >
INLINE bool isAligned ( const T &  value)

Definition at line 37 of file AlignedStorage.h.