Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4UniformRandPool.cc File Reference
#include "G4UniformRandPool.hh"
#include "globals.hh"
#include <climits>
#include <stdlib.h>
#include <algorithm>
#include <cstring>
#include "G4Threading.hh"
#include "G4AutoDelete.hh"
Include dependency graph for G4UniformRandPool.cc:

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

void create_pool ( G4double *&  buffer,
G4int  ps 
)

Definition at line 41 of file G4UniformRandPool.cc.

42 {
43  buffer = new G4double[ps];
44 }
#define buffer
Definition: xmlparse.cc:628
double G4double
Definition: G4Types.hh:76
static constexpr double ps
Definition: G4SIunits.hh:172

Here is the caller graph for this function:

void create_pool_align ( G4double *&  buffer,
G4int  ps 
)

Definition at line 68 of file G4UniformRandPool.cc.

69 {
70 //#if defined(__ICC) || (__INTEL_COMPILER)
71 // //INTEL optimized way
72 // buffer = (G4doulbe*)mm_allign(ps*sizeof(G4double),sizeof(G4double)*CHAR_BIT);
73 //#else
74 
75  // POSIX standard way
76  G4int errcode = posix_memalign( (void**) &buffer ,
77  sizeof(G4double)*CHAR_BIT,
78  ps*sizeof(G4double));
79  if ( errcode != 0 )
80  {
81  G4Exception("G4UniformRandPool::create_pool_align()",
82  "InvalidCondition", FatalException,
83  "Cannot allocate aligned buffer");
84  return;
85  }
86 //#endif
87 
88  return;
89 }
#define buffer
Definition: xmlparse.cc:628
int G4int
Definition: G4Types.hh:78
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
double G4double
Definition: G4Types.hh:76
static constexpr double ps
Definition: G4SIunits.hh:172

Here is the call graph for this function:

Here is the caller graph for this function:

void destroy_pool ( G4double *&  buffer)

Definition at line 46 of file G4UniformRandPool.cc.

47 {
48  delete[] buffer;
49 }
#define buffer
Definition: xmlparse.cc:628

Here is the caller graph for this function:

void destroy_pool_align ( G4double *&  buffer)

Definition at line 91 of file G4UniformRandPool.cc.

92 {
93  //#if defined(__ICC) || (__INTEL_COMPILER)
94  //mm_free(buffer);
95  //#else
96 
97  free(buffer);
98 
99  //#endif
100 }
#define buffer
Definition: xmlparse.cc:628

Here is the caller graph for this function: