diff options
| author | Alan Conway <aconway@apache.org> | 2007-11-14 21:02:14 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2007-11-14 21:02:14 +0000 |
| commit | 19233146427526f3411fd115f0c7d6b21f097085 (patch) | |
| tree | c9f441946250c09cc99c5329ec182bab039926f3 /qpid/cpp/src/tests/MessageUtils.h | |
| parent | 6f4dce11d203ec606650497fa64f1519ecdf43c3 (diff) | |
| download | qpid-python-19233146427526f3411fd115f0c7d6b21f097085.tar.gz | |
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@595056 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/tests/MessageUtils.h')
| -rw-r--r-- | qpid/cpp/src/tests/MessageUtils.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/qpid/cpp/src/tests/MessageUtils.h b/qpid/cpp/src/tests/MessageUtils.h index 7fb1755c4b..cf0f130fa6 100644 --- a/qpid/cpp/src/tests/MessageUtils.h +++ b/qpid/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<Message> createMessage(const string& exchange, const string& routingKey, const string& messageId, uint64_t contentSize = 0) { - Message::shared_ptr msg(new Message()); + intrusive_ptr<Message> 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<Message> msg, const string& data) { AMQFrame content(0, AMQContentBody(data)); msg->getFrames().append(content); |
