PandaRoot
PndFTSInternal::Allocator< T, alignment > Class Template Reference

#include <PndFTSArray.h>

Static Public Member Functions

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

Detailed Description

template<typename T, int alignment>
class PndFTSInternal::Allocator< T, alignment >

Definition at line 179 of file PndFTSArray.h.

Member Function Documentation

◆ Alloc()

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

Definition at line 195 of file PndFTSArray.h.

Referenced by PndFTSResizableArray< PndFTSCAGBHit >::PndFTSResizableArray().

196  {
197  T *p;
198  posix_memalign(&p, alignment, s * sizeof(T));
199  return new (p) T[s];
200  }

◆ Free()

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

Definition at line 201 of file PndFTSArray.h.

References i.

Referenced by PndFTSResizableArray< PndFTSCAGBHit >::Resize(), and PndFTSResizableArray< PndFTSCAGBHit >::~PndFTSResizableArray().

202  {
203  for (int i = 0; i < size; ++i) {
204  p[i].~T();
205  }
206  std::free(p);
207  }
unsigned int i
Definition: P4_F32vec4.h:21

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