ATLAS Offline Software
Static Public Member Functions | Private Member Functions | Static Private Member Functions | Static Private Attributes | List of all members
LWPools Class Reference

#include <LWPools.h>

Collaboration diagram for LWPools:

Static Public Member Functions

static char * acquire (unsigned length)
 
static void release (char *, unsigned length)
 
static void cleanup ()
 
template<unsigned length>
static char * acquire ()
 
template<unsigned length>
static void release (char *c)
 
template<class T , unsigned length>
static T * acquire ()
 
template<class T , unsigned length>
static void release (T *)
 
template<class T >
static T * acquire (unsigned length)
 
template<class T >
static void release (T *, unsigned length)
 
template<class T >
static void deleteObject (T *)
 
static long long getTotalPoolMemAllocated ()
 
static long long getTotalPoolMemUsed ()
 

Private Member Functions

 LWPools ()
 
 ~LWPools ()
 
 LWPools (const LWPools &)
 
LWPoolsoperator= (const LWPools &)
 

Static Private Member Functions

static LWPoolinitPool (unsigned poolIndex, unsigned length)
 
static LWPoolgetPool (unsigned length)
 

Static Private Attributes

static PoolList s_pools ATLAS_THREAD_SAFE
 
static std::atomic< long long > s_bytesDynAlloc = 0
 

Detailed Description

Definition at line 29 of file LWPools.h.

Constructor & Destructor Documentation

◆ LWPools() [1/2]

LWPools::LWPools ( )
private

◆ ~LWPools()

LWPools::~LWPools ( )
private

◆ LWPools() [2/2]

LWPools::LWPools ( const LWPools )
private

Member Function Documentation

◆ acquire() [1/4]

template<unsigned length>
static char* LWPools::acquire ( )
inlinestatic

Definition at line 40 of file LWPools.h.

40 { return acquire(length); }

◆ acquire() [2/4]

template<class T , unsigned length>
static T* LWPools::acquire ( )
static

◆ acquire() [3/4]

static char* LWPools::acquire ( unsigned  length)
static

◆ acquire() [4/4]

template<class T >
static T* LWPools::acquire ( unsigned  length)
static

◆ cleanup()

void LWPools::cleanup ( )
static

Definition at line 71 of file LWPools.cxx.

72 {
73  s_pools.cleanup();
74  //Fixme: something here to flush mother pool also
75 }

◆ deleteObject()

template<class T >
static void LWPools::deleteObject ( T *  )
static

◆ getPool()

static LWPool* LWPools::getPool ( unsigned  length)
staticprivate

◆ getTotalPoolMemAllocated()

long long LWPools::getTotalPoolMemAllocated ( )
static

Definition at line 78 of file LWPools.cxx.

79 {
81 }

◆ getTotalPoolMemUsed()

long long LWPools::getTotalPoolMemUsed ( )
static

Definition at line 84 of file LWPools.cxx.

85 {
86  long long l(s_bytesDynAlloc);
87  for (unsigned i=0;i<LWPoolSelector::nPools();++i) {
88  LWPool* p = s_pools[i];
89  if (p) l+=p->getMemDishedOut();
90  }
91  return l;
92 }

◆ initPool()

LWPool * LWPools::initPool ( unsigned  poolIndex,
unsigned  length 
)
staticprivate

Definition at line 54 of file LWPools.cxx.

55 {
59  s_bytesDynAlloc += sizeof(LWPool);
60  LWPool* exp = nullptr;
61  s_pools[idx].compare_exchange_strong (exp, pool);
62  if (exp) {
63  s_bytesDynAlloc -= sizeof(LWPool);
64  delete pool;
65  pool = exp;
66  }
67  return pool;
68 }

◆ operator=()

LWPools& LWPools::operator= ( const LWPools )
private

◆ release() [1/4]

static void LWPools::release ( char *  ,
unsigned  length 
)
static

◆ release() [2/4]

template<unsigned length>
static void LWPools::release ( char *  c)
inlinestatic

Definition at line 41 of file LWPools.h.

41 { return release(c,length); }

◆ release() [3/4]

template<class T , unsigned length>
static void LWPools::release ( T *  )
static

◆ release() [4/4]

template<class T >
static void LWPools::release ( T *  ,
unsigned  length 
)
static

Member Data Documentation

◆ ATLAS_THREAD_SAFE

PoolList s_pools LWPools::ATLAS_THREAD_SAFE
staticprivate

Definition at line 59 of file LWPools.h.

◆ s_bytesDynAlloc

std::atomic< long long > LWPools::s_bytesDynAlloc = 0
staticprivate

Definition at line 60 of file LWPools.h.


The documentation for this class was generated from the following files:
LWPoolSelector::nPools
static unsigned nPools()
Definition: LWPoolSelector.h:31
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
LWPoolSelector::numberOfPools
static const unsigned numberOfPools
Definition: LWPoolSelector.h:30
pool
pool namespace
Definition: libname.h:15
UploadAMITag.l
list l
Definition: UploadAMITag.larcaf.py:158
LWPools::release
static void release(char *, unsigned length)
drawFromPickle.exp
exp
Definition: drawFromPickle.py:36
lumiFormat.i
int i
Definition: lumiFormat.py:92
LWPools::acquire
static char * acquire()
Definition: LWPools.h:40
LWPoolSelector::poolSize
static unsigned poolSize(unsigned requestsize)
Definition: LWPoolSelector.h:53
LWPools::s_bytesDynAlloc
static std::atomic< long long > s_bytesDynAlloc
Definition: LWPools.h:60
LArNewCalib_DelayDump_OFC_Cali.idx
idx
Definition: LArNewCalib_DelayDump_OFC_Cali.py:69
LWPool
Definition: LWPool.h:24
LWPoolSelector::poolIndex
static unsigned poolIndex(unsigned requestsize)
Definition: LWPoolSelector.h:73
python.compressB64.c
def c
Definition: compressB64.py:93
length
double length(const pvec &v)
Definition: FPGATrackSimLLPDoubletHoughTransformTool.cxx:26
LWPool::getMotherMemOwned
static long long getMotherMemOwned()
Definition: LWPool.cxx:83