BDE 4.39.x Production Release
Loading...
Searching...
No Matches
bdlma_pool.h
Go to the documentation of this file.
1/// @file bdlma_pool.h
2///
3/// The content of this file has been pre-processed for Doxygen.
4///
5
6
7// bdlma_pool.h -*-C++-*-
8#ifndef INCLUDED_BDLMA_POOL
9#define INCLUDED_BDLMA_POOL
10
11#include <bsls_ident.h>
12BSLS_IDENT("$Id: $")
13
14/// @defgroup bdlma_pool bdlma_pool
15/// @brief Provide efficient allocation of memory blocks of uniform size.
16/// @addtogroup bdl
17/// @{
18/// @addtogroup bdlma
19/// @{
20/// @addtogroup bdlma_pool
21/// @{
22///
23/// <h1> Outline </h1>
24/// * <a href="#bdlma_pool-purpose"> Purpose</a>
25/// * <a href="#bdlma_pool-classes"> Classes </a>
26/// * <a href="#bdlma_pool-description"> Description </a>
27/// * <a href="#bdlma_pool-configuration-at-construction"> Configuration at Construction </a>
28/// * <a href="#bdlma_pool-overloaded-global-operator-new"> Overloaded Global Operator new </a>
29/// * <a href="#bdlma_pool-usage"> Usage </a>
30/// * <a href="#bdlma_pool-example-1-using-a-bdlma-pool-for-efficient-memory-allocation"> Example 1: Using a bdlma::Pool for Efficient Memory Allocation </a>
31///
32/// # Purpose {#bdlma_pool-purpose}
33/// Provide efficient allocation of memory blocks of uniform size.
34///
35/// # Classes {#bdlma_pool-classes}
36///
37/// - bdlma::Pool: memory manager that allocates memory blocks of uniform size
38///
39/// # Description {#bdlma_pool-description}
40/// This component implements a memory pool, `bdlma::Pool`, that
41/// allocates and manages maximally-aligned memory blocks of some uniform size
42/// specified at construction. A `bdlma::Pool` object maintains an internal
43/// linked list of free memory blocks, and dispenses one block for each
44/// `allocate` method invocation. When a memory block is deallocated, it is
45/// returned to the free list for potential reuse.
46///
47/// Whenever the linked list of free memory blocks is depleted, the
48/// `bdlma::Pool` replenishes the list by first allocating a large, contiguous
49/// "chunk" of memory, then splitting the chunk into multiple memory blocks. A
50/// chunk and its constituent memory blocks can be depicted visually:
51/// @code
52/// +-----+--- memory blocks of uniform size
53/// | |
54/// ----- ----- ------------
55/// | | | ... |
56/// =====^=====^============
57///
58/// \___________ __________/
59/// V
60/// a "chunk"
61/// @endcode
62/// Note that the size of the allocated chunk is determined by both the growth
63/// strategy and maximum blocks per chunk, either of which can be optionally
64/// specified at construction (see the "Configuration at Construction" section).
65///
66/// ## Configuration at Construction {#bdlma_pool-configuration-at-construction}
67///
68///
69/// When creating a `bdlma::Pool`, clients must specify the specific block size
70/// managed and dispensed by the pool. Furthermore, clients can optionally
71/// configure:
72///
73/// 1. GROWTH STRATEGY -- geometrically growing chunk size starting from 1 (in
74/// terms of the number of memory blocks per chunk), or fixed chunk size. If
75/// the growth strategy is not specified, geometric growth is used.
76/// 2. MAX BLOCKS PER CHUNK -- the maximum number of memory blocks within a
77/// chunk. If the maximum blocks per chunk is not specified, an
78/// implementation-defined default value is used.
79/// 3. BASIC ALLOCATOR -- the allocator used to supply memory to replenish the
80/// internal pool. If not specified, the currently installed default
81/// allocator is used (see @ref bslma_default ).
82///
83/// For example, if geometric growth is used and the maximum blocks per chunk is
84/// specified as 30, the chunk size grows geometrically, starting from 1, until
85/// the specified maximum blocks per chunk, as follows:
86/// @code
87/// 1, 2, 4, 8, 16, 30, 30, 30 ...
88/// @endcode
89/// If constant growth is used, the chunk size is always the specified maximum
90/// blocks per chunk (or an implementation-defined value if the maximum blocks
91/// per chunk is not specified), for example:
92/// @code
93/// 30, 30, 30 ...
94/// @endcode
95/// A default-constructed pool has an initial chunk size of 1 (i.e., the number
96/// of memory blocks of a given size allocated at once to replenish a pool's
97/// memory), and the pool's chunk size grows geometrically until it reaches an
98/// implementation-defined maximum, at which it is capped. Finally, unless
99/// otherwise specified, all memory comes from the allocator that was the
100/// currently installed default allocator at the time the `bdlma::Pool` was
101/// created.
102///
103/// ## Overloaded Global Operator new {#bdlma_pool-overloaded-global-operator-new}
104///
105///
106/// This component overloads the global `operator new` to allow convenient
107/// syntax for the construction of objects using a `bdlma::Pool`. The `new`
108/// operator supplied in this component takes a `bdlma::Pool` argument
109/// indicating the source of the memory. Consider the following use of standard
110/// placement `new` syntax (supplied by `bsl_new.h`) along with a `bdlma::Pool`
111/// to allocate an object of type `T`. Note that the size of `T` must be the
112/// same or smaller than the `blockSize` with which the pool is constructed:
113/// @code
114/// void f(bdlma::Pool *pool)
115/// {
116/// assert(pool->blockSize() >= sizeof(T));
117///
118/// T *t = new (pool->allocate()) T(...);
119///
120/// // ...
121/// }
122/// @endcode
123/// This usage style is not exception-safe. If the constructor of `T` throws an
124/// exception, `pool->deallocate` is never called.
125///
126/// Supplying an overloaded global `operator new`:
127/// @code
128/// ::operator new(bsl::size_t size, BloombergLP::bdlma::Pool& pool);
129/// @endcode
130/// allows for the following cleaner usage, which does not require the size
131/// calculation and guarantees that `pool->deallocate` *is* called in the case
132/// of an exception:
133/// @code
134/// void f(bdlma::Pool *pool)
135/// {
136/// assert(pool->blockSize() >= sizeof(T));
137///
138/// T *t = new (*pool) T(...);
139///
140/// // ...
141/// @endcode
142/// Also note that the analogous version of operator `delete` should *not* be
143/// called directly. Instead, this component provides a static template member
144/// function `deleteObject`, parameterized on `TYPE`:
145/// @code
146/// pool->deleteObject(t);
147/// }
148/// @endcode
149/// The above `deleteObject` call is equivalent to performing the following:
150/// @code
151/// t->~TYPE();
152/// pool->deallocate(t);
153/// @endcode
154/// An overloaded operator `delete` is supplied solely to allow the compiler to
155/// arrange for it to be called in case of an exception.
156///
157/// ## Usage {#bdlma_pool-usage}
158///
159///
160/// This section illustrates intended use of this component.
161///
162/// ### Example 1: Using a bdlma::Pool for Efficient Memory Allocation {#bdlma_pool-example-1-using-a-bdlma-pool-for-efficient-memory-allocation}
163///
164///
165/// A `bdlma::Pool` can be used by node-based containers (such as lists, trees,
166/// and hash tables that hold multiple elements of uniform size) for efficient
167/// memory allocation of new elements. The following container template class,
168/// `my_PooledArray`, stores values of (template parameter) `TYPE`
169/// "out-of-place" as nodes in a `vector` of pointers. Since the size of each
170/// node is fixed and known *a priori*, the class uses a `bdlma::Pool` to
171/// allocate memory for the nodes to improve memory allocation efficiency. Note
172/// that for simplicity, we assume that `TYPE` does not require an allocator,
173/// and that calls to the destructor of `TYPE` can be elided.
174///
175/// First, we define the interface of our `my_PooledArray` template class:
176/// @code
177/// // my_poolarray.h
178///
179/// /// This class implements a container that stores values of (template
180/// /// parameter) `TYPE` out-of-place. It is assumed that `TYPE` does not
181/// /// require an allocator, and that calls to the destructor of `TYPE` can
182/// /// be elided.
183/// template <class TYPE>
184/// class my_PooledArray {
185///
186/// // DATA
187/// bsl::vector<TYPE *> d_array_p; // array of pooled elements
188/// bdlma::Pool d_pool; // memory manager for array elements
189///
190/// private:
191/// // Not implemented:
192/// my_PooledArray(const my_PooledArray&);
193///
194/// public:
195/// // CREATORS
196///
197/// /// Create a pooled array that stores the `TYPE` element values
198/// /// "out-of-place". Optionally specify a `basicAllocator` used to
199/// /// supply memory. If `basicAllocator` is 0, the currently
200/// /// installed default allocator is used.
201/// explicit my_PooledArray(bslma::Allocator *basicAllocator = 0);
202///
203/// /// Destroy this array and all elements held by it.
204/// ~my_PooledArray();
205///
206/// // MANIPULATORS
207///
208/// /// Append the specified `value` to this array.
209/// void append(const TYPE& value);
210///
211/// /// Remove all elements from this array.
212/// void removeAll();
213///
214/// // ACCESSORS
215///
216/// /// Return the number of elements in this array.
217/// bsl::size_t length() const;
218///
219/// /// Return a reference providing non-modifiable access to the value
220/// /// at the specified `index` in this array. The behavior is
221/// /// undefined unless `0 <= index < length()`.
222/// const TYPE& operator[](int index) const;
223/// };
224/// @endcode
225/// Next, we provide the implementation of the `my_PooledArray` methods that are
226/// defined `inline`.
227///
228/// Note that in the `removeAll` method, all elements are deallocated by simply
229/// invoking the pool's `release` method. This technique implies significant
230/// performance gain when the array contains many elements:
231/// @code
232/// // MANIPULATORS
233/// template <class TYPE>
234/// inline
235/// void my_PooledArray<TYPE>::removeAll()
236/// {
237/// d_array_p.clear();
238/// d_pool.release();
239/// }
240///
241/// // ACCESSORS
242/// template <class TYPE>
243/// inline
244/// bsl::size_t my_PooledArray<TYPE>::length() const
245/// {
246/// return d_array_p.size();
247/// }
248///
249/// template <class TYPE>
250/// inline
251/// const TYPE& my_PooledArray<TYPE>::operator[](int index) const
252/// {
253/// assert(0 <= index);
254/// assert(index < static_cast<int>(length()));
255///
256/// return *d_array_p[index];
257/// }
258/// @endcode
259/// Next, we provide the implementation of the `my_PooledArray` methods that are
260/// defined in the `.cpp` file.
261///
262/// Note that the growth strategy and maximum chunk size of the pool defaults to
263/// those provided by `bdlma::Pool`:
264/// @code
265/// // my_poolarray.cpp
266///
267/// // CREATORS
268/// template <class TYPE>
269/// my_PooledArray<TYPE>::my_PooledArray(bslma::Allocator *basicAllocator)
270/// : d_array_p(basicAllocator)
271/// , d_pool(sizeof(TYPE), basicAllocator)
272/// {
273/// }
274/// @endcode
275/// Since all memory is managed by `d_pool`, we do not have to explicitly invoke
276/// `deleteObject` to reclaim outstanding memory. The destructor of the pool
277/// will automatically deallocate all array elements:
278/// @code
279/// template <class TYPE>
280/// my_PooledArray<TYPE>::~my_PooledArray()
281/// {
282/// // Elements are automatically deallocated when 'd_pool' is destroyed.
283/// }
284/// @endcode
285/// Finally, note that the overloaded "placement" `new` is used to allocate new
286/// nodes in the `append` method:
287/// @code
288/// // MANIPULATORS
289/// template <class TYPE>
290/// void my_PooledArray<TYPE>::append(const TYPE& value)
291/// {
292/// TYPE *tmp = new (d_pool) TYPE(value);
293/// d_array_p.push_back(tmp);
294/// }
295/// @endcode
296/// @}
297/** @} */
298/** @} */
299
300/** @addtogroup bdl
301 * @{
302 */
303/** @addtogroup bdlma
304 * @{
305 */
306/** @addtogroup bdlma_pool
307 * @{
308 */
309
310#include <bdlscm_version.h>
311
313
314#include <bslma_allocator.h>
315#include <bslma_deleterhelper.h>
316
317#include <bsls_alignmentutil.h>
318#include <bsls_assert.h>
319#include <bsls_blockgrowth.h>
320#include <bsls_types.h>
321
322#include <bsl_cstddef.h>
323
324
325namespace bdlma {
326
327 // ==========
328 // class Pool
329 // ==========
330
331/// This class implements a memory pool that allocates and manages memory
332/// blocks of some uniform size specified at construction. This memory pool
333/// maintains an internal linked list of free memory blocks, and dispenses
334/// one block for each `allocate` method invocation. When a memory block is
335/// deallocated, it is returned to the free list for potential reuse.
336///
337/// See @ref bdlma_pool
338class Pool {
339
340 // PRIVATE TYPES
341
342 /// This `struct` implements a link data structure that stores the
343 /// address of the next link, and is used to implement the internal linked list of free memory blocks.
344 ///
345 /// \note Note that this type is
346 /// replicated in `bdlma_pool.cpp` to provide access to a compatible
347 /// type from static methods defined in `bdlma_pool.cpp`.
348 ///
349 /// See @ref bdlma_pool
350 struct Link {
351
352 Link *d_next_p; // pointer to next link
353 };
354
355 // DATA
356 bsls::Types::size_type d_blockSize; // size (in bytes) of each
357 // allocated memory block
358 // returned to client
359
360 bsls::Types::size_type d_internalBlockSize; // actual size of each block
361 // maintained on free list
362 // (contains overhead for
363 // 'Link')
364
365 int d_chunkSize; // current chunk size (in
366 // blocks-per-chunk)
367
368 int d_maxBlocksPerChunk; // maximum chunk size (in
369 // blocks-per-chunk)
370
372 d_growthStrategy; // growth strategy of the
373 // chunk size
374
375 Link *d_freeList_p; // linked list of free memory
376 // blocks
377
379 d_blockList; // memory manager for
380 // allocated memory
381
382 char *d_begin_p; // start of a contiguous
383 // group of memory blocks
384
385 char *d_end_p; // end of a contiguous group
386 // of memory blocks
387
388 private:
389 // PRIVATE MANIPULATORS
390
391 /// Dynamically allocate a new chunk using this pool's underlying growth
392 /// strategy.
393 void replenish();
394
395 private:
396 // NOT IMPLEMENTED
397 Pool(const Pool&);
398 Pool& operator=(const Pool&);
399
400 public:
401 // CREATORS
402
403 /// Create a memory pool that returns blocks of contiguous memory of the
404 /// specified `blockSize` (in bytes) for each `allocate` method
405 /// invocation. Optionally specify a `growthStrategy` used to control
406 /// the growth of internal memory chunks (from which memory blocks are
407 /// dispensed). If `growthStrategy` is not specified, geometric growth
408 /// is used. Optionally specify `maxBlocksPerChunk` as the maximum
409 /// chunk size if `growthStrategy` is specified. If geometric growth is
410 /// used, the chunk size grows starting at `blockSize`, doubling in size
411 /// until the size is exactly `blockSize * maxBlocksPerChunk`. If
412 /// constant growth is used, the chunk size is always
413 /// `blockSize * maxBlocksPerChunk`. If `maxBlocksPerChunk` is not
414 /// specified, an implementation-defined value is used. Optionally
415 /// specify a `basicAllocator` used to supply memory. If
416 /// `basicAllocator` is 0, the currently installed default allocator is used.
417 ///
418 /// \pre The behavior is undefined unless `1 <= blockSize` and
419 /// `1 <= maxBlocksPerChunk`.
420 explicit
422 bslma::Allocator *basicAllocator = 0);
424 bsls::BlockGrowth::Strategy growthStrategy,
425 bslma::Allocator *basicAllocator = 0);
427 bsls::BlockGrowth::Strategy growthStrategy,
428 int maxBlocksPerChunk,
429 bslma::Allocator *basicAllocator = 0);
430
431 /// Destroy this pool, releasing all associated memory back to the
432 /// underlying allocator.
434
435 // MANIPULATORS
436
437 /// Return the address of a contiguous block of maximally-aligned memory
438 /// having the fixed block size specified at construction.
439 void *allocate();
440
441 /// Relinquish the memory block at the specified `address` back to this pool object for reuse.
442 ///
443 /// \pre The behavior is undefined unless `address` is
444 /// non-zero, was allocated by this pool, and has not already been
445 /// deallocated.
446 void deallocate(void *address);
447
448 /// Destroy the specified `object` based on its dynamic type and then
449 /// use this pool to deallocate its memory footprint. This method has no effect if `object` is 0.
450 ///
451 /// \pre The behavior is undefined unless
452 /// `object`, when cast appropriately to `void *`, was allocated using
453 /// this pool and has not already been deallocated.
454 ///
455 /// \note Note that `dynamic_cast<void *>(object)` is applied if `TYPE` is polymorphic,
456 /// and `static_cast<void *>(object)` is applied otherwise.
457 template <class TYPE>
458 void deleteObject(const TYPE *object);
459
460 /// Destroy the specified `object` and then use this pool to deallocate its
461 /// memory footprint. This method has no effect if `object` is 0.
462 ///
463 /// \pre The behavior is undefined unless `object` is **not** a secondary base class
464 /// pointer (i.e., the address is (numerically) the same as when it was
465 /// originally dispensed by this pool), was allocated using this pool, and
466 /// has not already been deallocated.
467 template <class TYPE>
468 void deleteObjectRaw(const TYPE *object);
469
470 /// Relinquish all memory currently allocated via this pool object.
471 void release();
472
473 /// Reserve memory from this pool to satisfy memory requests for at least
474 /// the specified `numBlocks` before the pool replenishes.
475 ///
476 /// \pre The behavior is undefined unless `0 <= numBlocks`.
477 void reserveCapacity(int numBlocks);
478
479 // ACCESSORS
480
481 /// Return the size (in bytes) of the memory blocks allocated from this pool object.
482 ///
483 /// \note Note that all blocks dispensed by this pool have the same
484 /// size.
486
487 // Aspects
488
489 /// Return the allocator used by this object to allocate memory.
490 ///
491 /// \note Note that this allocator can not be used to deallocate memory allocated through
492 /// this pool.
494};
495
496} // close package namespace
497
498
499// Note that the `new` and `delete` operators are declared outside the
500// `BloombergLP` namespace so that they do not hide the standard placement
501// `new` and `delete` operators (i.e.,
502// `void *operator new(bsl::size_t, void *)` and
503// `void operator delete(void *)`).
504//
505// Also note that only the scalar versions of operators `new` and `delete` are
506// provided, because overloading `new` (and `delete`) with their array versions
507// would cause dangerous ambiguity. Consider what would have happened had we
508// overloaded the array version of `operator new`:
509// ```
510// void *operator new[](bsl::size_t size, BloombergLP::bdlma::Pool& pool);
511// ```
512// A user of `bdlma::Pool` may expect to be able to use array `operator new` as
513// follows:
514// ```
515// new (*pool) my_Type[...];
516// ```
517// The problem is that this expression returns an array that cannot be safely
518// deallocated. On the one hand, there is no syntax in C++ to invoke an
519// overloaded `operator delete`; on the other hand, the pointer returned by
520// `operator new` cannot be passed to the `deallocate` method directly because
521// the pointer is different from the one returned by the `allocate` method.
522// The compiler offsets the value of this pointer by a header, which is used to
523// maintain the number of objects in the array (so that `operator delete` can
524// destroy the right number of objects).
525
526// FREE OPERATORS
527
528/// Return a block of memory of the specified `size` (in bytes) allocated from the specified `pool`.
529///
530/// \pre The behavior is undefined unless `size` is
531/// the same or smaller than the `blockSize` with which `pool` was constructed.
532///
533/// \note Note that an object may allocate additional memory
534/// internally, requiring the allocator to be passed in as a constructor
535/// argument:
536/// @code
537/// my_Type *newMyType(bdlma::Pool *pool, bslma::Allocator *basicAllocator)
538/// {
539/// return new (*pool) my_Type(..., basicAllocator);
540/// }
541/// @endcode
542/// Also note that the analogous version of `operator delete` should not be
543/// called directly. Instead, this component provides a static template
544/// member function, `deleteObject`, parameterized by `TYPE`:
545/// @code
546/// void deleteMyType(my_Type *t, bdlma::Pool *pool)
547/// {
548/// pool->deleteObject(t);
549/// }
550/// @endcode
551/// `deleteObject` performs the following:
552/// @code
553/// t->~my_Type();
554/// pool->deallocate(t);
555/// @endcode
556void *operator new(bsl::size_t size, BloombergLP::bdlma::Pool& pool);
557
558/// Use the specified `pool` to deallocate the memory at the specified `address`.
559///
560/// \pre The behavior is undefined unless `address` is non-zero, was
561/// allocated using `pool`, and has not already been deallocated.
562///
563/// \note Note that this operator is supplied solely to allow the compiler to arrange for it
564/// to be called in the case of an exception.
565void operator delete(void *address, BloombergLP::bdlma::Pool& pool);
566
567// ============================================================================
568// INLINE DEFINITIONS
569// ============================================================================
570
571
572namespace bdlma {
573
574 // ----------
575 // class Pool
576 // ----------
577
578// MANIPULATORS
579inline
581{
582 if (d_begin_p == d_end_p) {
583 if (d_freeList_p) {
584 Link *p = d_freeList_p;
585 d_freeList_p = p->d_next_p;
586 return p; // RETURN
587 }
588
589 replenish();
590 }
591
592 char *p = d_begin_p;
593 d_begin_p += d_internalBlockSize;
594 return p;
595}
596
597inline
598void Pool::deallocate(void *address)
599{
600 BSLS_ASSERT_SAFE(address);
601
602 static_cast<Link *>(address)->d_next_p = d_freeList_p;
603 d_freeList_p = static_cast<Link *>(address);
604}
605
606template <class TYPE>
607inline
608void Pool::deleteObject(const TYPE *object)
609{
611}
612
613template <class TYPE>
614inline
615void Pool::deleteObjectRaw(const TYPE *object)
616{
618}
619
620inline
622{
623 d_blockList.release();
624 d_freeList_p = 0;
625 d_begin_p = 0;
626 d_end_p = 0;
627}
628
629// ACCESSORS
630inline
632{
633 return d_blockSize;
634}
635
636// Aspects
637
638inline
640{
641 return d_blockList.allocator();
642}
643
644} // close package namespace
645
646
647// FREE OPERATORS
648inline
649void *operator new(bsl::size_t size, BloombergLP::bdlma::Pool& pool)
650{
651 using namespace BloombergLP;
652
653 BSLS_ASSERT_SAFE(size <= pool.blockSize() &&
656
657 static_cast<void>(size); // suppress "unused parameter" warnings
658 return pool.allocate();
659}
660
661inline
662void operator delete(void *address, BloombergLP::bdlma::Pool& pool)
663{
664 BSLS_ASSERT_SAFE(address);
665
666 pool.deallocate(address);
667}
668
669#endif
670
671// ----------------------------------------------------------------------------
672// Copyright 2016 Bloomberg Finance L.P.
673//
674// Licensed under the Apache License, Version 2.0 (the "License");
675// you may not use this file except in compliance with the License.
676// You may obtain a copy of the License at
677//
678// http://www.apache.org/licenses/LICENSE-2.0
679//
680// Unless required by applicable law or agreed to in writing, software
681// distributed under the License is distributed on an "AS IS" BASIS,
682// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
683// See the License for the specific language governing permissions and
684// limitations under the License.
685// ----------------------------- END-OF-FILE ----------------------------------
686
687/** @} */
688/** @} */
689/** @} */
Definition bdlma_infrequentdeleteblocklist.h:245
bslma::Allocator * allocator() const
Return the allocator used by this object to supply memory.
Definition bdlma_infrequentdeleteblocklist.h:342
Definition bdlma_pool.h:338
Pool(bsls::Types::size_type blockSize, bslma::Allocator *basicAllocator=0)
Pool(bsls::Types::size_type blockSize, bsls::BlockGrowth::Strategy growthStrategy, bslma::Allocator *basicAllocator=0)
void reserveCapacity(int numBlocks)
void deleteObjectRaw(const TYPE *object)
Definition bdlma_pool.h:615
void deallocate(void *address)
Definition bdlma_pool.h:598
void deleteObject(const TYPE *object)
Definition bdlma_pool.h:608
bslma::Allocator * allocator() const
Definition bdlma_pool.h:639
bsls::Types::size_type blockSize() const
Definition bdlma_pool.h:631
void * allocate()
Definition bdlma_pool.h:580
Pool(bsls::Types::size_type blockSize, bsls::BlockGrowth::Strategy growthStrategy, int maxBlocksPerChunk, bslma::Allocator *basicAllocator=0)
void release()
Relinquish all memory currently allocated via this pool object.
Definition bdlma_pool.h:621
Definition bslma_allocator.h:545
#define BSLS_ASSERT_SAFE(X)
Definition bsls_assert.h:1917
#define BSLS_IDENT(str)
BSLS_IDENT() - insert string into .comment binary segment (if supported)
Definition bsls_ident.h:238
Definition bdlma_alignedallocator.h:278
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
Strategy
Definition bsls_blockgrowth.h:172
std::size_t size_type
Definition bsls_types.h:126