Eliminate string-maximum-length.
authorChris Hanson <org/chris-hanson/cph>
Wed, 22 Feb 2017 05:14:33 +0000 (21:14 -0800)
committerChris Hanson <org/chris-hanson/cph>
Wed, 22 Feb 2017 05:14:33 +0000 (21:14 -0800)
src/compiler/base/utils.scm
src/runtime/runtime.pkg
src/runtime/string.scm

index 5dec6dceb3b22de4ec8bc034c5f4382a7f2a1494..05ca39e142e8606fed383b83580c76c60d493a13 100644 (file)
@@ -249,7 +249,7 @@ USA.
     ;; References (assumes immediate constants are immutable)
     CAR CDR LENGTH
     VECTOR-REF VECTOR-LENGTH
-    STRING-REF STRING-LENGTH STRING-MAXIMUM-LENGTH
+    STRING-REF STRING-LENGTH
     BIT-STRING-LENGTH
     ))
 
index cb8c2a9e16bc71b25143ae5a95d29f79bb1d4d5d..96d424f2d371c94027b4714d5e879ed97ae9be41 100644 (file)
@@ -1004,7 +1004,6 @@ USA.
          (guarantee-vector-8b guarantee-string)
          (set-vector-8b-length! set-string-length!)
          (vector-8b-length string-length)
-         (vector-8b-maximum-length string-maximum-length)
          (vector-8b? string?)
          error:not-string
          guarantee-string
@@ -1024,7 +1023,6 @@ USA.
          (guarantee-vector-8b guarantee-string)
          (set-vector-8b-length! set-string-length!)
          (vector-8b-length string-length)
-         (vector-8b-maximum-length string-maximum-length)
          (vector-8b? string?)
          error:not-string
          guarantee-string
@@ -1057,7 +1055,6 @@ USA.
          string-match-backward-ci
          string-match-forward
          string-match-forward-ci
-         string-maximum-length
          string-pad-left
          string-pad-right
          string-replace
index 6d94e477e473190e9604459a860905bbea48e8c2..897c037192cdf9a6502a070f0a7d34a965403051 100644 (file)
@@ -73,22 +73,6 @@ USA.
                          ascii
                          (integer->char ascii))))
 
-(define (string-maximum-length string)
-  (guarantee-string string 'STRING-MAXIMUM-LENGTH)
-  (fix:- (fix:lsh (fix:- (system-vector-length string) 1)
-                 %words->octets-shift)
-        1))
-
-(define %octets->words-shift
-  (let ((chars-per-word (vector-ref (gc-space-status) 0)))
-    (case chars-per-word
-      ((4) -2)
-      ((8) -3)
-      (else (error "Can't support this word size:" chars-per-word)))))
-
-(define %words->octets-shift
-  (- %octets->words-shift))
-
 (define (reverse-string string)
   (guarantee-string string 'REVERSE-STRING)
   (%reverse-substring string 0 (string-length string)))