Lisp HUG Maillist Archive

LWW 4.4: read-sequence bombs on files of length > 2096895

Hi,

I have had problems trying to call `read-sequence' on files whose file-length
is greater than 2096895.

However, I able to make character arrays longer than this, though not much
bigger:

-------------------------

CL-USER 207 > (length (MAKE-ARRAY (+ 2096895 252) :element-type 'character
:initial-element #\c))
2097147

CL-USER 208 > (length (MAKE-ARRAY (+ 2096895 253) :element-type 'character
:initial-element #\c))

Error: Can't make an array of 8388608 bytes.
  1 (abort) Return to level 0.
  2 Return to top loop level 0.

Type :b for backtrace, :c <option number> to proceed,  or :? for other options

CL-USER 209 : 1 >

-------------------------

What's even weirder is that ARRAY-TOTAL-SIZE-LIMIT is 1048448, which is smaller
than the array I created above.  So I'm a bit confused.

What I'd like to know is:

 o What constant denotes the maximum size of an array that READ-SEQUENCE
   can swallow?

 o Is the maximum size of an array in any way a function of the element type
   of the array?

I'd like to know what constant to examine before trying to use READ-SEQUENCE in
a way that would cause an error.

dave


Updated at: 2020-12-10 08:53 UTC