PandaRoot
PndCAInternal::Allocator< T, alignment > 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, int alignment>
class PndCAInternal::Allocator< T, alignment >

Definition at line 179 of file PndCAArray.h.

Member Function Documentation

◆ Alloc()

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

Definition at line 195 of file PndCAArray.h.

Referenced by PndCAResizableArray< T, Dim, alignment >::PndCAResizableArray().

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 PndCAInternal::Allocator< T, alignment >::Free ( T *const  p,
int  size 
)
inlinestatic

Definition at line 201 of file PndCAArray.h.

References i.

Referenced by PndCAResizableArray< T, Dim, alignment >::Resize(), and PndCAResizableArray< T, Dim, alignment >::~PndCAResizableArray().

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: