PandaRoot
PndCAInternal::Allocator< T, PndCAFullyCacheLineAligned > Class Template Reference

#include <PndCAArray.h>

Public Types

typedef CacheLineSizeHelper< T > T2
 

Static Public Member Functions

static T2Alloc (int s)
 
static void Free (T2 *const p, int size)
 

Detailed Description

template<typename T>
class PndCAInternal::Allocator< T, PndCAFullyCacheLineAligned >

Definition at line 211 of file PndCAArray.h.

Member Typedef Documentation

◆ T2

Definition at line 213 of file PndCAArray.h.

Member Function Documentation

◆ Alloc()

template<typename T >
static T2* PndCAInternal::Allocator< T, PndCAFullyCacheLineAligned >::Alloc ( int  s)
inlinestatic

Definition at line 228 of file PndCAArray.h.

229  {
230  T2 *p;
231  posix_memalign(&p, 128, s * sizeof(T2));
232  return new (p) T2[s];
233  }

◆ Free()

template<typename T >
static void PndCAInternal::Allocator< T, PndCAFullyCacheLineAligned >::Free ( T2 *const  p,
int  size 
)
inlinestatic

Definition at line 234 of file PndCAArray.h.

References i.

235  {
236  for (int i = 0; i < size; ++i) {
237  p[i].~T2();
238  }
239  std::free(p);
240  }
unsigned int i
Definition: P4_F32vec4.h:21

The documentation for this class was generated from the following file: