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

#include <PndCAArray.h>

Static Public Member Functions

static T * Alloc (int s)
 
static void Free (T *const p, int size)
 

Detailed Description

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

Definition at line 256 of file PndCAArray.h.

Member Function Documentation

◆ Alloc()

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

Definition at line 272 of file PndCAArray.h.

273  {
274  T *p;
275  posix_memalign(&p, 128, s * sizeof(T));
276  return new (p) T[s];
277  }

◆ Free()

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

Definition at line 278 of file PndCAArray.h.

References i.

279  {
280  for (int i = 0; i < size; ++i) {
281  p[i].~T();
282  }
283  std::free(p);
284  }
unsigned int i
Definition: P4_F32vec4.h:33

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