This does not check whether the population already holds the object
to be added; hence it is unsafe.
Change MAKE-1D-TABLE and MAKE-THREAD to use it: newly allocated
objects are guaranteed not to be in the population.
(and (pair? object)
(eq? (car object) population-tag)))
+(define (add-to-population!/unsafe population object)
+ (set-cdr! population
+ (system-pair-cons weak-cons-type
+ (canonicalize object)
+ (cdr population))))
+
(define (add-to-population! population object)
(let ((object (canonicalize object)))
(let loop ((previous population) (this (cdr population)))
(define (make-1d-table)
(let ((table (list 1d-table-tag)))
- (add-to-population! population-of-1d-tables table)
+ (add-to-population!/unsafe population-of-1d-tables table)
table))
(define (1d-table? object)
map-over-population!
population?
remove-from-population!)
+ (export (runtime)
+ add-to-population!/unsafe)
(initialization (initialize-package!)))
(define-package (runtime pretty-printer)
(set-thread/continuation! thread continuation)
(set-thread/root-state-point! thread
(current-state-point state-space:local))
- (add-to-population! thread-population thread)
+ (add-to-population!/unsafe thread-population thread)
(thread-running thread)
thread))