MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / getPages

Method getPages

src/jrd/GarbageCollector.cpp:124–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

122
123
124PageBitmap* GarbageCollector::getPages(const TraNumber oldest_snapshot, USHORT &relID)
125{
126 SyncLockGuard shGuard(&m_sync, SYNC_SHARED, "GarbageCollector::getPages");
127
128 if (m_relations.isEmpty())
129 {
130 m_nextRelID = 0;
131 return NULL;
132 }
133
134 FB_SIZE_T pos;
135 if (!m_relations.find(m_nextRelID, pos) && (pos == m_relations.getCount()))
136 pos = 0;
137
138 for (; pos < m_relations.getCount(); pos++)
139 {
140 RelationData* relData = m_relations[pos];
141 SyncLockGuard syncData(&relData->m_sync, SYNC_EXCLUSIVE, "GarbageCollector::getPages");
142
143 PageBitmap* bm = NULL;
144 relData->swept(oldest_snapshot, &bm);
145
146 if (bm)
147 {
148 relID = relData->getRelID();
149 m_nextRelID = relID + 1;
150 return bm;
151 }
152 }
153
154 m_nextRelID = 0;
155 return NULL;
156}
157
158
159void GarbageCollector::removeRelation(const USHORT relID)

Callers

nothing calls this directly

Calls 5

sweptMethod · 0.80
getRelIDMethod · 0.80
isEmptyMethod · 0.45
findMethod · 0.45
getCountMethod · 0.45

Tested by

no test coverage detected