     length = @length = start_size
     n = start_size
     size = INT_SIZE
-    while size isnt MAX_SIZE and n > size
+    while size isnt MAX_SIZE and n > size and
+    size * 2 * struct.bytes <= MAX_BYTES
      size = size << 1
 
     ls = 0


  addArray: ->
   n = lastArrLen
   if n isnt MAX_SIZE
    n = n << 1

   capacity += n


INT_SIZE = 16
MAX_SIZE = 1<<26
MAX_BYTES = 1<<29
MAX_LINEAR_ARRAY_INDEX = 2

ITER_CHANGE_VIEW = 1
