BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bdlma_sequentialallocator.h
Go to the documentation of this file.
1/// @file bdlma_sequentialallocator.h
2///
3/// The content of this file has been pre-processed for Doxygen.
4///
5
6
7// bdlma_sequentialallocator.h -*-C++-*-
8#ifndef INCLUDED_BDLMA_SEQUENTIALALLOCATOR
9#define INCLUDED_BDLMA_SEQUENTIALALLOCATOR
10
11#include <bsls_ident.h>
12BSLS_IDENT("$Id: $")
13
14/// @defgroup bdlma_sequentialallocator bdlma_sequentialallocator
15/// @brief Provide a managed allocator using dynamically-allocated buffers.
16/// @addtogroup bdl
17/// @{
18/// @addtogroup bdlma
19/// @{
20/// @addtogroup bdlma_sequentialallocator
21/// @{
22///
23/// <h1> Outline </h1>
24/// * <a href="#bdlma_sequentialallocator-purpose"> Purpose</a>
25/// * <a href="#bdlma_sequentialallocator-classes"> Classes </a>
26/// * <a href="#bdlma_sequentialallocator-description"> Description </a>
27/// * <a href="#bdlma_sequentialallocator-optional-initialsize-parameter"> Optional initialSize Parameter </a>
28/// * <a href="#bdlma_sequentialallocator-optional-maxbuffersize-parameter"> Optional maxBufferSize Parameter </a>
29/// * <a href="#bdlma_sequentialallocator-optional-growthstrategy-parameter"> Optional growthStrategy Parameter </a>
30/// * <a href="#bdlma_sequentialallocator-optional-alignmentstrategy-parameter"> Optional alignmentStrategy Parameter </a>
31/// * <a href="#bdlma_sequentialallocator-usage"> Usage </a>
32///
33/// # Purpose {#bdlma_sequentialallocator-purpose}
34/// Provide a managed allocator using dynamically-allocated buffers.
35///
36/// # Classes {#bdlma_sequentialallocator-classes}
37///
38/// - bdlma::SequentialAllocator: managed allocator using dynamic buffers
39///
40/// @see bdlma_infrequentdeleteblocklist, bdlma_sequentialpool
41///
42/// # Description {#bdlma_sequentialallocator-description}
43/// This component provides a concrete mechanism,
44/// `bdlma::SequentialAllocator`, that implements the `bdlma::ManagedAllocator`
45/// protocol and efficiently allocates heterogeneous memory blocks (of varying,
46/// user-specified sizes) from a dynamically-allocated internal buffer:
47/// @code
48/// ,--------------------------.
49/// ( bdlma::SequentialAllocator )
50/// `--------------------------'
51/// | ctor/dtor
52/// | allocateAndExpand
53/// | reserveCapacity
54/// | rewind
55/// | truncate
56/// V
57/// ,-----------------------.
58/// ( bdlma::ManagedAllocator )
59/// `-----------------------'
60/// | release
61/// V
62/// ,----------------.
63/// ( bslma::Allocator )
64/// `----------------'
65/// allocate
66/// deallocate
67/// @endcode
68/// If an allocation request exceeds the remaining free memory space in the
69/// internal buffer, the allocator either replenishes its buffer with new memory
70/// to satisfy the request, or returns a separate memory block, depending on
71/// whether the request size exceeds an optionally-specified maximum buffer
72/// size. The `release` method releases all memory allocated through the
73/// allocator, as does the destructor. The `rewind` method releases all memory
74/// allocated through the allocator and returns to the underlying allocator
75/// *only* memory that was allocated outside of the typical internal buffer
76/// growth of the allocator (i.e., large blocks). Note that individually
77/// allocated memory blocks cannot be separately deallocated.
78///
79/// The main difference between a `bdlma::SequentialAllocator` and a
80/// `bdlma::SequentialPool` is that, very often, a `bdlma::SequentialAllocator`
81/// is managed through a `bslma::Allocator` pointer. Hence, every call to the
82/// `allocate` method invokes a virtual function call, which is slower than
83/// invoking the non-virtual `allocate` method on a `bdlma::SequentialPool`.
84/// However, since `bslma::Allocator *` is widely used across BDE interfaces,
85/// `bdlma::SequentialAllocator` is more general purpose than a
86/// `bdlma::SequentialPool`.
87///
88/// ## Optional initialSize Parameter {#bdlma_sequentialallocator-optional-initialsize-parameter}
89///
90///
91/// An optional `initialSize` parameter can be supplied at construction to
92/// specify the initial size of the internal buffer. If `initialSize` is not
93/// supplied, an implementation-defined value is used for the initial size of
94/// the internal buffer.
95///
96/// ### Optional maxBufferSize Parameter {#bdlma_sequentialallocator-optional-maxbuffersize-parameter}
97///
98///
99/// If `initialSize` is specified, an optional `maxBufferSize` parameter can be
100/// supplied at construction to specify the maximum buffer size for geometric
101/// growth. Once the internal buffer grows up to the `maxBufferSize`, further
102/// requests that exceed this size will be served by a separate memory block
103/// instead of the internal buffer. The behavior is undefined unless
104/// `maxBufferSize >= initialSize`. Note that `reserveCapacity` always ensures
105/// that the requested number of bytes is available (allocating a new internal
106/// buffer if necessary) regardless of whether the size of the request exceeds
107/// `maxBufferSize`.
108///
109/// ## Optional growthStrategy Parameter {#bdlma_sequentialallocator-optional-growthstrategy-parameter}
110///
111///
112/// An optional `growthStrategy` parameter can be supplied at construction to
113/// specify the growth rate of the dynamically-allocated buffers. The buffers
114/// can grow either geometrically or remain constant in size. If
115/// `growthStrategy` is not specified, geometric growth is used. See
116/// @ref bsls_blockgrowth for more details.
117///
118/// ## Optional alignmentStrategy Parameter {#bdlma_sequentialallocator-optional-alignmentstrategy-parameter}
119///
120///
121/// An optional `alignmentStrategy` parameter can be supplied at construction to
122/// specify the memory alignment strategy. Allocated memory blocks can either
123/// follow maximum alignment, natural alignment, or 1-byte alignment. If
124/// `alignmentStrategy` is not specified, natural alignment is used. See
125/// @ref bsls_alignment for more details.
126///
127/// ## Usage {#bdlma_sequentialallocator-usage}
128///
129///
130/// Allocators are often supplied, at construction, to objects requiring
131/// dynamically-allocated memory. For example, consider the following
132/// `my_DoubleStack` class whose constructor takes a `bslma::Allocator *`:
133/// @code
134/// // my_doublestack.h
135/// // ...
136///
137/// class my_DoubleStack {
138/// // This class implements a stack that stores 'double' values.
139///
140/// // DATA
141/// double *d_stack_p; // dynamically-allocated array
142/// int d_size; // physical capacity of stack
143/// int d_length; // next available index in stack
144/// bslma::Allocator *d_allocator_p; // memory allocator (held, not owned)
145///
146/// private:
147/// // PRIVATE MANIPULATORS
148/// void increaseCapacity();
149/// // Increase the capacity of this stack by at least one element.
150///
151/// // Not implemented:
152/// my_DoubleStack(const my_DoubleStack&);
153///
154/// public:
155/// // CREATORS
156/// explicit my_DoubleStack(bslma::Allocator *basicAllocator = 0);
157/// // Create a stack that stores 'double' values. Optionally specify
158/// // a 'basicAllocator' used to supply memory. If 'basicAllocator'
159/// // is 0, the currently installed default allocator is used.
160///
161/// ~my_DoubleStack();
162/// // Destroy this stack and all elements held by it.
163///
164/// // ...
165///
166/// // MANIPULATORS
167/// void push(double value);
168/// // Push the specified 'value' onto this stack.
169///
170/// // ...
171/// };
172///
173/// // ...
174///
175/// // MANIPULATORS
176/// inline
177/// void my_DoubleStack::push(double value)
178/// {
179/// if (d_length >= d_size) {
180/// increaseCapacity();
181/// }
182/// d_stack_p[d_length++] = value;
183/// }
184///
185/// // ...
186///
187/// // my_doublestack.cpp
188///
189/// // PRIVATE MANIPULATORS
190/// void my_DoubleStack::increaseCapacity()
191/// {
192/// // Implementation elided.
193/// // ...
194/// }
195///
196/// // CREATORS
197/// my_DoubleStack::my_DoubleStack(bslma::Allocator *basicAllocator)
198/// : d_size(1)
199/// , d_length(0)
200/// , d_allocator_p(bslma::Default::allocator(basicAllocator))
201/// {
202/// d_stack_p = static_cast<double *>(
203/// d_allocator_p->allocate(d_size * sizeof *d_stack_p));
204/// }
205/// @endcode
206/// Note that, when the allocator passed in is a `bdlma::SequentialAllocator`,
207/// the `deallocate` method is a no-op, and all memory is reclaimed during the
208/// destruction of the allocator:
209/// @code
210/// my_DoubleStack::~my_DoubleStack()
211/// {
212/// // CLASS INVARIANTS
213/// assert(d_allocator_p);
214/// assert(d_stack_p);
215/// assert(0 <= d_length);
216/// assert(0 <= d_size);
217/// assert(d_length <= d_size);
218///
219/// d_allocator_p->deallocate(d_stack_p);
220/// }
221///
222/// // ...
223/// @endcode
224/// In `main`, users can create a `bdlma::SequentialAllocator` and pass it to
225/// the constructor of `my_DoubleStack`:
226/// @code
227/// bdlma::SequentialAllocator sequentialAlloc;
228/// my_DoubleStack dstack(&sequentialAlloc);
229/// @endcode
230/// @}
231/** @} */
232/** @} */
233
234/** @addtogroup bdl
235 * @{
236 */
237/** @addtogroup bdlma
238 * @{
239 */
240/** @addtogroup bdlma_sequentialallocator
241 * @{
242 */
243
244#include <bdlscm_version.h>
245
247#include <bdlma_sequentialpool.h>
248
249#include <bslma_allocator.h>
250
251#include <bsls_alignment.h>
252#include <bsls_assert.h>
253#include <bsls_blockgrowth.h>
254#include <bsls_keyword.h>
255#include <bsls_performancehint.h>
256#include <bsls_review.h>
257#include <bsls_types.h>
258
259
260namespace bdlma {
261
262 // =========================
263 // class SequentialAllocator
264 // =========================
265
266/// This class implements the `ManagedAllocator` protocol to provide a fast
267/// allocator that dispenses heterogeneous blocks of memory (of varying,
268/// user-specified sizes) from a sequence of dynamically-allocated buffers.
269/// Memory for the internal buffers is supplied by an (optional) allocator
270/// supplied at construction; if no allocator is supplied, the currently
271/// installed default allocator is used. If an allocation exceeds the
272/// remaining free memory space in the current buffer, the allocator
273/// replenishes its internal buffer with new memory to satisfy the request.
274/// This class is *exception* *neutral*: If memory cannot be allocated, the
275/// behavior is defined by the (optional) allocator specified at
276/// construction.
277///
278/// See @ref bdlma_sequentialallocator
280
281 // DATA
282 SequentialPool d_sequentialPool; // manager for allocated memory blocks
283
284 private:
285 // NOT IMPLEMENTED
287 SequentialAllocator& operator=(const SequentialAllocator&);
288
289 public:
290 // CREATORS
291
292 explicit SequentialAllocator(bslma::Allocator *basicAllocator = 0);
293 explicit SequentialAllocator(
294 bsls::BlockGrowth::Strategy growthStrategy,
295 bslma::Allocator *basicAllocator = 0);
296 explicit SequentialAllocator(
297 bsls::Alignment::Strategy alignmentStrategy,
298 bslma::Allocator *basicAllocator = 0);
299 /// Create a sequential allocator for allocating memory blocks from a
300 /// sequence of dynamically-allocated buffers. Optionally specify a
301 /// `basicAllocator` used to supply memory for the dynamically-allocated
302 /// buffers. If `basicAllocator` is 0, the currently installed default
303 /// allocator is used. Optionally specify a `growthStrategy` used to
304 /// control buffer growth. If no `growthStrategy` is specified,
305 /// geometric growth is used. Optionally specify an `alignmentStrategy`
306 /// used to control alignment of allocated memory blocks. If no
307 /// `alignmentStrategy` is specified, natural alignment is used. Note
308 /// that no limit is imposed on the size of the internal buffers when
309 /// geometric growth is used.
311 bsls::Alignment::Strategy alignmentStrategy,
312 bslma::Allocator *basicAllocator = 0);
313
314 explicit SequentialAllocator(int initialSize);
315 explicit SequentialAllocator(bsls::Types::size_type initialSize,
316 bslma::Allocator *basicAllocator = 0);
318 bsls::BlockGrowth::Strategy growthStrategy,
319 bslma::Allocator *basicAllocator = 0);
321 bsls::Alignment::Strategy alignmentStrategy,
322 bslma::Allocator *basicAllocator = 0);
323 /// Create a sequential allocator for allocating memory blocks from a
324 /// sequence of dynamically-allocated buffers, of which the initial
325 /// buffer has the specified `initialSize` (in bytes). Optionally
326 /// specify a `basicAllocator` used to supply memory for the
327 /// dynamically-allocated buffers. If `basicAllocator` is 0, the
328 /// currently installed default allocator is used. Optionally specify a
329 /// `growthStrategy` used to control buffer growth. If no
330 /// `growthStrategy` is specified, geometric growth is used. Optionally
331 /// specify an `alignmentStrategy` used to control alignment of
332 /// allocated memory blocks. If no `alignmentStrategy` is specified,
333 /// natural alignment is used. An implementation-defined value is used
334 /// as the initial size of the internal buffer. The behavior is
335 /// undefined unless `0 < initialSize`. Note that no limit is imposed
336 /// on the size of the internal buffers when geometric growth is used.
337 /// Also note that when constant growth is used, the size of the
338 /// internal buffers will always be the same as the
339 /// implementation-defined value. Also note that
340 /// `SequentialAllocator(int initialSize)` is provided to avoid
341 /// ambiguous definitions.
343 bsls::BlockGrowth::Strategy growthStrategy,
344 bsls::Alignment::Strategy alignmentStrategy,
345 bslma::Allocator *basicAllocator = 0);
346
348 bsls::Types::size_type maxBufferSize,
349 bslma::Allocator *basicAllocator = 0);
351 bsls::Types::size_type maxBufferSize,
352 bsls::BlockGrowth::Strategy growthStrategy,
353 bslma::Allocator *basicAllocator = 0);
355 bsls::Types::size_type maxBufferSize,
356 bsls::Alignment::Strategy alignmentStrategy,
357 bslma::Allocator *basicAllocator = 0);
358 /// Create a sequential allocator for allocating memory blocks from a
359 /// sequence of dynamically-allocated buffers, of which the initial
360 /// buffer has the specified `initialSize` (in bytes), and the buffer
361 /// growth is limited to the specified `maxBufferSize`. Optionally
362 /// specify a `basicAllocator` used to supply memory for the
363 /// dynamically-allocated buffers. If `basicAllocator` is 0, the
364 /// currently installed default allocator is used. Optionally specify a
365 /// `growthStrategy` used to control buffer growth. If no
366 /// `growthStrategy` is specified, geometric growth is used. Optionally
367 /// specify an `alignmentStrategy` used to control alignment of
368 /// allocated memory blocks. If no `alignmentStrategy` is specified,
369 /// natural alignment is used. The behavior is undefined unless
370 /// `0 < initialSize` and `initialSize <= maxBufferSize`. Note that
371 /// when constant growth is used, the size of the internal buffers will
372 /// always be the same as `initialSize`.
374 bsls::Types::size_type maxBufferSize,
375 bsls::BlockGrowth::Strategy growthStrategy,
376 bsls::Alignment::Strategy alignmentStrategy,
377 bslma::Allocator *basicAllocator = 0);
378
379 /// Destroy this sequential allocator. All memory allocated from this
380 /// allocator is released.
382
383 // MANIPULATORS
384
385 /// Return the address of a contiguous block of memory of the specified
386 /// `size` (in bytes) according to the alignment strategy specified at
387 /// construction. If `size` is 0, no memory is allocated and 0 is
388 /// returned. If the allocation request exceeds the remaining free
389 /// memory space in the current internal buffer, use the allocator
390 /// supplied at construction to allocate a new internal buffer, then
391 /// allocate memory from the new buffer.
392 void *allocate(bsls::Types::size_type size) BSLS_KEYWORD_OVERRIDE;
393
394 /// Return the address of a contiguous block of memory of at least the
395 /// specified `*size` (in bytes), and load the actual amount of memory
396 /// allocated into `*size`. If `*size` is 0, return 0 with no effect.
397 /// If the allocation request exceeds the remaining free memory space in
398 /// the current internal buffer, use the allocator supplied at
399 /// construction to allocate a new internal buffer, then allocate memory
400 /// from the new buffer.
401 void *allocateAndExpand(bsls::Types::size_type *size);
402
403 /// This method has no effect on the memory block at the specified
404 /// `address` as all memory allocated by this allocator is managed. The
405 /// behavior is undefined unless `address` is 0, or was allocated by
406 /// this allocator and has not already been deallocated.
407 void deallocate(void *address) BSLS_KEYWORD_OVERRIDE;
408
409 /// Release all memory allocated through this allocator and return to
410 /// the underlying allocator *all* memory. The allocator is reset to
411 /// its default-constructed state, retaining the alignment and growth
412 /// strategies, and the initial and maximum buffer sizes in effect
413 /// following construction. The effect of subsequently - to this
414 /// invokation of `release` - using a pointer obtained from this object
415 /// prior to this call to `release` is undefined.
417
418 /// Release all memory allocated through this allocator and return to
419 /// the underlying allocator *only* memory that was allocated outside of
420 /// the typical internal buffer growth of this allocator (i.e., large
421 /// blocks). All retained memory will be used to satisfy subsequent
422 /// allocations. The effect of subsequently - to this invokation of
423 /// `rewind` - using a pointer obtained from this object prior to this
424 /// call to `rewind` is undefined.
425 virtual void rewind();
426
427 /// Reserve sufficient memory to satisfy allocation requests for at
428 /// least the specified `numBytes` without replenishment (i.e., without
429 /// dynamic allocation). If `numBytes` is 0, no memory is reserved.
430 /// Note that, when the `numBytes` is distributed over multiple
431 /// `allocate` requests - due to alignment effects - it is possible that
432 /// not all `numBytes` of memory will be used for allocation before
433 /// triggering dynamic allocation.
434 void reserveCapacity(bsls::Types::size_type numBytes);
435
436 /// Reduce the amount of memory allocated at the specified `address` of
437 /// the specified `originalSize` (in bytes) to the specified `newSize`.
438 /// Return `newSize` after truncating, or `originalSize` if the memory
439 /// block at `address` cannot be truncated. This method can only
440 /// `truncate` the memory block returned by the most recent `allocate`
441 /// request from this allocator, and otherwise has no effect. The
442 /// behavior is undefined unless the memory block at `address` was
443 /// originally allocated by this allocator, the size of the memory block
444 /// at `address` is `originalSize`, `newSize <= originalSize`, and
445 /// `release` was not called after allocating the memory block at
446 /// `address`.
447 bsls::Types::size_type truncate(void *address,
448 bsls::Types::size_type originalSize,
449 bsls::Types::size_type newSize);
450};
451
452// ============================================================================
453// INLINE DEFINITIONS
454// ============================================================================
455
456 // -------------------------
457 // class SequentialAllocator
458 // -------------------------
459
460// CREATORS
461inline
463SequentialAllocator(bslma::Allocator *basicAllocator)
464: d_sequentialPool(basicAllocator)
465{
466}
467
468inline
469SequentialAllocator::
470SequentialAllocator(bsls::BlockGrowth::Strategy growthStrategy,
471 bslma::Allocator *basicAllocator)
472: d_sequentialPool(growthStrategy, basicAllocator)
473{
474}
475
476inline
477SequentialAllocator::
478SequentialAllocator(bsls::Alignment::Strategy alignmentStrategy,
479 bslma::Allocator *basicAllocator)
480: d_sequentialPool(alignmentStrategy, basicAllocator)
481{
482}
483
484inline
485SequentialAllocator::
486SequentialAllocator(bsls::BlockGrowth::Strategy growthStrategy,
487 bsls::Alignment::Strategy alignmentStrategy,
488 bslma::Allocator *basicAllocator)
489: d_sequentialPool(growthStrategy, alignmentStrategy, basicAllocator)
490{
491}
492
493inline
494SequentialAllocator::
495SequentialAllocator(int initialSize)
496: d_sequentialPool(initialSize)
497{
498 BSLS_ASSERT(0 < initialSize);
499}
500
501inline
502SequentialAllocator::
503SequentialAllocator(bsls::Types::size_type initialSize,
504 bslma::Allocator *basicAllocator)
505: d_sequentialPool(initialSize, basicAllocator)
506{
507 BSLS_ASSERT(0 < initialSize);
508}
509
510inline
511SequentialAllocator::
512SequentialAllocator(bsls::Types::size_type initialSize,
513 bsls::BlockGrowth::Strategy growthStrategy,
514 bslma::Allocator *basicAllocator)
515: d_sequentialPool(initialSize, growthStrategy, basicAllocator)
516{
517 BSLS_ASSERT(0 < initialSize);
518}
519
520inline
521SequentialAllocator::
522SequentialAllocator(bsls::Types::size_type initialSize,
523 bsls::Alignment::Strategy alignmentStrategy,
524 bslma::Allocator *basicAllocator)
525: d_sequentialPool(initialSize, alignmentStrategy, basicAllocator)
526{
527 BSLS_ASSERT(0 < initialSize);
528}
529
530inline
531SequentialAllocator::
532SequentialAllocator(bsls::Types::size_type initialSize,
533 bsls::BlockGrowth::Strategy growthStrategy,
534 bsls::Alignment::Strategy alignmentStrategy,
535 bslma::Allocator *basicAllocator)
536: d_sequentialPool(initialSize,
537 growthStrategy,
538 alignmentStrategy,
539 basicAllocator)
540{
541 BSLS_ASSERT(0 < initialSize);
542}
543
544inline
545SequentialAllocator::
546SequentialAllocator(bsls::Types::size_type initialSize,
547 bsls::Types::size_type maxBufferSize,
548 bslma::Allocator *basicAllocator)
549: d_sequentialPool(initialSize, maxBufferSize, basicAllocator)
550{
551 BSLS_ASSERT(0 < initialSize);
552 BSLS_ASSERT(initialSize <= maxBufferSize);
553}
554
555inline
556SequentialAllocator::
557SequentialAllocator(bsls::Types::size_type initialSize,
558 bsls::Types::size_type maxBufferSize,
559 bsls::BlockGrowth::Strategy growthStrategy,
560 bslma::Allocator *basicAllocator)
561: d_sequentialPool(initialSize, maxBufferSize, growthStrategy, basicAllocator)
562{
563 BSLS_ASSERT(0 < initialSize);
564 BSLS_ASSERT(initialSize <= maxBufferSize);
565}
566
567inline
568SequentialAllocator::
569SequentialAllocator(bsls::Types::size_type initialSize,
570 bsls::Types::size_type maxBufferSize,
571 bsls::Alignment::Strategy alignmentStrategy,
572 bslma::Allocator *basicAllocator)
573: d_sequentialPool(initialSize,
574 maxBufferSize,
575 alignmentStrategy,
576 basicAllocator)
577{
578 BSLS_ASSERT(0 < initialSize);
579 BSLS_ASSERT(initialSize <= maxBufferSize);
580}
581
582inline
583SequentialAllocator::
584SequentialAllocator(bsls::Types::size_type initialSize,
585 bsls::Types::size_type maxBufferSize,
586 bsls::BlockGrowth::Strategy growthStrategy,
587 bsls::Alignment::Strategy alignmentStrategy,
588 bslma::Allocator *basicAllocator)
589: d_sequentialPool(initialSize,
590 maxBufferSize,
591 growthStrategy,
592 alignmentStrategy,
593 basicAllocator)
594{
595 BSLS_ASSERT(0 < initialSize);
596 BSLS_ASSERT(initialSize <= maxBufferSize);
597}
598
599// MANIPULATORS
600inline
602{
603 return d_sequentialPool.allocate(size);
604}
605
606inline
608{
609 return d_sequentialPool.allocateAndExpand(size);
610}
611
612inline
614{
615}
616
617inline
619{
620 d_sequentialPool.release();
621}
622
623inline
625{
626 d_sequentialPool.reserveCapacity(numBytes);
627}
628
629inline
631{
632 d_sequentialPool.rewind();
633}
634
635inline
637 void *address,
638 bsls::Types::size_type originalSize,
640{
641 return d_sequentialPool.truncate(address, originalSize, newSize);
642}
643
644} // close package namespace
645
646
647#endif
648
649// ----------------------------------------------------------------------------
650// Copyright 2016 Bloomberg Finance L.P.
651//
652// Licensed under the Apache License, Version 2.0 (the "License");
653// you may not use this file except in compliance with the License.
654// You may obtain a copy of the License at
655//
656// http://www.apache.org/licenses/LICENSE-2.0
657//
658// Unless required by applicable law or agreed to in writing, software
659// distributed under the License is distributed on an "AS IS" BASIS,
660// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
661// See the License for the specific language governing permissions and
662// limitations under the License.
663// ----------------------------- END-OF-FILE ----------------------------------
664
665/** @} */
666/** @} */
667/** @} */
Definition bdlma_managedallocator.h:391
Definition bdlma_sequentialallocator.h:279
~SequentialAllocator() BSLS_KEYWORD_OVERRIDE
void release() BSLS_KEYWORD_OVERRIDE
Definition bdlma_sequentialallocator.h:618
bsls::Types::size_type truncate(void *address, bsls::Types::size_type originalSize, bsls::Types::size_type newSize)
Definition bdlma_sequentialallocator.h:636
void * allocate(bsls::Types::size_type size) BSLS_KEYWORD_OVERRIDE
Definition bdlma_sequentialallocator.h:601
void * allocateAndExpand(bsls::Types::size_type *size)
Definition bdlma_sequentialallocator.h:607
void reserveCapacity(bsls::Types::size_type numBytes)
Definition bdlma_sequentialallocator.h:624
void deallocate(void *address) BSLS_KEYWORD_OVERRIDE
Definition bdlma_sequentialallocator.h:613
virtual void rewind()
Definition bdlma_sequentialallocator.h:630
Definition bdlma_sequentialpool.h:378
void reserveCapacity(bsls::Types::size_type numBytes)
void * allocate(bsls::Types::size_type size)
Definition bdlma_sequentialpool.h:756
bsls::Types::size_type truncate(void *address, bsls::Types::size_type originalSize, bsls::Types::size_type newSize)
Definition bdlma_sequentialpool.h:800
void * allocateAndExpand(bsls::Types::size_type *size)
Definition bdlma_sequentialpool.h:767
Definition bslma_allocator.h:457
std::size_t size_type
Definition bslma_allocator.h:499
#define BSLS_ASSERT(X)
Definition bsls_assert.h:1804
#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
Types of alignment strategy.
Definition bsls_alignment.h:239
Strategy
Definition bsls_blockgrowth.h:169
std::size_t size_type
Definition bsls_types.h:124