Extend the FairMQ transport interface by allowing the user of the FairMQMessage class to define his own deallocation function.

This function will be called when the transport machanism no longer needs the data.

Use this extension with the Protobuf data format, to enable more efficient transport, avoiding memcpy.
This commit is contained in:
Alexey Rybalchenko
2014-06-12 12:47:49 +02:00
parent 865c0e010f
commit 699671a0f1
10 changed files with 38 additions and 18 deletions

View File

@@ -33,9 +33,9 @@ FairMQMessage* FairMQTransportFactoryZMQ::CreateMessage(size_t size)
return new FairMQMessageZMQ(size);
}
FairMQMessage* FairMQTransportFactoryZMQ::CreateMessage(void* data, size_t size)
FairMQMessage* FairMQTransportFactoryZMQ::CreateMessage(void* data, size_t size, fairmq_free_fn *ffn, void* hint)
{
return new FairMQMessageZMQ(data, size);
return new FairMQMessageZMQ(data, size, ffn, hint);
}
FairMQSocket* FairMQTransportFactoryZMQ::CreateSocket(const string& type, int num, int numIoThreads)