CMS 3D CMS Logo

Public Member Functions | Static Public Member Functions | Static Public Attributes | Static Private Attributes

BlockWipedPoolAllocated Class Reference

#include <BlockWipedAllocator.h>

Inheritance diagram for BlockWipedPoolAllocated:
ReferenceCountedPoolAllocated BasicTrajectoryState reco::BasicGhostTrackState reco::BasicTransientTrack TransientTrackingRecHit BasicMultiTrajectoryState BasicSingleTrajectoryState reco::TrackGhostTrackState reco::VertexGhostTrackState reco::GsfTransientTrack reco::TrackTransientTrack reco::TransientTrackFromFTS BeamSpotTransientTrackingRecHit GenericProjectedRecHit2D GenericTransientTrackingRecHit TransientTrackingRecHitByValue< RecHit > TransientTrackingRecHitByValue< InvalidTrackingRecHit > TRecHit1DMomConstraint TRecHit2DPosConstraint TSiPixelRecHit TSiStripRecHit1D TSiStripRecHit2DLocalPos TSiTrackerMultiRecHit

List of all members.

Public Member Functions

virtual ~BlockWipedPoolAllocated ()

Static Public Member Functions

static BlockWipedAllocatorallocator (size_t s)
static void operator delete (void *p, size_t s)
static void * operator new (size_t s)
static void * operator new (size_t s, void *p)
static BlockWipedAllocator::Stat stat (size_t s)
static void usePool ()

Static Public Attributes

static int s_alive = 0

Static Private Attributes

static bool s_usePool = false

Detailed Description

Definition at line 151 of file BlockWipedAllocator.h.


Constructor & Destructor Documentation

virtual BlockWipedPoolAllocated::~BlockWipedPoolAllocated ( ) [inline, virtual]

Definition at line 153 of file BlockWipedAllocator.h.

{}

Member Function Documentation

BlockWipedAllocator & BlockWipedPoolAllocated::allocator ( size_t  s) [static]

Definition at line 140 of file BlockWipedAllocator.cc.

References BlockWipedPool::allocator(), and blockWipedPool().

Referenced by operator delete(), operator new(), and stat().

                                                                 {
  return  blockWipedPool().allocator(s);
}
void BlockWipedPoolAllocated::operator delete ( void *  p,
size_t  s 
) [static]

Definition at line 132 of file BlockWipedAllocator.cc.

References allocator(), BlockWipedAllocator::dealloc(), cmsCodeRules::cppFunctionSkipper::operator, L1TEmulatorMonitor_cff::p, s_alive, and s_usePool.

                                                                {
  if (0==p) return;
  // if (s<100) std::cout << typeid(*(BlockWipedPoolAllocated*)(p)).name() << std::endl;
  s_alive--;
  (s_usePool) ? allocator(s).dealloc(p) : ::operator delete(p);

}
void * BlockWipedPoolAllocated::operator new ( size_t  s) [static]
static void * BlockWipedPoolAllocated::operator new ( size_t  s,
void *  p 
) [static]

Definition at line 123 of file BlockWipedAllocator.cc.

References L1TEmulatorMonitor_cff::p.

                                                                       {
  return p;
}
BlockWipedAllocator::Stat BlockWipedPoolAllocated::stat ( size_t  s) [static]

Definition at line 145 of file BlockWipedAllocator.cc.

References allocator(), and BlockWipedAllocator::stat().

                                                              {
  return allocator(s).stat();
}
void BlockWipedPoolAllocated::usePool ( ) [static]

Definition at line 111 of file BlockWipedAllocator.cc.

References s_alive, and s_usePool.

Referenced by BlockWipedAllocatorService::BlockWipedAllocatorService().

                                      { 
  // throw id s_alive!=0???
  if (0==s_alive) s_usePool=true;
}

Member Data Documentation

bool BlockWipedPoolAllocated::s_usePool = false [static, private]

Definition at line 171 of file BlockWipedAllocator.h.

Referenced by operator delete(), operator new(), and usePool().