Skip to content

Commit

Permalink
Decrease usage hint after handover to sender
Browse files Browse the repository at this point in the history
  • Loading branch information
jayantjn committed Nov 22, 2024
1 parent e3c8779 commit 6dc8c5d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/DataSenderProtoWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ DataSenderProtoWriter::append( const CollectedSignal &msg )
auto data = loanedRawDataFrame.getData();
auto stringSize = loanedRawDataFrame.getSize();
capturedSignal.set_string_value( reinterpret_cast<const char *>( data ), stringSize );
mRawDataBufferManager->decreaseHandleUsageHint(
msg.signalID,
signalValue.value.uint32Val,
RawData::BufferHandleUsageStage::HANDED_OVER_TO_SENDER );
size += STRING_OVERHEAD + stringSize;
break;
}
Expand Down
4 changes: 2 additions & 2 deletions src/RawDataManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ struct Frame
// being referenced somewhere. Each element in the array means
// a different type of usage so that the BufferManager can
// prioritize some types of usage when it needs to free up
// space. As long as mDataInUseCounter is 0, the data can be
// deleted regardless of the mUsageHintCountersPerStage value.
// space. The data can be deleted only when both
// mDataInUseCounter and mUsageHintCountersPerStage are 0

Frame( BufferHandle handleID, Timestamp timestamp, RawDataType rawData )
: mHandleID( handleID )
Expand Down

0 comments on commit 6dc8c5d

Please sign in to comment.