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

Function CCH_free_page

src/jrd/cch.cpp:1341–1375  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1339}
1340
1341bool CCH_free_page(thread_db* tdbb)
1342{
1343/**************************************
1344 *
1345 * C C H _ f r e e _ p a g e
1346 *
1347 **************************************
1348 *
1349 * Functional description
1350 * Check if the cache is below its free pages
1351 * threshold and write a page on the LRU tail.
1352 *
1353 **************************************/
1354
1355 // Called by VIO/garbage_collector() when it is idle to
1356 // help quench the thirst for free pages.
1357
1358 Database* dbb = tdbb->getDatabase();
1359 BufferControl* bcb = dbb->dbb_bcb;
1360
1361 if (dbb->readOnly())
1362 return false;
1363
1364 BufferDesc* bdb;
1365
1366 if ((bcb->bcb_flags & BCB_free_pending) && (bdb = get_dirty_buffer(tdbb)))
1367 {
1368 if (write_buffer(tdbb, bdb, bdb->bdb_page, true, tdbb->tdbb_status_vector, true))
1369 return true;
1370
1371 CCH_unwind(tdbb, false);
1372 }
1373
1374 return false;
1375}
1376
1377
1378SLONG CCH_get_incarnation(WIN* window)

Callers

nothing calls this directly

Calls 5

get_dirty_bufferFunction · 0.85
write_bufferFunction · 0.85
CCH_unwindFunction · 0.85
getDatabaseMethod · 0.80
readOnlyMethod · 0.80

Tested by

no test coverage detected