Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[APPROVAL] review/issue-104-fix-bufferallocator-example-drqs-47757222…

… to master
  • Loading branch information...
commit 8bc5412ecdffa973f31cdce3b5f55c53e2149ab6 2 parents 5071fac + 1e9197e
@abeels abeels authored
View
4 samples/buffer_allocator/bufferallocator.cpp
@@ -12,13 +12,13 @@ namespace pkg {
// ---------------------
// MANIPULATORS
-void *BufferAllocator::allocate(bsls_Types::size_type size)
+void *BufferAllocator::allocate(bsls::Types::size_type size)
{
BSLS_ASSERT_SAFE(0 <= size);
// Calculate the appropriate aligned offset
- const int offset = bsls_AlignmentUtil::calculateAlignmentOffset(
+ const int offset = bsls::AlignmentUtil::calculateAlignmentOffset(
d_buffer_p + d_cursor,
bsls::AlignmentUtil::BSLS_MAX_ALIGNMENT);
View
3  samples/buffer_allocator/bufferallocator.h
@@ -90,7 +90,7 @@ class BufferAllocator : public bslma::Allocator {
// incurred.
// MANIPULATORS
- virtual void *allocate(bsls_Types::size_type size);
+ virtual void *allocate(bsls::Types::size_type size);
// Return the address of a contiguous block of maximally-aligned memory
// of the specified 'size' (in bytes). If 'size' is 0 no memory is
// allocated and 0 is returned. If the allocation request exceeds the
@@ -118,6 +118,7 @@ BufferAllocator::BufferAllocator(char *buffer,
bslma::Allocator *basicAllocator)
: d_buffer_p(buffer)
, d_bufferSize(bufferSize)
+, d_cursor(0)
, d_allocator_p(bslma::Default::allocator(basicAllocator))
{
}
Please sign in to comment.
Something went wrong with that request. Please try again.