1 #ifndef DASH__ALLOCATOR_H__INCLUDED 2 #define DASH__ALLOCATOR_H__INCLUDED 4 #include <dash/allocator/AllocatorTraits.h> 5 #include <dash/allocator/GlobalAllocator.h> 7 #include <dash/allocator/EpochSynchronizedAllocator.h> 9 #include <dash/memory/MemorySpace.h> 11 #include <dash/memory/SimpleMemoryPoolResource.h> 22 std::size_t alignment,
27 auto pn =
reinterpret_cast< std::uintptr_t
>(ptr);
28 auto aligned = (pn + alignment - 1) & - alignment;
29 auto new_space = space - ( aligned - pn );
30 if (new_space < size)
return nullptr;
32 return ptr =
reinterpret_cast<void *
>(aligned);
37 #endif // DASH__ALLOCATOR_H__INCLUDED size_t size()
Return the number of units in the global team.
This class is a simple memory pool which holds allocates elements of size ValueType.
void * align(std::size_t alignment, std::size_t size, void *&ptr, std::size_t &space)
Replacement for missing std::align in gcc < 5.0.