SyTen

◆ l_malloc()

void * syten::l_malloc ( std::size_t const  size,
std::size_t const  alignment = 64 
)

Allocates a region of heap memory at least size bytes large, aligned to alignment boundary.

Uses posix_memalign(), mkl_alloc() was always slower when tested.

Parameters
sizeminimal number of bytes to allocate
alignmentalignment requirement
Returns
a pointer p s.t. p % alignment == 0 and p[i] is valid for all i > -1 ∧ i < size

References smallest_multiple().

Referenced by syten::Cuda::CudaAllocator::get_memory(), syten::DynArray< Type >::initNew(), and syten::DynArray< Type >::initTrivial().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: