| 1339 | } |
| 1340 | |
| 1341 | bool 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 | |
| 1378 | SLONG CCH_get_incarnation(WIN* window) |
nothing calls this directly
no test coverage detected