Skip to content
Permalink
Browse files

Fixes #980 refactor 'retired' segments management;

Instead of collecting retired segments and deleting them at fixed points
let's make them refcount-managed and just release when they're no more
in game instead of explicit deletion.
  • Loading branch information...
klirichek authored and adriannuta committed Aug 22, 2019
1 parent 6901f9b commit 174d312905285aa5746f4f404c53e6dc669ef42f
Showing with 191 additions and 200 deletions.
  1. +3 −2 src/sphinxpq.cpp
  2. +178 −195 src/sphinxrt.cpp
  3. +10 −3 src/sphinxrt.h
@@ -845,6 +845,7 @@ struct PercolateQword_t : public ISphQword
m_iDoc = 0;
m_tDocReader = RtDocReader_t();
m_pSeg = pSeg;
SafeAddRef ( pSeg );
m_tHitReader.m_pBase = pSeg->m_dHits.Begin();

m_dDoclist.Set ( dDoclist.Begin(), dDoclist.GetLength() );
@@ -867,7 +868,7 @@ struct PercolateQword_t : public ISphQword
m_iDoc++;
}

const RtSegment_t * m_pSeg = nullptr;
constRtSegmentRefPtf_t m_pSeg;
CSphFixedVector<Slice_t> m_dDoclist { 0 };
CSphMatch m_tMatch;
RtDocReader_t m_tDocReader;
@@ -1419,7 +1420,7 @@ bool PercolateIndex_c::MatchDocuments ( RtAccum_t * pAccExt, PercolateMatchResul
PERCOLATE_WORDS_PER_CP, ( m_iMaxCodepointLength>1 ) );

DoMatchDocuments ( pSeg, tRes );
SafeDelete ( pSeg );
SafeRelease ( pSeg );

// done; cleanup accum
pAcc->Cleanup ();

0 comments on commit 174d312

Please sign in to comment.
You can’t perform that action at this time.