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

Method find

src/jrd/cch.cpp:5368–5398  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5366}
5367
5368inline BufferDesc* BCBHashTable::find(const PageNumber& page) const
5369{
5370 auto& list = m_chains[hash(page)];
5371
5372#ifndef HASH_USE_CDS_LIST
5373 QUE que_inst = list.que_forward;
5374 for (; que_inst != &list; que_inst = que_inst->que_forward)
5375 {
5376 BufferDesc* bdb = BLOCK(que_inst, BufferDesc, bdb_que);
5377 if (bdb->bdb_page == page)
5378 return bdb;
5379 }
5380
5381#else // HASH_USE_CDS_LIST
5382 auto ptr = list.get(page);
5383 if (!ptr.empty())
5384 {
5385 fb_assert(ptr->second != nullptr);
5386#ifdef DEV_BUILD
5387 // Original libcds have no update(key, value), use this code with it,
5388 // see also comment in get_buffer()
5389 while (ptr->second == nullptr)
5390 cds::backoff::pause();
5391#endif
5392 if (ptr->second->bdb_page == page)
5393 return ptr->second;
5394 }
5395#endif
5396
5397 return nullptr;
5398}
5399
5400inline BufferDesc* BCBHashTable::emplace(BufferDesc* bdb, const PageNumber& page, bool remove)
5401{

Callers 15

buildDpbFunction · 0.45
getPollFdMethod · 0.45
okMethod · 0.45
setMethod · 0.45
INET_connectFunction · 0.45
unRegisterPortMethod · 0.45
resetClntMethod · 0.45
tryKeyTypeMethod · 0.45
attachSvcMethod · 0.45
add_other_paramsFunction · 0.45
add_working_directoryFunction · 0.45

Calls 4

pauseClass · 0.85
hashFunction · 0.50
getMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected