weak hash table for cstructs needs ephemerons
svn: r8353
This commit is contained in:
parent
5715f7a8da
commit
74062d996f
|
@ -1477,10 +1477,15 @@
|
||||||
(define cstruct-info
|
(define cstruct-info
|
||||||
(let ([table (make-hash-table 'weak)])
|
(let ([table (make-hash-table 'weak)])
|
||||||
(lambda (cstruct msg/fail-thunk . args)
|
(lambda (cstruct msg/fail-thunk . args)
|
||||||
(cond [(eq? 'set! msg/fail-thunk) (hash-table-put! table cstruct args)]
|
(cond [(eq? 'set! msg/fail-thunk)
|
||||||
|
(hash-table-put! table cstruct (make-ephemeron cstruct args))]
|
||||||
[(and cstruct ; might get a #f if there were no slots
|
[(and cstruct ; might get a #f if there were no slots
|
||||||
(hash-table-get table cstruct (lambda () #f)))
|
(hash-table-get table cstruct (lambda () #f)))
|
||||||
=> (lambda (xs) (apply values xs))]
|
=> (lambda (xs)
|
||||||
|
(let ([v (ephemeron-value xs)])
|
||||||
|
(if v
|
||||||
|
(apply values v)
|
||||||
|
(msg/fail-thunk))))]
|
||||||
[else (msg/fail-thunk)]))))
|
[else (msg/fail-thunk)]))))
|
||||||
|
|
||||||
;; ----------------------------------------------------------------------------
|
;; ----------------------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in New Issue
Block a user