> -----Original Message-----
> From: Dmitry Yemanov [mailto:[email protected]] 
> Sent: Sábado, 22 de Febrero de 2014 1:33
> 
> Claudio,
> 
> > Nice, although some of them seem to be false alarms. For example,
> > TextType::compare(). The typical result is -1, 0, 1. I 
> would prefer to
> > change the result to plain int, but it may not be possible 
> (I would have to
> > check all places affected).
> 
> The problem here may be theoretical rather than practical, 
> but it does 
> exist. Memcmp is not guaranteed to return 1 / -1, it's only 
> guaranteed 
> to return positive / negative. If one day it will start returning 
> 1000000 for "greater-than", we're in trouble.

Worth checking the code, because it may be possible to make it return int.

 
> > 1.- In CCH_down_grade_dbb() I need to know what's the scope 
> for the lock
> 
> Do you mean bcbSync? I believe it's there only to clean the 
> BCB_exclusive flag and later execute the "if (bcb && 
> bcb->bcb_count)" block.

Ok, something like this:

BufferControl* bcb = dbb->dbb_bcb;
if (bcb)
{
        SyncLockGuard bcbSync(&bcb->bcb_syncObject, SYNC_EXCLUSIVE,
"CCH_down_grade_dbb");
        bcb->bcb_flags &= ~BCB_exclusive;

        if (bcb->bcb_count)
        {
                const bcb_repeat* tail = bcb->bcb_rpt;
                fb_assert(tail);                        // once I've got
here with NULL. AP.
                for (const bcb_repeat* const end = tail + bcb->bcb_count;
tail < end; ++tail)
                {
                        PAGE_LOCK_ASSERT(tdbb, bcb,
tail->bcb_bdb->bdb_lock);
                }
        }
}

 
> > 3.- This supposedly dangerous definition
> > const ULONG END_BUCKET = (~0) << 1; is interesting, would
> > const ULONG END_BUCKET = (~0) ^ 1;
> > do the trick?
> 
> What's wrong with "(~0u) << 1" that they suggest instead?

I don't think it's wrong, I'm asking what's better.
;-)

C.


------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to