From: Matt Birkholz Date: Thu, 18 Jun 2015 18:24:43 +0000 (-0700) Subject: Remove without-interrupts from runtime/geneqht.scm. X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=4dd4b6270d17d49b11c860214f2aababcadb3cae;p=mit-scheme.git Remove without-interrupts from runtime/geneqht.scm. Serial access to a particular table is still the responsibility of the user (e.g. SOS procedures?), but the list of all address hash tables is now a serial population. --- diff --git a/src/runtime/geneqht.scm b/src/runtime/geneqht.scm index 22a32b06e..6e6ae6b56 100644 --- a/src/runtime/geneqht.scm +++ b/src/runtime/geneqht.scm @@ -50,7 +50,7 @@ USA. (hash (compute-key-hash table key))) (let loop ((entries (vector-ref buckets hash))) (cond ((null? entries) - (without-interrupts + (without-interruption (lambda () (vector-set! buckets hash @@ -83,7 +83,7 @@ USA. (if (not (table-needs-rehash? table)) hash (begin - (without-interrupts (lambda () (rehash-table! table))) + (without-interruption (lambda () (rehash-table! table))) (loop)))))) (define-integrable (eq-hash-mod key modulus) @@ -97,26 +97,17 @@ USA. modulus)) (define (record-address-hash-table! table) - (set! address-hash-tables (weak-cons table address-hash-tables)) - unspecific) + (add-to-population! address-hash-tables table)) (define (mark-address-hash-tables!) - (let loop ((previous #f) (tables address-hash-tables)) - (cond ((null? tables) - unspecific) - ((system-pair-car tables) - (set-table-needs-rehash?! (system-pair-car tables) #t) - (loop tables (system-pair-cdr tables))) - (else - (if previous - (system-pair-set-cdr! previous (system-pair-cdr tables)) - (set! address-hash-tables (system-pair-cdr tables))) - (loop previous (system-pair-cdr tables)))))) + (for-each-inhabitant address-hash-tables + (lambda (table) + (set-table-needs-rehash?! table #t)))) (define address-hash-tables) (define (initialize-address-hashing!) - (set! address-hash-tables '()) + (set! address-hash-tables (make-serial-population)) (add-primitive-gc-daemon! mark-address-hash-tables!)) ;;;; Resizing @@ -240,11 +231,5 @@ USA. (define-integrable minimum-size 4) -(define-integrable (without-interrupts thunk) - (let ((interrupt-mask (set-interrupt-enables! interrupt-mask/gc-ok))) - (thunk) - (set-interrupt-enables! interrupt-mask) - unspecific)) - (define-integrable (weak-cons car cdr) (system-pair-cons (ucode-type weak-cons) car cdr)) \ No newline at end of file