From 10a7ef77d291bb59074189a1bbf2c81e1f4c8877 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Tue, 21 Feb 2017 21:14:33 -0800 Subject: [PATCH] Eliminate string-maximum-length. --- src/compiler/base/utils.scm | 2 +- src/runtime/runtime.pkg | 3 --- src/runtime/string.scm | 16 ---------------- 3 files changed, 1 insertion(+), 20 deletions(-) diff --git a/src/compiler/base/utils.scm b/src/compiler/base/utils.scm index 5dec6dceb..05ca39e14 100644 --- a/src/compiler/base/utils.scm +++ b/src/compiler/base/utils.scm @@ -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 )) diff --git a/src/runtime/runtime.pkg b/src/runtime/runtime.pkg index cb8c2a9e1..96d424f2d 100644 --- a/src/runtime/runtime.pkg +++ b/src/runtime/runtime.pkg @@ -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 diff --git a/src/runtime/string.scm b/src/runtime/string.scm index 6d94e477e..897c03719 100644 --- a/src/runtime/string.scm +++ b/src/runtime/string.scm @@ -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))) -- 2.25.1