From 7dfa937830324e0c675fae00115cd7eb4171efa4 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Sun, 12 Feb 2017 01:25:56 -0800 Subject: [PATCH] Reduce the size of character sets by computing the old format on demand. --- src/runtime/chrset.scm | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/runtime/chrset.scm b/src/runtime/chrset.scm index 760dab3fb..6ccc0f91d 100644 --- a/src/runtime/chrset.scm +++ b/src/runtime/chrset.scm @@ -43,20 +43,10 @@ USA. ;;; However, CHAR-SET-MEMBER? only accepts scalar values. (define-record-type - (%%make-char-set low high table) + (%make-char-set low high) char-set? (low %char-set-low) - (high %char-set-high) - ;; Backwards compatibility: - (table %char-set-table)) - -(define (%make-char-set low high) - (%%make-char-set low high - (let ((table (make-vector-8b #x100))) - (do ((i 0 (fix:+ i 1))) - ((not (fix:< i #x100))) - (vector-8b-set! table i (if (%low-ref low i) 1 0))) - table))) + (high %char-set-high)) (define-integrable %low-length #x100) (define-integrable %low-limit #x800) @@ -78,6 +68,15 @@ USA. (define %null-char-set (%make-char-set (%make-low 0) '#())) +;; Backwards compatibility: +(define (%char-set-table char-set) + (let ((table (make-vector-8b #x100)) + (low (%char-set-low char-set))) + (do ((i 0 (fix:+ i 1))) + ((not (fix:< i #x100))) + (vector-8b-set! table i (if (%low-ref low i) 1 0))) + table)) + (define (8-bit-char-set? char-set) (and (char-set? char-set) (fix:= (vector-length (%char-set-high char-set)) 0) -- 2.25.1