diff --git a/cpp/inc/bond/core/blob.h b/cpp/inc/bond/core/blob.h index 3f39fed5..2bea533a 100644 --- a/cpp/inc/bond/core/blob.h +++ b/cpp/inc/bond/core/blob.h @@ -291,7 +291,7 @@ inline blob merge(const A& allocator, const blob& x, const blob& y) else { uint32_t length = x.length() + y.length(); - boost::shared_ptr buffer = boost::allocate_shared(allocator, length); + boost::shared_ptr buffer = boost::allocate_shared_noinit(allocator, length); ::memcpy(buffer.get(), x.content(), x.length()); ::memcpy(buffer.get() + x.length(), y.content(), y.length()); @@ -334,7 +334,7 @@ inline blob merge(const A& allocator, t_It begin, t_It end) // BOOST_ASSERT(length > begin->length()); - boost::shared_ptr buffer = boost::allocate_shared(allocator, length); + boost::shared_ptr buffer = boost::allocate_shared_noinit(allocator, length); uint32_t offset = 0; for (t_It it = begin; it != end; ++it) diff --git a/cpp/inc/bond/protocol/simple_json_reader_impl.h b/cpp/inc/bond/protocol/simple_json_reader_impl.h index 278fe7a5..1b857997 100644 --- a/cpp/inc/bond/protocol/simple_json_reader_impl.h +++ b/cpp/inc/bond/protocol/simple_json_reader_impl.h @@ -56,7 +56,7 @@ inline void DeserializeContainer(blob& var, const T& /*element*/, SimpleJsonRead { if (uint32_t size = reader.ArraySize()) { - boost::shared_ptr buffer = boost::make_shared(size); + boost::shared_ptr buffer = boost::make_shared_noinit(size); uint32_t i = 0; for (rapidjson::Value::ConstValueIterator it = reader.ArrayBegin(), end = reader.ArrayEnd(); it != end && i < size; ++it) diff --git a/cpp/inc/bond/stream/output_buffer.h b/cpp/inc/bond/stream/output_buffer.h index da8584df..4d440789 100644 --- a/cpp/inc/bond/stream/output_buffer.h +++ b/cpp/inc/bond/stream/output_buffer.h @@ -119,7 +119,7 @@ public: uint32_t minChanningSize = 32, uint32_t maxChainLength = (uint32_t)-1) : _allocator(allocator), - _buffer(boost::allocate_shared(_allocator, reserveSize)), + _buffer(boost::allocate_shared_noinit(_allocator, reserveSize)), _bufferSize(reserveSize), _rangeSize(0), _rangeOffset(0), @@ -238,7 +238,7 @@ public: _bufferSize += _bufferSize ? _bufferSize / 2 : 4096; _bufferSize = (std::max)(_bufferSize, size); - _buffer = boost::allocate_shared(_allocator, _bufferSize); + _buffer = boost::allocate_shared_noinit(_allocator, _bufferSize); // // init range diff --git a/examples/cpp/core/bf/input_file.h b/examples/cpp/core/bf/input_file.h index 2af12d98..d19e3c85 100644 --- a/examples/cpp/core/bf/input_file.h +++ b/examples/cpp/core/bf/input_file.h @@ -57,7 +57,7 @@ public: void Read(bond::blob& blob, uint32_t size) { - boost::shared_ptr buffer = boost::make_shared(size); + boost::shared_ptr buffer = boost::make_shared_noinit(size); Read(buffer.get(), size); blob.assign(buffer, 0, size);