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
@@ -675,3 +708,16 @@ function setListBounds(list, begin, end) {
675
708
functiongetTailOffset(size){
676
709
returnsize<SIZE ? 0 : ((size-1)>>>SHIFT)<<SHIFT;
677
710
}
711
+
712
+
// The largest number of values a List can hold. Above this the 32-bit trie math
713
+
// in setListBounds() stays in the safe signed 32-bit range.
714
+
constMAX_LIST_SIZE=2**30;// 1073741824
715
+
716
+
/**
717
+
* Computes 2 ** exp for the trie level-raising loops in setListBounds().
718
+
* Use the cheap bitwise operator shift whenever possible, otherwise fall back to exponentiation.
719
+
* This is necessary because bitwise operators in JavaScript only work on 32-bit signed integers, so for exp >= 31, we need to use exponentiation to avoid overflow.
0 commit comments