8#ifndef INCLUDED_BDLMA_CONCURRENTFIXEDPOOL
9#define INCLUDED_BDLMA_CONCURRENTFIXEDPOOL
177#include <bsl_vector.h>
178#include <bsl_cstdlib.h>
217 const unsigned d_sizeMask;
225 const int d_dataOffset;
228 const int d_nodeSize;
238 const int d_objectSize;
303 template <
class TYPE>
395void *
operator new(bsl::size_t size,
396 BloombergLP::bdlma::ConcurrentFixedPool& pool);
405void operator delete(
void *address,
406 BloombergLP::bdlma::ConcurrentFixedPool& pool);
444 Node * node =
const_cast<Node *
>(d_nodes[index]);
447 return (
char *)node + d_dataOffset;
453 return d_backoffLevel;
459 const Node *
const node = (
const Node *)(
void *)
460 ((
char *)address - d_dataOffset);
461 return (node->
d_next & d_sizeMask) - 1;
473 return static_cast<int>(d_nodes.
size());
488void *
operator new(bsl::size_t size,
489 BloombergLP::bdlma::ConcurrentFixedPool& pool)
491 using namespace BloombergLP;
497 return pool.allocate();
501void operator delete(
void *address,
502 BloombergLP::bdlma::ConcurrentFixedPool& pool)
504 pool.deallocate(address);
Definition bdlma_concurrentfixedpool.h:209
void * addressFromIndex(int index) const
Definition bdlma_concurrentfixedpool.h:442
int reserveCapacity(int numObjects)
bslma::Allocator * allocator() const
Definition bdlma_concurrentfixedpool.h:479
int objectSize() const
Definition bdlma_concurrentfixedpool.h:465
int backoffLevel() const
Definition bdlma_concurrentfixedpool.h:451
int indexFromAddress(void *address) const
Definition bdlma_concurrentfixedpool.h:457
void deleteObject(const TYPE *object)
Definition bdlma_concurrentfixedpool.h:422
int poolSize() const
Return the maximum size of this pool.
Definition bdlma_concurrentfixedpool.h:471
void setBackoffLevel(int backoffLevel)
Definition bdlma_concurrentfixedpool.h:435
~ConcurrentFixedPool()
Destroy this object and release all associated memory.
void deallocate(void *address)
void deleteObjectRaw(const TYPE *object)
Definition bdlma_concurrentfixedpool.h:429
ConcurrentFixedPool(int objectSize, int poolSize, bslma::Allocator *basicAllocator=0)
Definition bdlma_pool.h:335
bslma::Allocator * allocator() const
Definition bdlma_pool.h:621
size_type size() const BSLS_KEYWORD_NOEXCEPT
Return the number of elements in this vector.
Definition bslstl_vector.h:2664
Definition bslstl_vector.h:1025
Definition bslma_allocator.h:457
Definition bslmt_mutex.h:315
Definition bsls_atomic.h:743
#define BSLS_ASSERT(X)
Definition bsls_assert.h:1804
Definition bdlma_alignedallocator.h:276
Definition bdlma_concurrentfixedpool.h:189
unsigned d_next
Definition bdlma_concurrentfixedpool.h:192
static void deleteObject(const TYPE *object, ALLOCATOR *allocator)
Definition bslma_deleterhelper.h:196
static void deleteObjectRaw(const TYPE *object, ALLOCATOR *allocator)
Definition bslma_deleterhelper.h:217
static int calculateAlignmentFromSize(std::size_t size)
Definition bsls_alignmentutil.h:344