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

Function is_writeable

src/jrd/cch.cpp:4669–4710  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4667
4668
4669static bool is_writeable(BufferDesc* bdb, const ULONG mark)
4670{
4671/**************************************
4672 *
4673 * i s _ w r i t e a b l e
4674 *
4675 **************************************
4676 *
4677 * Functional description
4678 * See if a buffer is writeable. A buffer is writeable if
4679 * neither it nor any of it's higher precedence cousins are
4680 * marked for write.
4681 *
4682 **************************************/
4683
4684 // If there are buffers that must be written first, check them, too.
4685
4686 for (const que* queue = bdb->bdb_higher.que_forward;
4687 queue != &bdb->bdb_higher; queue = queue->que_forward)
4688 {
4689 const Precedence* precedence = BLOCK(queue, Precedence, pre_higher);
4690
4691 if (!(precedence->pre_flags & PRE_cleared))
4692 {
4693 BufferDesc* high = precedence->pre_hi;
4694
4695 if (high->bdb_flags & BDB_marked)
4696 return false;
4697
4698 if (high->bdb_prec_walk_mark != mark)
4699 {
4700 if (QUE_EMPTY(high->bdb_higher))
4701 high->bdb_prec_walk_mark = mark;
4702 else if (!is_writeable(high, mark))
4703 return false;
4704 }
4705 }
4706 }
4707
4708 bdb->bdb_prec_walk_mark = mark;
4709 return true;
4710}
4711#endif // NOT_USED_OR_REPLACED
4712
4713

Callers 1

writeableFunction · 0.85

Calls 1

QUE_EMPTYFunction · 0.85

Tested by

no test coverage detected