BDE 4.39.x 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/// /// This class implements a stack that stores `double` values.
138/// class my_DoubleStack {
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///
149/// /// Increase the capacity of this stack by at least one element.
150/// void increaseCapacity();
151///
152/// // Not implemented:
153/// my_DoubleStack(const my_DoubleStack&);
154///
155/// public:
156/// // CREATORS
157///
158/// /// Create a stack that stores `double` values. Optionally specify
159/// /// a `basicAllocator` used to supply memory. If `basicAllocator`
160/// /// is 0, the currently installed default allocator is used.
161/// explicit my_DoubleStack(bslma::Allocator *basicAllocator = 0);
162///
163/// /// Destroy this stack and all elements held by it.
164/// ~my_DoubleStack();
165///
166/// // ...
167///
168/// // MANIPULATORS
169///
170/// /// Push the specified `value` onto this stack.
171/// void push(double value);
172///
173/// // ...
174/// };
175///
176/// // ...
177///
178/// // MANIPULATORS
179/// inline
180/// void my_DoubleStack::push(double value)
181/// {
182/// if (d_length >= d_size) {
183/// increaseCapacity();
184/// }
185/// d_stack_p[d_length++] = value;
186/// }
187///
188/// // ...
189///
190/// // my_doublestack.cpp
191///
192/// // PRIVATE MANIPULATORS
193/// void my_DoubleStack::increaseCapacity()
194/// {
195/// // Implementation elided.
196/// // ...
197/// }
198///
199/// // CREATORS
200/// my_DoubleStack::my_DoubleStack(bslma::Allocator *basicAllocator)
201/// : d_size(1)
202/// , d_length(0)
203/// , d_allocator_p(bslma::Default::allocator(basicAllocator))
204/// {
205/// d_stack_p = static_cast<double *>(
206/// d_allocator_p->allocate(d_size * sizeof *d_stack_p));
207/// }
208/// @endcode
209/// Note that, when the allocator passed in is a `bdlma::SequentialAllocator`,
210/// the `deallocate` method is a no-op, and all memory is reclaimed during the
211/// destruction of the allocator:
212/// @code
213/// my_DoubleStack::~my_DoubleStack()
214/// {
215/// // CLASS INVARIANTS
216/// assert(d_allocator_p);
217/// assert(d_stack_p);
218/// assert(0 <= d_length);
219/// assert(0 <= d_size);
220/// assert(d_length <= d_size);
221///
222/// d_allocator_p->deallocate(d_stack_p);
223/// }
224///
225/// // ...
226/// @endcode
227/// In `main`, users can create a `bdlma::SequentialAllocator` and pass it to
228/// the constructor of `my_DoubleStack`:
229/// @code
230/// bdlma::SequentialAllocator sequentialAlloc;
231/// my_DoubleStack dstack(&sequentialAlloc);
232/// @endcode
233/// @}
234/** @} */
235/** @} */
236
237/** @addtogroup bdl
238 * @{
239 */
240/** @addtogroup bdlma
241 * @{
242 */
243/** @addtogroup bdlma_sequentialallocator
244 * @{
245 */
246
247#include <bdlscm_version.h>
248
250#include <bdlma_sequentialpool.h>
251
252#include <bslma_allocator.h>
253
254#include <bsls_alignment.h>
255#include <bsls_assert.h>
256#include <bsls_blockgrowth.h>
257#include <bsls_keyword.h>
258#include <bsls_performancehint.h>
259#include <bsls_review.h>
260#include <bsls_types.h>
261
262
263namespace bdlma {
264
265 // =========================
266 // class SequentialAllocator
267 // =========================
268
269/// This class implements the `ManagedAllocator` protocol to provide a fast
270/// allocator that dispenses heterogeneous blocks of memory (of varying,
271/// user-specified sizes) from a sequence of dynamically-allocated buffers.
272/// Memory for the internal buffers is supplied by an (optional) allocator
273/// supplied at construction; if no allocator is supplied, the currently
274/// installed default allocator is used. If an allocation exceeds the
275/// remaining free memory space in the current buffer, the allocator
276/// replenishes its internal buffer with new memory to satisfy the request.
277/// This class is *exception* *neutral*: If memory cannot be allocated, the
278/// behavior is defined by the (optional) allocator specified at
279/// construction.
280///
281/// See @ref bdlma_sequentialallocator
283
284 // DATA
285 SequentialPool d_sequentialPool; // manager for allocated memory blocks
286
287 private:
288 // NOT IMPLEMENTED
290 SequentialAllocator& operator=(const SequentialAllocator&);
291
292 public:
293 // CREATORS
294
295 /// Create a sequential allocator for allocating memory blocks from a
296 /// sequence of dynamically-allocated buffers. Optionally specify a
297 /// `basicAllocator` used to supply memory for the dynamically-allocated
298 /// buffers. If `basicAllocator` is 0, the currently installed default
299 /// allocator is used. Optionally specify a `growthStrategy` used to
300 /// control buffer growth. If no `growthStrategy` is specified, geometric
301 /// growth is used. Optionally specify an `alignmentStrategy` used to
302 /// control alignment of allocated memory blocks. If no
303 /// `alignmentStrategy` is specified, natural alignment is used.
304 ///
305 /// \note Note that no limit is imposed on the size of the internal buffers when geometric
306 /// growth is used.
307 explicit SequentialAllocator(bslma::Allocator *basicAllocator = 0);
308 explicit SequentialAllocator(
309 bsls::BlockGrowth::Strategy growthStrategy,
310 bslma::Allocator *basicAllocator = 0);
311 explicit SequentialAllocator(
312 bsls::Alignment::Strategy alignmentStrategy,
313 bslma::Allocator *basicAllocator = 0);
315 bsls::Alignment::Strategy alignmentStrategy,
316 bslma::Allocator *basicAllocator = 0);
317
318 /// Create a sequential allocator for allocating memory blocks from a
319 /// sequence of dynamically-allocated buffers, of which the initial
320 /// buffer has the specified `initialSize` (in bytes). Optionally
321 /// specify a `basicAllocator` used to supply memory for the
322 /// dynamically-allocated buffers. If `basicAllocator` is 0, the
323 /// currently installed default allocator is used. Optionally specify a
324 /// `growthStrategy` used to control buffer growth. If no
325 /// `growthStrategy` is specified, geometric growth is used. Optionally
326 /// specify an `alignmentStrategy` used to control alignment of
327 /// allocated memory blocks. If no `alignmentStrategy` is specified,
328 /// natural alignment is used. An implementation-defined value is used
329 /// as the initial size of the internal buffer.
330 ///
331 /// \pre The behavior is undefined unless `0 < initialSize`.
332 /// \note Note that no limit is imposed
333 /// on the size of the internal buffers when geometric growth is used.
334 /// Also note that when constant growth is used, the size of the
335 /// internal buffers will always be the same as the
336 /// implementation-defined value. Also note that
337 /// `SequentialAllocator(int initialSize)` is provided to avoid
338 /// ambiguous definitions.
339 explicit SequentialAllocator(int initialSize);
340 explicit SequentialAllocator(bsls::Types::size_type initialSize,
341 bslma::Allocator *basicAllocator = 0);
343 bsls::BlockGrowth::Strategy growthStrategy,
344 bslma::Allocator *basicAllocator = 0);
346 bsls::Alignment::Strategy alignmentStrategy,
347 bslma::Allocator *basicAllocator = 0);
349 bsls::BlockGrowth::Strategy growthStrategy,
350 bsls::Alignment::Strategy alignmentStrategy,
351 bslma::Allocator *basicAllocator = 0);
352
353 /// Create a sequential allocator for allocating memory blocks from a
354 /// sequence of dynamically-allocated buffers, of which the initial
355 /// buffer has the specified `initialSize` (in bytes), and the buffer
356 /// growth is limited to the specified `maxBufferSize`. Optionally
357 /// specify a `basicAllocator` used to supply memory for the
358 /// dynamically-allocated buffers. If `basicAllocator` is 0, the
359 /// currently installed default allocator is used. Optionally specify a
360 /// `growthStrategy` used to control buffer growth. If no
361 /// `growthStrategy` is specified, geometric growth is used. Optionally
362 /// specify an `alignmentStrategy` used to control alignment of
363 /// allocated memory blocks. If no `alignmentStrategy` is specified, natural alignment is used.
364 ///
365 /// \pre The behavior is undefined unless
366 /// `0 < initialSize` and `initialSize <= maxBufferSize`.
367 ///
368 /// \note Note that when constant growth is used, the size of the internal buffers will
369 /// always be the same as `initialSize`.
371 bsls::Types::size_type maxBufferSize,
372 bslma::Allocator *basicAllocator = 0);
374 bsls::Types::size_type maxBufferSize,
375 bsls::BlockGrowth::Strategy growthStrategy,
376 bslma::Allocator *basicAllocator = 0);
378 bsls::Types::size_type maxBufferSize,
379 bsls::Alignment::Strategy alignmentStrategy,
380 bslma::Allocator *basicAllocator = 0);
382 bsls::Types::size_type maxBufferSize,
383 bsls::BlockGrowth::Strategy growthStrategy,
384 bsls::Alignment::Strategy alignmentStrategy,
385 bslma::Allocator *basicAllocator = 0);
386
387 /// Destroy this sequential allocator. All memory allocated from this
388 /// allocator is released.
390
391 // MANIPULATORS
392
393 /// Return the address of a contiguous block of memory of the specified
394 /// `size` (in bytes) according to the alignment strategy specified at
395 /// construction. If `size` is 0, no memory is allocated and 0 is
396 /// returned. If the allocation request exceeds the remaining free
397 /// memory space in the current internal buffer, use the allocator
398 /// supplied at construction to allocate a new internal buffer, then
399 /// allocate memory from the new buffer.
400 void *allocate(bsls::Types::size_type size) BSLS_KEYWORD_OVERRIDE;
401
402 /// Return the address of a contiguous block of memory of at least the
403 /// specified `*size` (in bytes), and load the actual amount of memory
404 /// allocated into `*size`. If `*size` is 0, return 0 with no effect.
405 /// If the allocation request exceeds the remaining free memory space in
406 /// the current internal buffer, use the allocator supplied at
407 /// construction to allocate a new internal buffer, then allocate memory
408 /// from the new buffer.
409 void *allocateAndExpand(bsls::Types::size_type *size);
410
411 /// This method has no effect on the memory block at the specified
412 /// `address` as all memory allocated by this allocator is managed.
413 ///
414 /// \pre The behavior is undefined unless `address` is 0, or was allocated by
415 /// this allocator and has not already been deallocated.
416 void deallocate(void *address) BSLS_KEYWORD_OVERRIDE;
417
418 /// Release all memory allocated through this allocator and return to
419 /// the underlying allocator *all* memory. The allocator is reset to
420 /// its default-constructed state, retaining the alignment and growth
421 /// strategies, and the initial and maximum buffer sizes in effect
422 /// following construction. The effect of subsequently - to this
423 /// invokation of `release` - using a pointer obtained from this object
424 /// prior to this call to `release` is undefined.
426
427 /// Release all memory allocated through this allocator and return to
428 /// the underlying allocator *only* memory that was allocated outside of
429 /// the typical internal buffer growth of this allocator (i.e., large
430 /// blocks). All retained memory will be used to satisfy subsequent
431 /// allocations. The effect of subsequently - to this invokation of
432 /// `rewind` - using a pointer obtained from this object prior to this
433 /// call to `rewind` is undefined.
434 virtual void rewind();
435
436 /// Reserve sufficient memory to satisfy allocation requests for at
437 /// least the specified `numBytes` without replenishment (i.e., without
438 /// dynamic allocation). If `numBytes` is 0, no memory is reserved.
439 ///
440 /// \note Note that, when the `numBytes` is distributed over multiple
441 /// `allocate` requests - due to alignment effects - it is possible that
442 /// not all `numBytes` of memory will be used for allocation before
443 /// triggering dynamic allocation.
444 void reserveCapacity(bsls::Types::size_type numBytes);
445
446 /// Reduce the amount of memory allocated at the specified `address` of
447 /// the specified `originalSize` (in bytes) to the specified `newSize`.
448 /// Return `newSize` after truncating, or `originalSize` if the memory
449 /// block at `address` cannot be truncated. This method can only
450 /// `truncate` the memory block returned by the most recent `allocate`
451 /// request from this allocator, and otherwise has no effect.
452 ///
453 /// \pre The behavior is undefined unless the memory block at `address` was
454 /// originally allocated by this allocator, the size of the memory block
455 /// at `address` is `originalSize`, `newSize <= originalSize`, and
456 /// `release` was not called after allocating the memory block at
457 /// `address`.
458 bsls::Types::size_type truncate(void *address,
459 bsls::Types::size_type originalSize,
460 bsls::Types::size_type newSize);
461};
462
463// ============================================================================
464// INLINE DEFINITIONS
465// ============================================================================
466
467 // -------------------------
468 // class SequentialAllocator
469 // -------------------------
470
471// CREATORS
472inline
474SequentialAllocator(bslma::Allocator *basicAllocator)
475: d_sequentialPool(basicAllocator)
476{
477}
478
479inline
480SequentialAllocator::
481SequentialAllocator(bsls::BlockGrowth::Strategy growthStrategy,
482 bslma::Allocator *basicAllocator)
483: d_sequentialPool(growthStrategy, basicAllocator)
484{
485}
486
487inline
488SequentialAllocator::
489SequentialAllocator(bsls::Alignment::Strategy alignmentStrategy,
490 bslma::Allocator *basicAllocator)
491: d_sequentialPool(alignmentStrategy, basicAllocator)
492{
493}
494
495inline
496SequentialAllocator::
497SequentialAllocator(bsls::BlockGrowth::Strategy growthStrategy,
498 bsls::Alignment::Strategy alignmentStrategy,
499 bslma::Allocator *basicAllocator)
500: d_sequentialPool(growthStrategy, alignmentStrategy, basicAllocator)
501{
502}
503
504inline
505SequentialAllocator::
506SequentialAllocator(int initialSize)
507: d_sequentialPool(initialSize)
508{
509 BSLS_ASSERT(0 < initialSize);
510}
511
512inline
513SequentialAllocator::
514SequentialAllocator(bsls::Types::size_type initialSize,
515 bslma::Allocator *basicAllocator)
516: d_sequentialPool(initialSize, basicAllocator)
517{
518 BSLS_ASSERT(0 < initialSize);
519}
520
521inline
522SequentialAllocator::
523SequentialAllocator(bsls::Types::size_type initialSize,
524 bsls::BlockGrowth::Strategy growthStrategy,
525 bslma::Allocator *basicAllocator)
526: d_sequentialPool(initialSize, growthStrategy, basicAllocator)
527{
528 BSLS_ASSERT(0 < initialSize);
529}
530
531inline
532SequentialAllocator::
533SequentialAllocator(bsls::Types::size_type initialSize,
534 bsls::Alignment::Strategy alignmentStrategy,
535 bslma::Allocator *basicAllocator)
536: d_sequentialPool(initialSize, alignmentStrategy, basicAllocator)
537{
538 BSLS_ASSERT(0 < initialSize);
539}
540
541inline
542SequentialAllocator::
543SequentialAllocator(bsls::Types::size_type initialSize,
544 bsls::BlockGrowth::Strategy growthStrategy,
545 bsls::Alignment::Strategy alignmentStrategy,
546 bslma::Allocator *basicAllocator)
547: d_sequentialPool(initialSize,
548 growthStrategy,
549 alignmentStrategy,
550 basicAllocator)
551{
552 BSLS_ASSERT(0 < initialSize);
553}
554
555inline
556SequentialAllocator::
557SequentialAllocator(bsls::Types::size_type initialSize,
558 bsls::Types::size_type maxBufferSize,
559 bslma::Allocator *basicAllocator)
560: d_sequentialPool(initialSize, maxBufferSize, basicAllocator)
561{
562 BSLS_ASSERT(0 < initialSize);
563 BSLS_ASSERT(initialSize <= maxBufferSize);
564}
565
566inline
567SequentialAllocator::
568SequentialAllocator(bsls::Types::size_type initialSize,
569 bsls::Types::size_type maxBufferSize,
570 bsls::BlockGrowth::Strategy growthStrategy,
571 bslma::Allocator *basicAllocator)
572: d_sequentialPool(initialSize, maxBufferSize, growthStrategy, basicAllocator)
573{
574 BSLS_ASSERT(0 < initialSize);
575 BSLS_ASSERT(initialSize <= maxBufferSize);
576}
577
578inline
579SequentialAllocator::
580SequentialAllocator(bsls::Types::size_type initialSize,
581 bsls::Types::size_type maxBufferSize,
582 bsls::Alignment::Strategy alignmentStrategy,
583 bslma::Allocator *basicAllocator)
584: d_sequentialPool(initialSize,
585 maxBufferSize,
586 alignmentStrategy,
587 basicAllocator)
588{
589 BSLS_ASSERT(0 < initialSize);
590 BSLS_ASSERT(initialSize <= maxBufferSize);
591}
592
593inline
594SequentialAllocator::
595SequentialAllocator(bsls::Types::size_type initialSize,
596 bsls::Types::size_type maxBufferSize,
597 bsls::BlockGrowth::Strategy growthStrategy,
598 bsls::Alignment::Strategy alignmentStrategy,
599 bslma::Allocator *basicAllocator)
600: d_sequentialPool(initialSize,
601 maxBufferSize,
602 growthStrategy,
603 alignmentStrategy,
604 basicAllocator)
605{
606 BSLS_ASSERT(0 < initialSize);
607 BSLS_ASSERT(initialSize <= maxBufferSize);
608}
609
610// MANIPULATORS
611inline
613{
614 return d_sequentialPool.allocate(size);
615}
616
617inline
619{
620 return d_sequentialPool.allocateAndExpand(size);
621}
622
623inline
625{
626}
627
628inline
630{
631 d_sequentialPool.release();
632}
633
634inline
636{
637 d_sequentialPool.reserveCapacity(numBytes);
638}
639
640inline
642{
643 d_sequentialPool.rewind();
644}
645
646inline
648 void *address,
649 bsls::Types::size_type originalSize,
651{
652 return d_sequentialPool.truncate(address, originalSize, newSize);
653}
654
655} // close package namespace
656
657
658#endif
659
660// ----------------------------------------------------------------------------
661// Copyright 2016 Bloomberg Finance L.P.
662//
663// Licensed under the Apache License, Version 2.0 (the "License");
664// you may not use this file except in compliance with the License.
665// You may obtain a copy of the License at
666//
667// http://www.apache.org/licenses/LICENSE-2.0
668//
669// Unless required by applicable law or agreed to in writing, software
670// distributed under the License is distributed on an "AS IS" BASIS,
671// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
672// See the License for the specific language governing permissions and
673// limitations under the License.
674// ----------------------------- END-OF-FILE ----------------------------------
675
676/** @} */
677/** @} */
678/** @} */
Definition bdlma_managedallocator.h:392
Definition bdlma_sequentialallocator.h:282
~SequentialAllocator() BSLS_KEYWORD_OVERRIDE
void release() BSLS_KEYWORD_OVERRIDE
Definition bdlma_sequentialallocator.h:629
bsls::Types::size_type truncate(void *address, bsls::Types::size_type originalSize, bsls::Types::size_type newSize)
Definition bdlma_sequentialallocator.h:647
void * allocate(bsls::Types::size_type size) BSLS_KEYWORD_OVERRIDE
Definition bdlma_sequentialallocator.h:612
void * allocateAndExpand(bsls::Types::size_type *size)
Definition bdlma_sequentialallocator.h:618
void reserveCapacity(bsls::Types::size_type numBytes)
Definition bdlma_sequentialallocator.h:635
void deallocate(void *address) BSLS_KEYWORD_OVERRIDE
Definition bdlma_sequentialallocator.h:624
virtual void rewind()
Definition bdlma_sequentialallocator.h:641
Definition bdlma_sequentialpool.h:383
void reserveCapacity(bsls::Types::size_type numBytes)
void * allocate(bsls::Types::size_type size)
Definition bdlma_sequentialpool.h:777
bsls::Types::size_type truncate(void *address, bsls::Types::size_type originalSize, bsls::Types::size_type newSize)
Definition bdlma_sequentialpool.h:821
void * allocateAndExpand(bsls::Types::size_type *size)
Definition bdlma_sequentialpool.h:788
Definition bslma_allocator.h:545
std::size_t size_type
Definition bslma_allocator.h:593
#define BSLS_ASSERT(X)
Definition bsls_assert.h:1976
#define BSLS_IDENT(str)
BSLS_IDENT() - insert string into .comment binary segment (if supported)
Definition bsls_ident.h:238
#define BSLS_KEYWORD_OVERRIDE
Definition bsls_keyword.h:695
Definition bdlma_alignedallocator.h:278
Definition baljsn_encoder_testtypes.h:76
Definition bdlt_iso8601util.h:707
Strategy
Types of alignment strategy.
Definition bsls_alignment.h:241
Strategy
Definition bsls_blockgrowth.h:172
std::size_t size_type
Definition bsls_types.h:126