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
|
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))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user