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
(lambda ()
(let ([v (apply proc args)])
(hash-set! allocated v (list d))
(register-finalizer v deallocate)
(when v
(hash-set! allocated v (list d))
(register-finalizer v deallocate))
v))
end-atomic))
proc))