FairMQ: Add hint argument to the region callback, settable per message.

This commit is contained in:
Alexey Rybalchenko 2017-12-15 14:44:17 +01:00
parent 044453ca96
commit 5e99fa2eab

View File

@ -38,7 +38,7 @@ void FairMQExampleRegionSampler::InitTask()
fRegion = FairMQUnmanagedRegionPtr(NewUnmanagedRegionFor("data",
0,
10000000,
[this](void* data, size_t size) { // callback to be called when message buffers no longer needed by transport
[this](void* data, size_t size, void* hint) { // callback to be called when message buffers no longer needed by transport
--fNumUnackedMsgs;
if (fMaxIterations > 0)
{
@ -54,8 +54,10 @@ bool FairMQExampleRegionSampler::ConditionalRun()
0, // sub-channel
fRegion, // region
fRegion->GetData(), // ptr within region
fMsgSize // offset from ptr
fMsgSize, // offset from ptr
nullptr // hint
));
if (Send(msg, "data", 0) > 0)
{
++fNumUnackedMsgs;