Next Previous Up Top Contents Index

1.8 Allocating and deallocating C storage

destroy

Open generic function

Summary

Frees the allocated heap memory at a specified address.

Signature

destroy C-pointer #key de-allocator => () 

Arguments

c-pointer
An instance of <C-pointer>.

de-allocator
An instance of <function>.

Library

c-ffi

Module

c-ffi

Description

Frees the allocated heap memory at the address encapsulated in C-pointer.

The deallocator argument should be a Dylan function that can serve as a deallocation facility. It must accept an address as a <machine-word> and free the storage allocated at that address.

You should only use destroy on pointers allocated using make where no address was given. If allocator was passed to make, the matching deallocator should be passed to destroy.

There is a default method for destroy on <C-statically-typed-pointer>.


C FFI and Win 32 Reference - 31 MAR 2000

Next Previous Up Top Contents Index