Import Geant4 10.5.0.beta source tree
This commit is contained in:
@@ -299,24 +299,24 @@ private:
|
||||
};
|
||||
|
||||
#if defined G4EM_ALLOC_EXPORT
|
||||
extern G4DLLEXPORT G4ThreadLocal G4Allocator<G4Molecule> *aMoleculeAllocator;
|
||||
extern G4DLLEXPORT G4Allocator<G4Molecule>*& aMoleculeAllocator();
|
||||
#else
|
||||
extern G4DLLIMPORT G4ThreadLocal G4Allocator<G4Molecule> *aMoleculeAllocator;
|
||||
extern G4DLLIMPORT G4Allocator<G4Molecule>*& aMoleculeAllocator();
|
||||
#endif
|
||||
|
||||
//////////////////////////
|
||||
inline void * G4Molecule::operator new(size_t)
|
||||
//////////////////////////
|
||||
{
|
||||
if (!aMoleculeAllocator) aMoleculeAllocator = new G4Allocator<G4Molecule>;
|
||||
return (void *) aMoleculeAllocator->MallocSingle();
|
||||
if (!aMoleculeAllocator()) aMoleculeAllocator() = new G4Allocator<G4Molecule>;
|
||||
return (void *) aMoleculeAllocator()->MallocSingle();
|
||||
}
|
||||
|
||||
//////////////////////////
|
||||
inline void G4Molecule::operator delete(void * aMolecule)
|
||||
//////////////////////////
|
||||
{
|
||||
aMoleculeAllocator->FreeSingle((G4Molecule *) aMolecule);
|
||||
aMoleculeAllocator()->FreeSingle((G4Molecule *) aMolecule);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4Molecule.cc 103042 2017-03-10 11:50:07Z gcosmo $
|
||||
// $Id: G4Molecule.cc 110873 2018-06-22 13:11:22Z gcosmo $
|
||||
//
|
||||
// ---------------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
@@ -62,7 +62,11 @@ using namespace std;
|
||||
|
||||
ITImp(G4Molecule)
|
||||
|
||||
G4ThreadLocal G4Allocator<G4Molecule> *aMoleculeAllocator = 0;
|
||||
G4Allocator<G4Molecule>*& aMoleculeAllocator()
|
||||
{
|
||||
G4ThreadLocalStatic G4Allocator<G4Molecule>* _instance = nullptr;
|
||||
return _instance;
|
||||
}
|
||||
|
||||
//______________________________________________________________________________
|
||||
|
||||
|
||||
Reference in New Issue
Block a user