unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* Fix limitations on vector length
@ 2002-06-25 13:32 Roland Orre
  2002-06-25 19:50 ` Dirk Herrmann
  2002-10-04 18:24 ` Thien-Thi Nguyen
  0 siblings, 2 replies; 3+ messages in thread
From: Roland Orre @ 2002-06-25 13:32 UTC (permalink / raw)
  Cc: Marius Vollmer, Erik Swahn


Some of our code using multidimensional arrays behaved buggy and that
showed to be caused by the limitations of vector lengths to 24 bits,
we need at least a few bits more at the moment.

Problems:
1) the allocation of the array did not cause an error message.
2) we need an urgent simple fix for utilizing big arrays.

What we inted to do is to change the SCM_LENGTH macro and the
memory allocation for vectors and arrays so when the length
need more than 24 bits the length is stored in the beginning
of the array memory, that is we add an offset of four to the
base pointer.

Any comments?

	Roland Orre


_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-user


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Fix limitations on vector length
  2002-06-25 13:32 Fix limitations on vector length Roland Orre
@ 2002-06-25 19:50 ` Dirk Herrmann
  2002-10-04 18:24 ` Thien-Thi Nguyen
  1 sibling, 0 replies; 3+ messages in thread
From: Dirk Herrmann @ 2002-06-25 19:50 UTC (permalink / raw)
  Cc: guile-user, Marius Vollmer, Erik Swahn

On Tue, 25 Jun 2002, Roland Orre wrote:

> Some of our code using multidimensional arrays behaved buggy and that
> showed to be caused by the limitations of vector lengths to 24 bits,
> we need at least a few bits more at the moment.
> 
> Problems:
> 1) the allocation of the array did not cause an error message.
> 2) we need an urgent simple fix for utilizing big arrays.
> 
> What we inted to do is to change the SCM_LENGTH macro and the
> memory allocation for vectors and arrays so when the length
> need more than 24 bits the length is stored in the beginning
> of the array memory, that is we add an offset of four to the
> base pointer.
> 
> Any comments?

First a note:  Since you still use the SCM_LENGTH macro, you are probably
using guile 1.4.  This macro has been deprecated in 1.6 and replaced by a
bunch of macros like SCM_VECTOR_LENGTH and so on.  It could be worth
changing to the upcoming 1.6 from CVS since modifications to guile's built
in types are supposed to be less painfull.  I don't know about arrays, but
at least for vectors you get an error message if you try to allocate too
large a vector in 1.6.

Second, a suggestion:  The following solution might(!) cause less
problems:

* if you need more than 24 bits, allocate the vector object as a double
cell, set the 24 'standard' length bits to 0xFFFFFF, and store the real
length in the remaining two words of the double cell.
* make sure, you also update the garbage collector code for vectors.

Then, you don't have to do any trickery with the base pointer, only with
the length information.  I don't know about the array stuff, though...

Best regards
Dirk Herrmann


_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-user


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Fix limitations on vector length
  2002-06-25 13:32 Fix limitations on vector length Roland Orre
  2002-06-25 19:50 ` Dirk Herrmann
@ 2002-10-04 18:24 ` Thien-Thi Nguyen
  1 sibling, 0 replies; 3+ messages in thread
From: Thien-Thi Nguyen @ 2002-10-04 18:24 UTC (permalink / raw)
  Cc: guile-user, erik.swahn

   From: Roland Orre <orre@nada.kth.se>
   Date: Tue, 25 Jun 2002 15:32:54 +0200 (MET DST)

   Some of our code using multidimensional arrays behaved buggy and that
   showed to be caused by the limitations of vector lengths to 24 bits,
   we need at least a few bits more at the moment.

this limitation should be documented.  (there is mention of string limit
of 2^24 characters (shared implementation), but not for vectors.)

   Problems:
   1) the allocation of the array did not cause an error message.
   2) we need an urgent simple fix for utilizing big arrays.

   What we inted to do is to change the SCM_LENGTH macro and the
   memory allocation for vectors and arrays so when the length
   need more than 24 bits the length is stored in the beginning
   of the array memory, that is we add an offset of four to the
   base pointer.

   Any comments?

did you go through with this plan?  could you supply a diff?  does this
modified guile run on 64 bit machines (alpha, sparc v9)?  any problems
there?

thi


_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-user


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-10-04 18:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-06-25 13:32 Fix limitations on vector length Roland Orre
2002-06-25 19:50 ` Dirk Herrmann
2002-10-04 18:24 ` Thien-Thi Nguyen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).