~ chicken-core (chicken-5) 042b576454edfaf820cddc86bc08ede286d0d820


commit 042b576454edfaf820cddc86bc08ede286d0d820
Author:     Christian Kellermann <ckeen@pestilenz.org>
AuthorDate: Sun Mar 4 09:33:12 2012 +0100
Commit:     Peter Bex <peter.bex@xs4all.nl>
CommitDate: Sun Mar 4 15:51:58 2012 +0100

    Make maximal-string-length architecture dependent
    
    Rely on the bits set in C_HEADER_SIZE_MASK for the string lenght and
    do not hard code it to #xffffff. This will enhance buffering etc on
    64bit systems.
    
    Signed-off-by: Peter Bex <peter.bex@xs4all.nl>

diff --git a/NEWS b/NEWS
index 522b9f63..97071fb4 100644
--- a/NEWS
+++ b/NEWS
@@ -9,6 +9,10 @@
   - enhanced line number tracking to get better error messages from
     the scrutinizer.
 
+- Runtime system
+  - the maximum length of strings is no longer limited to a 24-bit
+    number on 64-bit architectures but can be 56 bits.
+    
 4.7.4
 
 - Security fixes
diff --git a/library.scm b/library.scm
index 82ed0648..62115846 100644
--- a/library.scm
+++ b/library.scm
@@ -33,7 +33,8 @@
 	##sys#grow-vector ##sys#default-parameter-vector 
 	current-print-length setter-tag read-marks
 	##sys#print-exit
-	##sys#format-here-doc-warning)
+	##sys#format-here-doc-warning
+        maximal-string-length)
   (not inline ##sys#user-read-hook ##sys#error-hook ##sys#signal-hook ##sys#schedule
        ##sys#default-read-info-hook ##sys#infix-list-hook ##sys#sharp-number-hook
        ##sys#user-print-hook ##sys#user-interrupt-hook ##sys#step-hook)
@@ -144,13 +145,12 @@ EOF
 (include "common-declarations.scm")
 (include "banner.scm")
 
-
 (define-constant namespace-max-id-len 31)
 (define-constant char-name-table-size 37)
 (define-constant output-string-initial-size 256)
 (define-constant read-line-buffer-initial-size 1024)
 (define-constant default-parameter-vector-size 16)
-(define-constant maximal-string-length #x00ffffff)
+(define maximal-string-length (foreign-value "C_HEADER_SIZE_MASK" unsigned-long))
 
 
 ;;; System routines:
Trap