You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
UI4wdcrc=n&-SZI?crcwords((UI*)v,n>>LGSZI):~0; // take CRC of the fullword part, if any
53
52
if(n&(SZI-1)){wdcrc=HASHI(wdcrc,((UI*)v)[n>>LGSZI]<<((SZI-(n&(SZI-1)))<<LGSZI));} // if there are bytes, take their CRC after discarding garb. Avoid overfetch
54
53
Rwdcrc; // return composite CRC
55
54
}
56
55
57
56
// CRC32 of n boxes
58
57
staticUI4jtcrcy(Jjt,Ay);
59
-
staticscafINLINEUI4crcboxes(A*v, In, Jjt){UI4crc=0; Acur=v[0]; DO(n, Anxt=v[i+1]; crc=HASH4(crc,jtcrcy(jt,C(cur))); cur=nxt;) Rcrc;} // overfetch OK
58
+
staticINLINEUI4crcboxes(A*v, In, Jjt){UI4crc=0; Acur=v[0]; DO(n, Anxt=v[i+1]; crc=HASH4(crc,jtcrcy(jt,C(cur))); cur=nxt;) Rcrc;} // overfetch OK
if(unlikely(!(dic->bloc.flags&DICFICF))){initvirt((A)virt.u,dic); initvirt((A)virt.h,dic); virt.self=dic->bloc.hashcompself; } // fill in nonresizable info
563
562
UI8kib=dic->bloc.klens; I (*cf)(I,void*,void*)=dic->bloc.compfn; Ivn=dic->bloc.vbytelen; // more nonresizable: kbytelen/kitemlen compare fn size of a value in bytes
@@ -709,7 +708,7 @@ resize:; // resize required. We already have a write lock
709
708
// resolve each key in the hash and copy new kvs
710
709
// We have requested a prewrite lock; we may even have a full write lock on the keys and value
711
710
// return holding a write lock on this dic; return value of lv (to make release faster in caller), with RET bits set to indicate error or resize request
if(unlikely(!(dic->bloc.flags&DICFICF))){initvirt((A)virt.u,dic); initvirt((A)virt.h,dic); virt.self=dic->bloc.hashcompself; } // fill in nonresizable info
714
713
UI8kib=dic->bloc.klens; I (*cf)(I,void*,void*)=dic->bloc.compfn; // kbytelen/kitemlen compare func unchanged by resize
715
714
DICLKRWWT(dic,lv) // wait for pre-write lock to be granted (NOP if we already have a write lock). The DIC may have been resized during the wait, so pointers and limits must be refreshed after the lock
@@ -900,7 +899,7 @@ abortexit:;
900
899
// resolve each key in the hash and copy new kvs
901
900
// We have requested a prewrite lock; we may even have a full write lock on the keys and value
902
901
// return holding a write lock on this dic; rc=0 if error, rc=-1 to request a resize
if(unlikely(!(dic->bloc.flags&DICFICF))){initvirt((A)virt.u,dic); initvirt((A)virt.h,dic); virt.self=dic->bloc.hashcompself; } // fill in nonresizable info
905
904
UI8kib=dic->bloc.klens; I (*cf)(I,void*,void*)=dic->bloc.compfn; // more nonresizable
906
905
DICLKRWWT(dic,lv) // wait for pre-write lock to be granted (NOP if we already have a write lock). The DIC may have been resized during the wait, so pointers and limits must be refreshed after the lock
@@ -1106,7 +1105,7 @@ DF2(jtdisprbdic){F12IP;
1106
1105
// resolve each key in the hash and copy the value (or default) to the result
1107
1106
// a is default if given, 0 if not; or 1 if has
1108
1107
// We take a read lock on the table and release it
if(unlikely(!(dic->bloc.flags&DICFICF))){initvirt((A)virt.u,dic); initvirt((A)virt.h,dic); virt.self=dic->bloc.hashcompself; } // fill in nonresizable info
1112
1111
UI8kib=dic->bloc.klens; I (*cf)(I,void*,void*)=dic->bloc.compfn; Ivb=dic->bloc.vbytelen; // more nonresizable: kbytelen/kitemlen compare fn prototype required to get arg converted to I
if(unlikely(!(dic->bloc.flags&DICFICF))){initvirt((A)virt.u,dic); initvirt((A)virt.h,dic); virt.self=dic->bloc.hashcompself; } // fill in nonresizable info
// We have requested a prewrite lock; we may even have a full write lock on the keys and value
1392
1391
// return holding a write lock on this dic; rc=0 if error, otherwise current lv (which gives lock status), with OKRET set to be non0 and RESIZEREQ is a resize is needed
if(unlikely(!(dic->bloc.flags&DICFICF))){initvirt((A)virt.u,dic); initvirt((A)virt.h,dic); virt.self=dic->bloc.hashcompself; } // fill in nonresizable info
1395
1394
UI8kib=dic->bloc.klens; I (*cf)(I,void*,void*)=dic->bloc.compfn; // more nonresizable: kbytelen/kitemlen compare fn prototype required to get arg converted to I
1396
1395
Inodeb=dic->bloc.hashelesiz*(0x1000000+SZI)+(dic->bloc.emptysiz<<19)+(dic->bloc.flags<<8); // (#bytes in node index)\(#bits in empty-chain field\(flags)\(number of bits in a node index)
// We have requested a prewrite lock; we may even have a full write lock on the keys and value
1532
1531
// return holding a write lock on this dic; rc=0 if error, otherwise current lv (which gives lock status), with OKRET set to be non0 and RESIZEREQ is a resize is needed
if(unlikely(!(dic->bloc.flags&DICFICF))){initvirt((A)virt.u,dic); initvirt((A)virt.h,dic); virt.self=dic->bloc.hashcompself; } // fill in nonresizable info
1535
1534
UI8kib=dic->bloc.klens; I (*cf)(I,void*,void*)=dic->bloc.compfn; // more nonresizable: kbytelen/kitemlen compare fn prototype required to get arg converted to I
1536
1535
Inodeb=dic->bloc.hashelesiz*(0x1000000+SZI)+(dic->bloc.emptysiz<<19)+(dic->bloc.flags<<8); // (#bytes in node index)\(#bits in empty-chain field\(flags)\(number of bits in a node index)
0 commit comments