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 223 of file PndCAArray.h.

Member Typedef Documentation

◆ T2

Definition at line 225 of file PndCAArray.h.

Member Function Documentation

◆ Alloc()

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

Definition at line 240 of file PndCAArray.h.

241  {
242  T2 *p;
243  posix_memalign(&p, 128, s * sizeof(T2));
244  return new (p) T2[s];
245  }

◆ Free()

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

Definition at line 246 of file PndCAArray.h.

References i.

247  {
248  for (int i = 0; i < size; ++i) {
249  p[i].~T2();
250  }
251  std::free(p);
252  }
unsigned int i
Definition: P4_F32vec4.h:33

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