From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Dirk Herrmann Newsgroups: gmane.lisp.guile.user Subject: Re: Fix limitations on vector length Date: Tue, 25 Jun 2002 21:50:56 +0200 (CEST) Sender: guile-user-admin@gnu.org Message-ID: References: <200206251332.PAA12602@faun.nada.kth.se> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: main.gmane.org 1025035062 14063 127.0.0.1 (25 Jun 2002 19:57:42 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 25 Jun 2002 19:57:42 +0000 (UTC) Cc: guile-user@gnu.org, Marius Vollmer , Erik Swahn Return-path: Original-Received: from fencepost.gnu.org ([199.232.76.164]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 17MwRZ-0003ei-00 for ; Tue, 25 Jun 2002 21:57:42 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 17MwO9-00008Z-00; Tue, 25 Jun 2002 15:54:09 -0400 Original-Received: from sallust.ida.ing.tu-bs.de ([134.169.132.52]) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 17MwLD-0008UP-00 for ; Tue, 25 Jun 2002 15:51:07 -0400 Original-Received: from localhost (dirk@localhost) by sallust.ida.ing.tu-bs.de (8.9.3+Sun/8.9.1) with ESMTP id VAA01220; Tue, 25 Jun 2002 21:50:56 +0200 (CEST) Original-To: Roland Orre In-Reply-To: <200206251332.PAA12602@faun.nada.kth.se> Errors-To: guile-user-admin@gnu.org X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.lisp.guile.user:641 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.user:641 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