Import Geant4 11.3.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2024-06-28 13:08:51 +02:00
parent f7b23877ed
commit e58e650b32
5232 changed files with 239416 additions and 244360 deletions
+23
View File
@@ -36,6 +36,9 @@
class G4Event;
#include "globals.hh"
#include "evtdefs.hh"
#include "G4Allocator.hh"
#include "G4StackedTrack.hh"
#include "G4Types.hh"
@@ -49,6 +52,10 @@ class G4SubEvent : public std::vector<G4StackedTrack>
~G4SubEvent();
G4SubEvent& operator=(const G4SubEvent&) = delete;
inline void *operator new(std::size_t);
inline void operator delete(void* anEvent);
G4bool operator==(const G4SubEvent&) const = delete;
G4bool operator!=(const G4SubEvent&) const = delete;
@@ -76,4 +83,20 @@ class G4SubEvent : public std::vector<G4StackedTrack>
};
extern G4EVENT_DLL G4Allocator<G4SubEvent>*& aSubEventAllocator();
inline void* G4SubEvent::operator new(std::size_t)
{
if (aSubEventAllocator() == nullptr)
{
aSubEventAllocator() = new G4Allocator<G4SubEvent>;
}
return (void*)aSubEventAllocator()->MallocSingle();
}
inline void G4SubEvent::operator delete(void* aSubEvent)
{
aSubEventAllocator()->FreeSingle((G4SubEvent*)aSubEvent);
}
#endif