ROSE
0.11.145.147
src
Sawyer
SmallObject.h
1
// WARNING: Changes to this file must be contributed back to Sawyer or else they will
2
// be clobbered by the next update from Sawyer. The Sawyer repository is at
3
// https://gitlab.com/charger7534/sawyer.git.
4
5
6
7
8
#ifndef Sawyer_SmallObject_H
9
#define Sawyer_SmallObject_H
10
11
#include <Sawyer/PoolAllocator.h>
12
#include <Sawyer/Sawyer.h>
13
14
namespace
Sawyer
{
15
19
class
SAWYER_EXPORT
SmallObject
{
20
#include <Sawyer/WarningsOff.h>
21
static
SynchronizedPoolAllocator
allocator_;
22
#include <Sawyer/WarningsRestore.h>
23
public
:
25
static
SynchronizedPoolAllocator
&
poolAllocator
() {
return
allocator_; }
26
27
static
void
*
operator
new
(
size_t
size) {
return
allocator_.
allocate
(size); }
28
static
void
operator
delete
(
void
*ptr,
size_t
size) { allocator_.deallocate(ptr, size); }
29
};
30
31
}
// namespace
32
#endif
Sawyer::PoolAllocatorBase
Small object allocation from memory pools.
Definition
PoolAllocator.h:60
Sawyer::PoolAllocatorBase::allocate
void * allocate(size_t size)
Allocate one object of specified size.
Definition
PoolAllocator.h:422
Sawyer::SmallObject
Small object support.
Definition
SmallObject.h:19
Sawyer::SmallObject::poolAllocator
static SynchronizedPoolAllocator & poolAllocator()
Return the pool allocator for this class.
Definition
SmallObject.h:25
Sawyer
Sawyer support library.
Definition
FeasiblePath.h:767
Generated on Mon Sep 30 2024 03:25:38 for ROSE by
1.9.8