guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Uniform vector lengths -- how long?


From: Rob Browning
Subject: Uniform vector lengths -- how long?
Date: Sun, 20 Jun 2004 16:00:18 -0500
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

Right now the srfi-4 code stores the length of uniform vectors in
SCM_CELL_WORD_2, and sometimes retrieves these lengths directly into
an int:

  #define SCM_UVEC_LENGTH(u) (SCM_CELL_WORD_2(u))
  ...
  int i = SCM_UVEC_LENGTH (uvec);

which is probably wrong for architectures where sizeof(int) <
sizeof(long), and in all cases, limits array sizes to 2GB.  Other code
uses SCM_VALIDATE_INUM to check the lengths given to "make-FOOvector",
which limits the maximum array size even further.

So the thing I'm wondering about is how do we want our uniform vectors
to behave?  Is it OK for their lengths to be limited to a fixnum?
What if someone wants to allocate a multi-GB s8 array on a 64-bit
machine, or a much smaller, but still larger than fixnum array on a
32-bit machine?

-- 
Rob Browning
rlb @defaultvalue.org and @debian.org; previously @cs.utexas.edu
GPG starting 2002-11-03 = 14DD 432F AE39 534D B592  F9A0 25C8 D377 8C7E 73A4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]