MCPcopy Create free account
hub / github.com/alibaba/CicadaPlayer / returnSlice

Method returnSlice

framework/data_source/cache/ISliceManager.cpp:124–140  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

122 }
123
124 void ISliceManager::returnSlice(slice *pSlice)
125 {
126 std::unique_lock<std::mutex> lock(mSliceLock);
127
128 for (auto item = mSliceQueue.begin(); item != mSliceQueue.end();) {
129 //TODO: cal the slice score,release the lowest one
130 if (*item == pSlice) {
131 memPoolSlice *slice = *item;
132 mBufferPool->releaseBuffer(slice->getBuffer());
133 item = mSliceQueue.erase(item);
134 delete slice;
135 break;
136 } else {
137 item++;
138 }
139 }
140 }
141}

Callers 1

~sliceBufferMethod · 0.80

Calls 4

releaseBufferMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
getBufferMethod · 0.45

Tested by

no test coverage detected