8#ifndef INCLUDED_BDLMA_CONCURRENTFIXEDPOOL
9#define INCLUDED_BDLMA_CONCURRENTFIXEDPOOL
177#include <bsl_vector.h>
178#include <bsl_cstdlib.h>
219 const unsigned d_sizeMask;
227 const int d_dataOffset;
230 const int d_nodeSize;
240 const int d_objectSize;
310 template <
class TYPE>
413void *
operator new(bsl::size_t size,
414 BloombergLP::bdlma::ConcurrentFixedPool& pool);
424void operator delete(
void *address,
425 BloombergLP::bdlma::ConcurrentFixedPool& pool);
463 Node * node =
const_cast<Node *
>(d_nodes[index]);
466 return (
char *)node + d_dataOffset;
472 return d_backoffLevel;
478 const Node *
const node = (
const Node *)(
void *)
479 ((
char *)address - d_dataOffset);
480 return (node->
d_next & d_sizeMask) - 1;
492 return static_cast<int>(d_nodes.
size());
507void *
operator new(bsl::size_t size,
508 BloombergLP::bdlma::ConcurrentFixedPool& pool)
510 using namespace BloombergLP;
516 return pool.allocate();
520void operator delete(
void *address,
521 BloombergLP::bdlma::ConcurrentFixedPool& pool)
523 pool.deallocate(address);
Definition bdlma_concurrentfixedpool.h:211
void * addressFromIndex(int index) const
Definition bdlma_concurrentfixedpool.h:461
int reserveCapacity(int numObjects)
bslma::Allocator * allocator() const
Definition bdlma_concurrentfixedpool.h:498
int objectSize() const
Definition bdlma_concurrentfixedpool.h:484
int backoffLevel() const
Definition bdlma_concurrentfixedpool.h:470
int indexFromAddress(void *address) const
Definition bdlma_concurrentfixedpool.h:476
void deleteObject(const TYPE *object)
Definition bdlma_concurrentfixedpool.h:441
int poolSize() const
Return the maximum size of this pool.
Definition bdlma_concurrentfixedpool.h:490
void setBackoffLevel(int backoffLevel)
Definition bdlma_concurrentfixedpool.h:454
~ConcurrentFixedPool()
Destroy this object and release all associated memory.
void deallocate(void *address)
void deleteObjectRaw(const TYPE *object)
Definition bdlma_concurrentfixedpool.h:448
ConcurrentFixedPool(int objectSize, int poolSize, bslma::Allocator *basicAllocator=0)
Definition bdlma_pool.h:338
bslma::Allocator * allocator() const
Definition bdlma_pool.h:639
size_type size() const BSLS_KEYWORD_NOEXCEPT
Return the number of elements in this vector.
Definition bslstl_vector.h:3019
Definition bslstl_vector.h:1120
Definition bslma_allocator.h:545
Definition bslmt_mutex.h:317
Definition bsls_atomic.h:744
#define BSLS_ASSERT(X)
Definition bsls_assert.h:1976
Definition bdlma_alignedallocator.h:278
Definition bdlma_concurrentfixedpool.h:191
unsigned d_next
Definition bdlma_concurrentfixedpool.h:194
static void deleteObject(const TYPE *object, ALLOCATOR *allocator)
Definition bslma_deleterhelper.h:204
static void deleteObjectRaw(const TYPE *object, ALLOCATOR *allocator)
Definition bslma_deleterhelper.h:225
static int calculateAlignmentFromSize(std::size_t size)
Definition bsls_alignmentutil.h:398