change allocator wrapper to ignore #f results

Supports foreign functions that either allocate or return NULL
(translated to #f).
This commit is contained in:
Ryan Culpepper 2012-11-21 00:01:35 -05:00
parent ba62b1dd57
commit a5c415d15a

View File

@ -23,8 +23,9 @@
start-atomic start-atomic
(lambda () (lambda ()
(let ([v (apply proc args)]) (let ([v (apply proc args)])
(hash-set! allocated v (list d)) (when v
(register-finalizer v deallocate) (hash-set! allocated v (list d))
(register-finalizer v deallocate))
v)) v))
end-atomic)) end-atomic))
proc)) proc))