1<h2>vm_deallocate</h2>
2<hr>
3<p>
4<strong>Function</strong> - Deallocate a region of virtual memory.
5<h3>SYNOPSIS</h3>
6<pre>
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>
11</pre>
12<h3>PARAMETERS</h3>
13<dl>
14<p>
15<dt> <var>target_task</var> 
16<dd>
17[in task send right]
18The port for the task in whose address space the
19region is to be deallocated.
20<p>
21<dt> <var>address</var> 
22<dd>
23[in scalar]
24The starting address for the region.
25<p>
26<dt> <var>size</var> 
27<dd>
28[in scalar]
29The number of bytes to deallocate.
30</dl>
31<h3>DESCRIPTION</h3>
32<p>
33The <strong>vm_deallocate</strong> function deallocates a region of
34virtual memory in the
35specified task's address space.
36The region starts at the beginning of the virtual page containing
37<var>address</var> and ends 
38at the end of the virtual page containing <var>address</var>
39+ <var>size</var> - 1.  Because of this 
40rounding to virtual page boundaries, the amount of memory deallocated may be 
41greater than <var>size</var>.  Use <strong>host_page_size</strong> 
42to find the current virtual page size.
43<p>
44<strong>vm_deallocate</strong> affects only <var>target_task</var>.  Other tasks
45that have access to the deallocated memory can continue to reference it.
46<h3>NOTES</h3>
47<p>
48<strong>vm_deallocate</strong> can be used to deallocate memory passed
49as out-of-line data in a 
50message.
51<p>
52This interface is machine word length specific because of the virtual address
53parameter.
54<h3>RETURN VALUES</h3>
55<dl>
56<p>
57<dt> <strong>KERN_INVALID_ADDRESS</strong>
58<dd>
59The address is illegal or specifies a non-allocated region.
60</dl>
61<h3>RELATED INFORMATION</h3>
62<p>
63Functions:
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>.
68