deallocate - remove allocations
#include <libcgc.h> int deallocate(void *addr, size_t length)
deallocate system call deletes the allocations for the specified
address range, and causes further references to the addresses within the
range to generate invalid memory accesses. The region is also automatically
deallocated when the process is terminated.
addr must be a multiple of the page size. The
parameter specifies the size of the region to be deallocated in bytes.
All pages containing a part of the indicated range are deallocated, and
subsequent references will terminate the process. It is not an error if
the indicated range does not contain any allocated pages.
deallocate function is invoked through system call number 6.
deallocate returns 0; otherwise an error code is returned.
addris not page aligned.
- any part of the region being deallocated is outside the valid address range of the process.