BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bdlma_concurrentmultipoolallocator.h
Go to the documentation of this file.
1/// @file bdlma_concurrentmultipoolallocator.h
2///
3/// The content of this file has been pre-processed for Doxygen.
4///
5
6
7// bdlma_concurrentmultipoolallocator.h -*-C++-*-
8#ifndef INCLUDED_BDLMA_CONCURRENTMULTIPOOLALLOCATOR
9#define INCLUDED_BDLMA_CONCURRENTMULTIPOOLALLOCATOR
10
11#include <bsls_ident.h>
12BSLS_IDENT("$Id: $")
13
14/// @defgroup bdlma_concurrentmultipoolallocator bdlma_concurrentmultipoolallocator
15/// @brief Provide an allocator to manage pools of varying object sizes.
16/// @addtogroup bdl
17/// @{
18/// @addtogroup bdlma
19/// @{
20/// @addtogroup bdlma_concurrentmultipoolallocator
21/// @{
22///
23/// <h1> Outline </h1>
24/// * <a href="#bdlma_concurrentmultipoolallocator-purpose"> Purpose</a>
25/// * <a href="#bdlma_concurrentmultipoolallocator-classes"> Classes </a>
26/// * <a href="#bdlma_concurrentmultipoolallocator-description"> Description </a>
27/// * <a href="#bdlma_concurrentmultipoolallocator-configuration-at-construction"> Configuration at Construction </a>
28/// * <a href="#bdlma_concurrentmultipoolallocator-usage"> Usage </a>
29/// * <a href="#bdlma_concurrentmultipoolallocator-example-1-using-a-bdlma-concurrentmultipoolallocator"> Example 1: Using a bdlma::ConcurrentMultipoolAllocator </a>
30///
31/// # Purpose {#bdlma_concurrentmultipoolallocator-purpose}
32/// Provide an allocator to manage pools of varying object sizes.
33///
34/// # Classes {#bdlma_concurrentmultipoolallocator-classes}
35///
36/// - bdlma::ConcurrentMultipoolAllocator: allocator managing varying size pools
37///
38/// @see bdlma_concurrentpool, bdlma_concurrentmultipool
39///
40/// # Description {#bdlma_concurrentmultipoolallocator-description}
41/// This component provides an allocator,
42/// `bdlma::ConcurrentMultipoolAllocator`, that implements the
43/// `bdlma::ManagedAllocator` protocol and provides an allocator that maintains
44/// a configurable number of `bdlma::ConcurrentPool` objects, each dispensing
45/// memory blocks of a unique size. The `bdlma::ConcurrentPool` objects are
46/// placed in an array, starting at index 0, with each successive pool managing
47/// memory blocks of a size twice that of the previous pool. Each multipool
48/// allocation (deallocation) request allocates memory from (returns memory to)
49/// the internal pool managing memory blocks of the smallest size not less than
50/// the requested size, or else from a separately managed list of memory blocks,
51/// if no internal pool managing memory block of sufficient size exists. Both
52/// the `release` method and the destructor of a
53/// `bdlma::ConcurrentMultipoolAllocator` release all memory currently allocated
54/// via the object.
55/// @code
56/// ,-----------------------------------.
57/// ( bdlma::ConcurrentMultipoolAllocator )
58/// `-----------------------------------'
59/// | ctor/dtor
60/// | maxPooledBlockSize
61/// | numPools
62/// | reserveCapacity
63/// V
64/// ,-----------------------.
65/// ( bdlma::ManagedAllocator )
66/// `-----------------------'
67/// | release
68/// V
69/// ,-----------------.
70/// ( bslma::Allocator )
71/// `-----------------'
72/// allocate
73/// deallocate
74/// @endcode
75/// The main difference between a `bdlma::ConcurrentMultipoolAllocator` and a
76/// `bdlma::ConcurrentMultipool` is that, very often, a
77/// `bdlma::ConcurrentMultipoolAllocator` is managed through a
78/// `bslma::Allocator` pointer. Hence, every call to the `allocate` method
79/// invokes a virtual function call, which is slower than invoking the
80/// non-virtual `allocate` method on a `bdlma::ConcurrentMultipool`. However,
81/// since `bslma::Allocator *` is widely used across BDE interfaces,
82/// `bdlma::ConcurrentMultipoolAllocator` is more general purposed than a
83/// `bdlma::ConcurrentMultipool`.
84///
85/// ## Configuration at Construction {#bdlma_concurrentmultipoolallocator-configuration-at-construction}
86///
87///
88/// When creating a `bdlma::ConcurrentMultipoolAllocator`, clients can
89/// optionally configure:
90///
91/// 1. NUMBER OF POOLS -- the number of internal pools (the block size managed
92/// by the first pool is eight bytes, with each successive pool managing
93/// block of a size twice that of the previous pool).
94/// 2. GROWTH STRATEGY -- geometrically growing chunk size starting from 1 (in
95/// terms of the number of memory blocks per chunk), or fixed chunk size,
96/// specified as either:
97/// - the unique growth strategy for all pools, or
98/// - (if the number of pools is specified) an array of growth strategies
99/// corresponding to each individual pool
100/// If the growth strategy is not specified, geometric growth is used for all
101/// pools.
102/// 3. MAX BLOCKS PER CHUNK -- the maximum number of memory blocks within a
103/// chunk, specified as either:
104/// - the unique maximum-blocks-per-chunk value for all of the pools, or
105/// - an array of maximum-blocks-per-chunk values corresponding to each
106/// individual pool.
107/// If the maximum blocks per chunk is not specified, an
108/// implementation-defined default value is used. Note that the maximum
109/// blocks per chunk can be configured only if the number of pools is also
110/// configured.
111/// 4. BASIC ALLOCATOR -- the allocator used to supply memory (to replenish an
112/// internal pool, or directly if the maximum block size is exceeded). If
113/// not specified, the currently installed default allocator (see
114/// @ref bslma_default ) is used.
115///
116/// A default-constructed multipool allocator has a relatively small,
117/// implementation-defined number of pools `N` with respective block sizes
118/// ranging from `2^3 = 8` to `2^(N+2)`. By default, the initial chunk size,
119/// (i.e., the number of blocks of a given size allocated at once to replenish a
120/// pool's memory) is 1, and each pool's chunk size grows geometrically until it
121/// reaches an implementation-defined maximum, at which it is capped. Finally,
122/// unless otherwise specified, all memory comes from the allocator that was the
123/// currently installed default allocator at the time the
124/// `bdlma::ConcurrentMultipoolAllocator` was created.
125///
126/// Using the various pooling options described above, we can configure the
127/// number of pools maintained, whether replenishment should be adaptive (i.e.,
128/// geometric starting with 1) or fixed at a maximum chunk size, what that
129/// maximum chunk size should be (which need not be an integral power of 2), and
130/// the underlying allocator used to supply memory. Note that both GROWTH
131/// STRATEGY and MAX BLOCKS PER CHUNK can be specified separately either as a
132/// single value applying to all of the maintained pools, or as an array of
133/// values, with the elements applying to each individually maintained pool.
134///
135/// ## Usage {#bdlma_concurrentmultipoolallocator-usage}
136///
137///
138/// This section illustrates intended use of this component.
139///
140/// ### Example 1: Using a bdlma::ConcurrentMultipoolAllocator {#bdlma_concurrentmultipoolallocator-example-1-using-a-bdlma-concurrentmultipoolallocator}
141///
142///
143/// A `bdlma::ConcurrentMultipoolAllocator` can be used to supply memory to
144/// node-based data structures such as `bsl::set`, `bsl::list` or `bsl::map`.
145/// Suppose we are implementing a container of named graphs data structure,
146/// where a graph is defined by a set of edges and nodes. The various
147/// fixed-sized nodes can be efficiently allocated by a
148/// `bdlma::ConcurrentMultipoolAllocator`.
149///
150/// First, the edge class, `my_Edge`, is defined as follows:
151/// @code
152/// class my_Node;
153///
154/// class my_Edge {
155/// // This class represents an edge within a graph. Both ends of the
156/// // edge must be connected to nodes.
157///
158/// // DATA
159/// my_Node *d_first; // first node
160/// my_Node *d_second; // second node
161///
162/// // ...
163///
164/// public:
165/// // CREATORS
166/// my_Edge(my_Node *first, my_Node *second);
167/// // Create an edge that connects to the specified 'first' and
168/// // 'second' nodes.
169///
170/// // ...
171/// };
172///
173/// // CREATORS
174/// my_Edge::my_Edge(my_Node *first, my_Node *second)
175/// : d_first(first), d_second(second)
176/// {
177/// }
178/// @endcode
179/// Then, the node class, `my_Node`, is defined as follows:
180/// @code
181/// class my_Node {
182/// // This class represents a node within a graph. A node can be
183/// // connected to any number of edges.
184///
185/// // DATA
186/// bsl::set<my_Edge *> d_edges; // set of edges this node connects to
187///
188/// // ...
189///
190/// private:
191/// // Not implemented:
192/// my_Node(const my_Node&);
193///
194/// public:
195/// // TRAITS
196/// BSLMF_NESTED_TRAIT_DECLARATION(my_Node, bslma::UsesBslmaAllocator);
197///
198/// // CREATORS
199/// explicit my_Node(bslma::Allocator *basicAllocator = 0);
200/// // Create a node not connected to any other nodes. Optionally
201/// // specify a 'basicAllocator' used to supply memory. If
202/// // 'basicAllocator' is 0, the currently installed default allocator
203/// // is used.
204///
205/// // ...
206/// };
207///
208/// // CREATORS
209/// my_Node::my_Node(bslma::Allocator *basicAllocator)
210/// : d_edges(basicAllocator)
211/// {
212/// }
213/// @endcode
214/// Then we define the graph class, `my_Graph`, as follows:
215/// @code
216/// class my_Graph {
217/// // This class represents a graph having sets of nodes and edges.
218///
219/// // DATA
220/// bsl::set<my_Edge> d_edges; // set of edges in this graph
221/// bsl::set<my_Node> d_nodes; // set of nodes in this graph
222///
223/// // ...
224///
225/// private:
226/// // Not implemented:
227/// my_Graph(const my_Graph&);
228///
229/// public:
230/// // TRAITS
231/// BSLMF_NESTED_TRAIT_DECLARATION(my_Graph, bslma::UsesBslmaAllocator);
232///
233/// // CREATORS
234/// explicit my_Graph(bslma::Allocator *basicAllocator = 0);
235/// // Create an empty graph. Optionally specify a 'basicAllocator'
236/// // used to supply memory. If 'basicAllocator' is 0, the currently
237/// // installed default allocator is used.
238///
239/// // ...
240/// };
241///
242/// my_Graph::my_Graph(bslma::Allocator *basicAllocator)
243/// : d_edges(basicAllocator)
244/// , d_nodes(basicAllocator)
245/// {
246/// }
247/// @endcode
248/// Then finally, the container for the collection of named graphs,
249/// `my_NamedGraphContainer`, is defined as follows:
250/// @code
251/// class my_NamedGraphContainer {
252/// // This class stores a map that index graph names to graph objects.
253///
254/// // DATA
255/// bsl::map<bsl::string, my_Graph> d_graphMap; // map from graph names to
256/// // graph
257///
258/// private:
259/// // Not implemented:
260/// my_NamedGraphContainer(const my_NamedGraphContainer&);
261///
262/// public:
263/// // TRAITS
264/// BSLMF_NESTED_TRAIT_DECLARATION(my_NamedGraphContainer,
265/// bslma::UsesBslmaAllocator);
266///
267/// // CREATORS
268/// explicit my_NamedGraphContainer(bslma::Allocator *basicAllocator = 0);
269/// // Create an empty named graph container. Optionally specify a
270/// // 'basicAllocator' used to supply memory. If 'basicAllocator' is
271/// // 0, the currently installed default allocator is used.
272///
273/// // ...
274/// };
275///
276/// // CREATORS
277/// my_NamedGraphContainer::my_NamedGraphContainer(
278/// bslma::Allocator *basicAllocator)
279/// : d_graphMap(basicAllocator)
280/// {
281/// }
282/// @endcode
283/// Finally, in `main`, we can create a `bdlma::ConcurrentMultipoolAllocator`
284/// and pass it to our `my_NamedGraphContainer`. Since we know that the maximum
285/// block size needed is 32 (comes from `sizeof(my_Graph)`), we can calculate
286/// the number of pools needed by using the formula specified in the
287/// "configuration at construction" section:
288/// @code
289/// largestPoolSize < 2 ^ (N + 2).
290/// @endcode
291/// When solved for the above equation, the smallest `N` that satisfies this
292/// relationship is 3:
293/// @code
294/// enum { k_NUM_POOLS = 3 };
295///
296/// bdlma::ConcurrentMultipoolAllocator basicAllocator(k_NUM_POOLS);
297///
298/// my_NamedGraphContainer container(&basicAllocator);
299/// @endcode
300/// @}
301/** @} */
302/** @} */
303
304/** @addtogroup bdl
305 * @{
306 */
307/** @addtogroup bdlma
308 * @{
309 */
310/** @addtogroup bdlma_concurrentmultipoolallocator
311 * @{
312 */
313
314#include <bdlscm_version.h>
315
318
319#include <bslma_allocator.h>
320
321#include <bsls_keyword.h>
322#include <bsls_types.h>
323
324
325namespace bdlma {
326
327 // ==================================
328 // class ConcurrentMultipoolAllocator
329 // ==================================
330
331/// This class implements the `bdlma::ManagedAllocator` protocol to provide
332/// a thread-safe allocator that maintains a configurable number of `Pool`
333/// objects, each dispensing memory blocks of a unique size. The `Pool`
334/// objects are placed in an array, with each successive pool managing
335/// memory blocks of size twice that of the previous pool. Each multipool
336/// allocation (deallocation) request allocates memory from (returns memory
337/// to) the internal pool having the smallest block size not less than the
338/// requested size, or, if no pool manages memory blocks of sufficient
339/// sized, from a separately managed list of memory blocks. Both the
340/// `release` method and the destructor of a `ConcurrentMultipoolAllocator`
341/// release all memory currently allocated via the object.
342///
343/// See @ref bdlma_concurrentmultipoolallocator
345
346 // DATA
347 ConcurrentMultipool d_multipool; // owned allocator
348
349 private:
350 // NOT IMPLEMENTED
354
355 public:
356 // CREATORS
357
359 bslma::Allocator *basicAllocator = 0);
361 int numPools,
362 bslma::Allocator *basicAllocator = 0);
364 bsls::BlockGrowth::Strategy growthStrategy,
365 bslma::Allocator *basicAllocator = 0);
367 int numPools,
368 bsls::BlockGrowth::Strategy growthStrategy,
369 bslma::Allocator *basicAllocator = 0);
370 /// Create a multipool allocator. Optionally specify `numPools`,
371 /// indicating the number of internally created `Pool` objects; the
372 /// block size of the first pool is 8 bytes, with the block size of each
373 /// additional pool successively doubling. If `numPools` is not
374 /// specified, an implementation-defined number of pools `N` -- covering
375 /// memory blocks ranging in size from `2^3 = 8` to `2^(N+2)` -- are
376 /// created. Optionally specify a `growthStrategy` indicating whether
377 /// the number of blocks allocated at once for every internally created
378 /// `Pool` should be either fixed or grow geometrically, starting with
379 /// 1. If `growthStrategy` is not specified, the allocation strategy
380 /// for each internally created `Pool` object is geometric, starting
381 /// from 1. If `numPools` is specified, optionally specify a
382 /// `maxBlocksPerChunk`, indicating the maximum number of blocks to be
383 /// allocated at once when a pool must be replenished. If
384 /// `maxBlocksPerChunk` is not specified, an implementation-defined
385 /// value is used. Optionally specify a `basicAllocator` used to supply
386 /// memory. If `basicAllocator` is 0, the currently installed default
387 /// allocator is used. Memory allocation (and deallocation) requests
388 /// will be satisfied using the internally maintained pool managing
389 /// memory blocks of the smallest size not less than the requested size,
390 /// or directly from the underlying allocator (supplied at
391 /// construction), if no internally pool managing memory block of
392 /// sufficient size exists. The behavior is undefined unless
393 /// `1 <= numPools` and `1 <= maxBlocksPerChunk`. Note that, on
394 /// platforms where `8 < bsls::AlignmentUtil::BSLS_MAX_ALIGNMENT`,
395 /// excess memory may be allocated for pools managing smaller blocks.
396 /// Also note that `maxBlocksPerChunk` need not be an integral power of
397 /// 2; if geometric growth would exceed the maximum value, the chunk
398 /// size is capped at that value).
400 int numPools,
401 bsls::BlockGrowth::Strategy growthStrategy,
402 int maxBlocksPerChunk,
403 bslma::Allocator *basicAllocator = 0);
404
406 int numPools,
407 const bsls::BlockGrowth::Strategy *growthStrategyArray,
408 bslma::Allocator *basicAllocator = 0);
410 int numPools,
411 const bsls::BlockGrowth::Strategy *growthStrategyArray,
412 int maxBlocksPerChunk,
413 bslma::Allocator *basicAllocator = 0);
415 int numPools,
416 bsls::BlockGrowth::Strategy growthStrategy,
417 const int *maxBlocksPerChunkArray,
418 bslma::Allocator *basicAllocator = 0);
419 /// Create a multipool allocator having the specified `numPools`,
420 /// indicating the number of internally created `Pool` objects; the
421 /// block size of the first pool is 8 bytes, with the block size of each
422 /// additional pool successively doubling. Optionally specify a
423 /// `growthStrategy` indicating whether the number of blocks allocated
424 /// at once for every internally created `Pool` should be either fixed
425 /// or grow geometrically, starting with 1. If `growthStrategy` is not
426 /// specified, optionally specify `growthStrategyArray`, indicating the
427 /// strategies for each individual `Pool` created by this object. If
428 /// neither `growthStrategy` nor `growthStrategyArray` are specified,
429 /// the allocation strategy for each internally created `Pool` object
430 /// will grow geometrically, starting from 1. Optionally specify a
431 /// `maxBlocksPerChunk`, indicating the maximum number of blocks to be
432 /// allocated at once when a pool must be replenished. If
433 /// `maxBlocksPerChunk` is not specified, optionally specify
434 /// `maxBlocksPerChunkArray`, indicating the maximum number of blocks to
435 /// allocate at once for each individually created `Pool` object. If
436 /// neither `maxBlocksPerChunk` nor `maxBlocksPerChunkArray` are
437 /// specified, an implementation-defined value is used. Optionally
438 /// specify a `basicAllocator` used to supply memory. If
439 /// `basicAllocator` is 0, the currently installed default allocator is
440 /// used. Memory allocation (and deallocation) requests will be
441 /// satisfied using the internally maintained pool managing memory
442 /// blocks of the smallest size not less than the requested size, or
443 /// directly from the underlying allocator (supplied at construction),
444 /// if no internally pool managing memory block of sufficient size
445 /// exists. The behavior is undefined unless `1 <= numPools`,
446 /// `growthStrategyArray` has at least `numPools` strategies,
447 /// `1 <= maxBlocksPerChunk` and `maxBlocksPerChunkArray` have at least
448 /// `numPools` positive values. Note that, on platforms where
449 /// `8 < bsls::AlignmentUtil::BSLS_MAX_ALIGNMENT`, excess memory may be
450 /// allocated for pools managing smaller blocks. Also note that the
451 /// maximum need not be an integral power of 2; if geometric growth
452 /// would exceed a maximum value, the chunk size is capped at that
453 /// value).
455 int numPools,
456 const bsls::BlockGrowth::Strategy *growthStrategyArray,
457 const int *maxBlocksPerChunkArray,
458 bslma::Allocator *basicAllocator = 0);
459
460 /// Destroy this multipool allocator. All memory allocated from this
461 /// allocator is released.
463
464 // MANIPULATORS
465
466 /// Reserve memory from this multipool allocator to satisfy memory
467 /// requests for at least the specified `numObjects` having the
468 /// specified `size` (in bytes) before the pool replenishes. If `size`
469 /// is 0, this method has no effect. The behavior is undefined unless
470 /// `size <= maxPooledBlockSize()` and `0 <= numObjects`.
471 void reserveCapacity(bsls::Types::size_type size, int numObjects);
472
473 // Virtual Functions
474
475 /// Return the address of a contiguous block of maximally aligned memory
476 /// of (at least) the specified `size` (in bytes). If `size` is 0, no
477 /// memory is allocated and 0 is returned. If
478 /// `size > maxPooledBlockSize()`, the memory allocation is managed
479 /// directly by the underlying allocator, but will not be pooled . The
480 /// behavior is undefined unless `0 <= size`.
482
483 /// Relinquish the memory block at the specified `address` back to this
484 /// allocator for reuse. If `address` is 0, this method has no effect.
485 /// The behavior is undefined unless `address` was allocated by this
486 /// allocator, and has not already been deallocated.
488
489 /// Relinquish all memory currently allocated through this multipool
490 /// allocator.
492
493 // ACCESSORS
494
495 /// Return the number of pools managed by this multipool allocator.
496 int numPools() const;
497
498 /// Return the maximum size of memory blocks that are pooled by this
499 /// multipool object. Note that the maximum value is defined as:
500 /// @code
501 /// 2 ^ (numPools + 2)
502 /// @endcode
503 /// where `numPools` is either specified at construction, or an
504 /// implementation-defined value.
505 bsls::Types::size_type maxPooledBlockSize() const;
506};
507
508// ============================================================================
509// INLINE DEFINITIONS
510// ============================================================================
511
512 // ----------------------------------
513 // class ConcurrentMultipoolAllocator
514 // ----------------------------------
515
516// CREATORS
517inline
519 bslma::Allocator *basicAllocator)
520: d_multipool(basicAllocator)
521{
522}
523
524inline
525ConcurrentMultipoolAllocator::ConcurrentMultipoolAllocator(
526 int numPools,
527 bslma::Allocator *basicAllocator)
528: d_multipool(numPools, basicAllocator)
529{
530}
531
532inline
533ConcurrentMultipoolAllocator::ConcurrentMultipoolAllocator(
534 bsls::BlockGrowth::Strategy growthStrategy,
535 bslma::Allocator *basicAllocator)
536: d_multipool(growthStrategy, basicAllocator)
537{
538}
539
540inline
541ConcurrentMultipoolAllocator::ConcurrentMultipoolAllocator(
542 int numPools,
543 bsls::BlockGrowth::Strategy growthStrategy,
544 bslma::Allocator *basicAllocator)
545: d_multipool(numPools, growthStrategy, basicAllocator)
546{
547}
548
549inline
550ConcurrentMultipoolAllocator::ConcurrentMultipoolAllocator(
551 int numPools,
552 const bsls::BlockGrowth::Strategy *growthStrategyArray,
553 bslma::Allocator *basicAllocator)
554: d_multipool(numPools, growthStrategyArray, basicAllocator)
555{
556}
557
558inline
559ConcurrentMultipoolAllocator::ConcurrentMultipoolAllocator(
560 int numPools,
561 bsls::BlockGrowth::Strategy growthStrategy,
562 int maxBlocksPerChunk,
563 bslma::Allocator *basicAllocator)
564: d_multipool(numPools, growthStrategy, maxBlocksPerChunk, basicAllocator)
565{
566}
567
568inline
569ConcurrentMultipoolAllocator::ConcurrentMultipoolAllocator(
570 int numPools,
571 const bsls::BlockGrowth::Strategy *growthStrategyArray,
572 int maxBlocksPerChunk,
573 bslma::Allocator *basicAllocator)
574: d_multipool(numPools, growthStrategyArray, maxBlocksPerChunk, basicAllocator)
575{
576}
577
578inline
579ConcurrentMultipoolAllocator::ConcurrentMultipoolAllocator(
580 int numPools,
581 bsls::BlockGrowth::Strategy growthStrategy,
582 const int *maxBlocksPerChunkArray,
583 bslma::Allocator *basicAllocator)
584: d_multipool(numPools, growthStrategy, maxBlocksPerChunkArray, basicAllocator)
585{
586}
587
588inline
589ConcurrentMultipoolAllocator::ConcurrentMultipoolAllocator(
590 int numPools,
591 const bsls::BlockGrowth::Strategy *growthStrategyArray,
592 const int *maxBlocksPerChunkArray,
593 bslma::Allocator *basicAllocator)
594: d_multipool(numPools,
595 growthStrategyArray,
596 maxBlocksPerChunkArray,
597 basicAllocator)
598{
599}
600
601// MANIPULATORS
602inline
605 int numObjects)
606{
607 d_multipool.reserveCapacity(size, numObjects);
608}
609
610// ACCESSORS
611inline
613{
614 return d_multipool.numPools();
615}
616
617inline
622
623} // close package namespace
624
625
626#endif
627
628// ----------------------------------------------------------------------------
629// Copyright 2016 Bloomberg Finance L.P.
630//
631// Licensed under the Apache License, Version 2.0 (the "License");
632// you may not use this file except in compliance with the License.
633// You may obtain a copy of the License at
634//
635// http://www.apache.org/licenses/LICENSE-2.0
636//
637// Unless required by applicable law or agreed to in writing, software
638// distributed under the License is distributed on an "AS IS" BASIS,
639// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
640// See the License for the specific language governing permissions and
641// limitations under the License.
642// ----------------------------- END-OF-FILE ----------------------------------
643
644/** @} */
645/** @} */
646/** @} */
Definition bdlma_concurrentmultipoolallocator.h:344
void reserveCapacity(bsls::Types::size_type size, int numObjects)
Definition bdlma_concurrentmultipoolallocator.h:603
int numPools() const
Return the number of pools managed by this multipool allocator.
Definition bdlma_concurrentmultipoolallocator.h:612
void release() BSLS_KEYWORD_OVERRIDE
void * allocate(bsls::Types::size_type size) BSLS_KEYWORD_OVERRIDE
~ConcurrentMultipoolAllocator() BSLS_KEYWORD_OVERRIDE
void deallocate(void *address) BSLS_KEYWORD_OVERRIDE
bsls::Types::size_type maxPooledBlockSize() const
Definition bdlma_concurrentmultipoolallocator.h:618
Definition bdlma_concurrentmultipool.h:545
int numPools() const
Return the number of pools managed by this multipool object.
Definition bdlma_concurrentmultipool.h:809
void reserveCapacity(bsls::Types::size_type size, int numBlocks)
bsls::Types::size_type maxPooledBlockSize() const
Definition bdlma_concurrentmultipool.h:815
Definition bdlma_managedallocator.h:391
Definition bslma_allocator.h:457
std::size_t size_type
Definition bslma_allocator.h:499
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
#define BSLS_KEYWORD_OVERRIDE
Definition bsls_keyword.h:653
Definition bdlma_alignedallocator.h:276
Definition balxml_encoderoptions.h:68
Definition bdlt_iso8601util.h:691
Strategy
Definition bsls_blockgrowth.h:169
std::size_t size_type
Definition bsls_types.h:124