5.6 Allocation and Finalization
(require ffi/unsafe/alloc) | package: base |
procedure
((allocator dealloc) alloc) → procedure?
dealloc : (any/c . -> . any) alloc : procedure?
The dealloc procedure itself need not be specifically designated a deallocator (via deallocator). If a deallocator is called explicitly, it need not be the same as dealloc.
procedure
((deallocator [get-arg]) dealloc) → procedure?
get-arg : (list? . -> . any/c) = car dealloc : procedure?
procedure
((releaser [get-arg]) dealloc) → procedure?
get-arg : (list? . -> . any/c) = car dealloc : procedure?
The optional get-arg procedure determines which of dealloc’s arguments correspond to the released object; get-arg receives a list of arguments passed to dealloc, so the default car selects the first one.
The releaser procedure is a synonym for deallocator.
procedure
((retainer release [get-arg]) retain) → procedure?
release : (any/c . -> . any) get-arg : (list? . -> . any/c) = car retain : procedure?
The optional get-arg procedure determines which of retain’s arguments correspond to the retained object; get-arg receives a list of arguments passed to retain, so the default car selects the first one.
The release procedure itself need not be specifically designated a deallocator (via deallocator). If a deallocator is called explicitly, it need not be the same as release.