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

Method unlinkAll

src/jrd/sort.cpp:2191–2210  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2189
2190
2191void SortOwner::unlinkAll()
2192{
2193 while (sorts.getCount())
2194 delete sorts.pop();
2195
2196 if (buffers.hasData())
2197 {
2198 // Move cached buffers to the database level cache to be reused later by other attachments
2199
2200 const size_t MAX_CACHED_SORT_BUFFERS = 8; // 1MB
2201
2202 SyncLockGuard guard(&dbb->dbb_sortbuf_sync, SYNC_EXCLUSIVE, FB_FUNCTION);
2203
2204 while (buffers.hasData() && dbb->dbb_sort_buffers.getCount() < MAX_CACHED_SORT_BUFFERS)
2205 dbb->dbb_sort_buffers.push(buffers.pop());
2206 }
2207
2208 while (buffers.hasData())
2209 delete[] buffers.pop();
2210}
2211
2212
2213/// class PartitionedSort

Callers 1

EXE_unwindFunction · 0.80

Calls 4

getCountMethod · 0.45
popMethod · 0.45
hasDataMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected