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 committed by Mohammad Al-Turany
parent 37271e5840
commit ccbbc9591d

View File

@ -38,7 +38,7 @@ void FairMQExampleRegionSampler::InitTask()
fRegion = FairMQUnmanagedRegionPtr(NewUnmanagedRegionFor("data", fRegion = FairMQUnmanagedRegionPtr(NewUnmanagedRegionFor("data",
0, 0,
10000000, 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; --fNumUnackedMsgs;
if (fMaxIterations > 0) if (fMaxIterations > 0)
{ {
@ -54,8 +54,10 @@ bool FairMQExampleRegionSampler::ConditionalRun()
0, // sub-channel 0, // sub-channel
fRegion, // region fRegion, // region
fRegion->GetData(), // ptr within region fRegion->GetData(), // ptr within region
fMsgSize // offset from ptr fMsgSize, // offset from ptr
nullptr // hint
)); ));
if (Send(msg, "data", 0) > 0) if (Send(msg, "data", 0) > 0)
{ {
++fNumUnackedMsgs; ++fNumUnackedMsgs;