change allocator wrapper to ignore #f results
Supports foreign functions that either allocate or return NULL (translated to #f).
This commit is contained in:
parent
ba62b1dd57
commit
a5c415d15a
|
@ -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))
|
||||
|
|
Loading…
Reference in New Issue
Block a user