1 #ifndef BlockWipedAllocator_H
2 #define BlockWipedAllocator_H
7 #include <ext/hash_map>
12 #include<boost/bind.hpp>
26 std::size_t blockSize,
27 std::size_t maxRecycle
48 void wipe(
bool force=
true)
const;
54 virtual void reset()=0;
115 typedef __gnu_cxx::hash_map<std::size_t, Allocator>
Pool;
122 void wipe(
bool force=
true);
126 template<
typename Visitor>
127 void visit(Visitor& visitor)
const {
152 static void *
operator new(
size_t s,
void *
p);
153 static void *
operator new(
size_t s);
155 static void operator delete(
void *
p,
size_t s);
185 blockWipedAllocator<sizeof(T)>().registerCache(
this);
198 static void *
operator new(size_t) {
202 static void operator delete(
void *
p) {
206 static void *
operator new(size_t,
void *
p) {
221 #ifdef __GXX_EXPERIMENTAL_CXX0X__
222 template<
typename...
Args>
225 { ::new(p)
T(std::forward<
Args>(
args)...); }
248 #ifdef __GXX_EXPERIMENTAL_CXX0X__
252 void operator () (
B* p) {
266 typedef BWADestroy<B> Destroy;
267 typedef std::unique_ptr<B, BWAFactory<B>::Destroy>
UP;
268 template<
typename T,
typename...
Args>
288 static void *
operator new(size_t) {
292 static void operator delete(
void *
p) {
312 #endif // BlockAllocator_H
std::vector< void * > recycled
static void destroy(T *p)
std::vector< LocalCache * > localCaches
__gnu_cxx::hash_map< std::size_t, Allocator > Pool
Allocator & allocator(std::size_t typeSize)
static BlockWipedAllocator & allocator()
Blocks::iterator iterator
static BlockWipedAllocator & allocator(size_t s)
static void dealloc(void *p)
std::vector< unsigned char > m_data
BlockWipedPool & blockWipedPool(BlockWipedPool *p=0)
def visit
Retrieve data from a perf suite output (sub) directory, only examines TimeSize at the moment...
virtual ~BlockWipedPoolAllocated()
BlockWipedAllocator & blockWipedAllocator()
U second(std::pair< T, U > const &p)
BlockWipedAllocator & operator=(BlockWipedAllocator const &rh)
BlockWipedAllocator Allocator
BlockWipedPool(std::size_t blockSize, std::size_t maxRecycle)
static BlockWipedAllocator::Stat stat(size_t s)
void nextBlock(bool advance) dso_internal
void registerCache(LocalCache *c)
BlockWipedAllocator & me() const
void visit(Visitor &visitor) const
static BlockWipedAllocator & allocator()
void wipe(bool force=true)
Blocks::const_iterator const_iterator
static BlockWipedAllocator::Stat stat()
void wipe(bool force=true) const
std::list< Block > Blocks
std::ptrdiff_t totalAvailable
BlockWipedAllocator(std::size_t typeSize, std::size_t blockSize, std::size_t maxRecycle)
static BlockWipedAllocator::Stat stat()