Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4UniformRandPool.cc File Reference
#include "G4UniformRandPool.hh"
#include "G4AutoDelete.hh"
#include "G4Threading.hh"
#include "globals.hh"
#include <algorithm>
#include <climits>
#include <cstring>
#include <stdlib.h>

Go to the source code of this file.

Functions

void create_pool (G4double *&buffer, G4int ps)
 
void destroy_pool (G4double *&buffer)
 
void create_pool_align (G4double *&buffer, G4int ps)
 
void destroy_pool_align (G4double *&buffer)
 

Function Documentation

◆ create_pool()

void create_pool ( G4double *&  buffer,
G4int  ps 
)

Definition at line 45 of file G4UniformRandPool.cc.

45{ buffer = new G4double[ps]; }
double G4double
Definition: G4Types.hh:83
#define buffer
Definition: xmlparse.cc:628

Referenced by G4UniformRandPool::G4UniformRandPool(), and G4UniformRandPool::Resize().

◆ create_pool_align()

void create_pool_align ( G4double *&  buffer,
G4int  ps 
)

Definition at line 59 of file G4UniformRandPool.cc.

60{
61 // POSIX standard way
62 G4int errcode = posix_memalign((void**) &buffer, sizeof(G4double) * CHAR_BIT,
63 ps * sizeof(G4double));
64 if(errcode != 0)
65 {
66 G4Exception("G4UniformRandPool::create_pool_align()", "InvalidCondition",
67 FatalException, "Cannot allocate aligned buffer");
68 return;
69 }
70 return;
71}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
int G4int
Definition: G4Types.hh:85

Referenced by G4UniformRandPool::G4UniformRandPool().

◆ destroy_pool()

void destroy_pool ( G4double *&  buffer)

Definition at line 47 of file G4UniformRandPool.cc.

47{ delete[] buffer; }

Referenced by G4UniformRandPool::Resize(), and G4UniformRandPool::~G4UniformRandPool().

◆ destroy_pool_align()

void destroy_pool_align ( G4double *&  buffer)

Definition at line 73 of file G4UniformRandPool.cc.

Referenced by G4UniformRandPool::~G4UniformRandPool().