4 <strong>Function
</strong> - Deallocate a region of virtual memory.
7 <strong>kern_return_t vm_deallocate
</strong>
8 <strong>(vm_task_t
</strong> <var>target_task
</var>,
9 <strong>vm_address_t
</strong> <var>address
</var>,
10 <strong>vm_size_t
</strong> <var>size
</var><strong>);
</strong>
15 <dt> <var>target_task
</var>
18 The port for the task in whose address space the
19 region is to be deallocated.
21 <dt> <var>address
</var>
24 The starting address for the region.
29 The number of bytes to deallocate.
33 The
<strong>vm_deallocate
</strong> function deallocates a region of
35 specified task's address space.
36 The region starts at the beginning of the virtual page containing
37 <var>address
</var> and ends
38 at the end of the virtual page containing
<var>address
</var>
39 +
<var>size
</var> -
1. Because of this
40 rounding to virtual page boundaries, the amount of memory deallocated may be
41 greater than
<var>size
</var>. Use
<strong>host_page_size
</strong>
42 to find the current virtual page size.
44 <strong>vm_deallocate
</strong> affects only
<var>target_task
</var>. Other tasks
45 that have access to the deallocated memory can continue to reference it.
48 <strong>vm_deallocate
</strong> can be used to deallocate memory passed
49 as out-of-line data in a
52 This interface is machine word length specific because of the virtual address
54 <h3>RETURN VALUES
</h3>
57 <dt> <strong>KERN_INVALID_ADDRESS
</strong>
59 The address is illegal or specifies a non-allocated region.
61 <h3>RELATED INFORMATION
</h3>
64 <a href=
"mach_msg.html"><strong>mach_msg
</strong></a>,
65 <a href=
"vm_allocate.html"><strong>vm_allocate
</strong></a>,
66 <a href=
"vm_map.html"><strong>vm_map
</strong></a>,
67 <a href=
"host_page_size.html"><strong>host_page_size
</strong></a>.