CMS 3D CMS Logo

Memory.h
Go to the documentation of this file.
1 #ifndef RecoTracker_MkFitCore_src_Matriplex_Memory_h
2 #define RecoTracker_MkFitCore_src_Matriplex_Memory_h
3 
4 #include <cstdlib>
5 
6 namespace Matriplex {
7 
8  constexpr std::size_t round_up_align64(std::size_t size) {
9  constexpr std::size_t mask = 64 - 1;
10  return size & mask ? (size & ~mask) + 64 : size;
11  }
12 
13  inline void* aligned_alloc64(std::size_t size) { return std::aligned_alloc(64, round_up_align64(size)); }
14 
15 } // namespace Matriplex
16 
17 #endif
void * aligned_alloc(size_t alignment, size_t size) noexcept
void * aligned_alloc64(std::size_t size)
Definition: Memory.h:13
constexpr std::size_t round_up_align64(std::size_t size)
Definition: Memory.h:8