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 191 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 207 of file PndFTSArray.h.

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

208  {
209  T *p;
210  posix_memalign(&p, alignment, s * sizeof(T));
211  return new (p) T[s];
212  }

◆ Free()

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

Definition at line 213 of file PndFTSArray.h.

References i.

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

214  {
215  for (int i = 0; i < size; ++i) {
216  p[i].~T();
217  }
218  std::free(p);
219  }
unsigned int i
Definition: P4_F32vec4.h:33

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