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

Function adjust_scan_count

src/jrd/cch.cpp:2548–2589  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2546
2547
2548static void adjust_scan_count(WIN* window, bool mustRead)
2549{
2550/**************************************
2551 *
2552 * a d j u s t _ s c a n _ c o u n t
2553 *
2554 **************************************/
2555 BufferDesc* bdb = window->win_bdb;
2556
2557 // If a page was read or prefetched on behalf of a large scan
2558 // then load the window scan count into the buffer descriptor.
2559 // This buffer scan count is decremented by releasing a buffer
2560 // with CCH_RELEASE_TAIL.
2561
2562 // Otherwise zero the buffer scan count to prevent the buffer
2563 // from being queued to the LRU tail.
2564
2565 if (window->win_flags & WIN_large_scan)
2566 {
2567 if (mustRead || (bdb->bdb_flags & BDB_prefetch) || bdb->bdb_scan_count < 0)
2568 bdb->bdb_scan_count = window->win_scans;
2569 }
2570 else if (window->win_flags & WIN_garbage_collector)
2571 {
2572 if (mustRead)
2573 bdb->bdb_scan_count = -1;
2574
2575 if (bdb->bdb_flags & BDB_garbage_collect)
2576 window->win_flags |= WIN_garbage_collect;
2577 }
2578 else if (window->win_flags & WIN_secondary)
2579 {
2580 if (mustRead)
2581 bdb->bdb_scan_count = -1;
2582 }
2583 else
2584 {
2585 bdb->bdb_scan_count = 0;
2586 if (bdb->bdb_flags & BDB_garbage_collect)
2587 bdb->bdb_flags &= ~BDB_garbage_collect;
2588 }
2589}
2590
2591
2592static int blocking_ast_bdb(void* ast_object)

Callers 2

CCH_fetchFunction · 0.85
CCH_handoffFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected