(let ((bit-string (make-bit-string 64 #f)))
;; Skip the manifest preceding the flonum data. Is there a
;; better way to express this?
- (let* ((bytes-per-object (vector-ref (gc-space-status) 0))
- (bits-per-object (* 8 bytes-per-object))
- (flonum-data-offset-in-bits bits-per-object))
+ (let ((flonum-data-offset-in-bits (* 8 (bytes-per-object))))
(read-bits! flonum flonum-data-offset-in-bits bit-string))
bit-string)))
1))
(define %octets->words-shift
- (let ((chars-per-word (vector-ref (gc-space-status) 0)))
+ (let ((chars-per-word (bytes-per-object)))
(case chars-per-word
((4) -2)
((8) -3)
;; the editor does not exist or is not running. It would actually
;; prefer to be run *before* the GC, but that's not possible now.
(if edwin-editor
- (let ((bytes/word (vector-ref (gc-space-status) 0)))
+ (let ((bytes/word (bytes-per-object)))
(let ((words->bytes
(lambda (words)
(round (/ words bytes/word)))))
;; This is written as a macro so that the shift will be a constant
;; in the compiled code.
;; It does not work when cross-compiled!
- (let ((chars-per-word (vector-ref (gc-space-status) 0)))
+ (let ((chars-per-word (bytes-per-object)))
(case chars-per-word
((4) -2)
((8) -3)
(define (object-constant? object)
((ucode-primitive constant?) object))
-(define (gc-space-status)
+(define-integrable (gc-space-status)
((ucode-primitive gc-space-status)))
+(define (bytes-per-object)
+ (vector-ref (gc-space-status) 0))
+
(define (object-pure? object)
object
#f)
(and (file-regular? pathname)
(call-with-legacy-binary-input-file pathname
(lambda (port)
- (let ((n (vector-ref (gc-space-status) 0)))
+ (let ((n (bytes-per-object)))
(let ((marker (make-legacy-string n)))
(and (eqv? (read-string! marker port) n)
(let loop ((i 0))
(parent (runtime))
(export ()
bracketed-unparser-method
+ bytes-per-object
default-object
default-object?
gc-space-status