From b7c4bf711917dc5ae07fafea32d9d530d2383735 Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Wed, 14 Nov 2007 21:02:14 +0000 Subject: Replaced shared_ptr with intrusive_ptr for qpid::Broker::Message. Gives 9% reduction in broker heap use (perftest --count 100000.) git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@595056 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/tests/MessageUtils.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'cpp/src/tests/MessageUtils.h') diff --git a/cpp/src/tests/MessageUtils.h b/cpp/src/tests/MessageUtils.h index 7fb1755c4b..cf0f130fa6 100644 --- a/cpp/src/tests/MessageUtils.h +++ b/cpp/src/tests/MessageUtils.h @@ -23,15 +23,16 @@ #include "qpid/broker/MessageDelivery.h" #include "qpid/framing/AMQFrame.h" -using namespace qpid::broker; -using namespace qpid::framing; +using namespace qpid; +using namespace broker; +using namespace framing; struct MessageUtils { - static Message::shared_ptr createMessage(const string& exchange, const string& routingKey, + static intrusive_ptr createMessage(const string& exchange, const string& routingKey, const string& messageId, uint64_t contentSize = 0) { - Message::shared_ptr msg(new Message()); + intrusive_ptr msg(new Message()); AMQFrame method(0, MessageTransferBody(ProtocolVersion(), 0, exchange, 0, 0)); AMQFrame header(0, AMQHeaderBody()); @@ -45,7 +46,7 @@ struct MessageUtils return msg; } - static void addContent(Message::shared_ptr msg, const string& data) + static void addContent(intrusive_ptr msg, const string& data) { AMQFrame content(0, AMQContentBody(data)); msg->getFrames().append(content); -- cgit v1.2.1