From 7ee347e13ced7f1a84e7b325e65616b169e238a0 Mon Sep 17 00:00:00 2001 From: Dennis Brentjes Date: Thu, 1 Dec 2016 18:24:41 +0100 Subject: Use the new protobuf arena allocator. Run script now takes a parameter tool to for instance "benchmark" --- node/node.hpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'node/node.hpp') diff --git a/node/node.hpp b/node/node.hpp index a058916..3233ba2 100644 --- a/node/node.hpp +++ b/node/node.hpp @@ -9,6 +9,7 @@ #include "cmix.h" #include "cmix.pb.h" +#include #include @@ -49,6 +50,15 @@ struct NodeNetworkSettings { unsigned int minimum_nr_messages; ///< The minimum number of available messages before starting to run a mix; }; +template +struct ArenaMessage { + google::protobuf::Arena arena; + + T& get() { + return *google::protobuf::Arena::CreateMessage(&arena); + } +}; + /*! * \brief The Node class */ -- cgit v1.2.3-70-g09d2