]> git.saurik.com Git - apple/xnu.git/blob - osfmk/man/vm_deallocate.html
xnu-7195.101.1.tar.gz
[apple/xnu.git] / osfmk / man / vm_deallocate.html
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]
18 The port for the task in whose address space the
19 region is to be deallocated.
20 <p>
21 <dt> <var>address</var>
22 <dd>
23 [in scalar]
24 The starting address for the region.
25 <p>
26 <dt> <var>size</var>
27 <dd>
28 [in scalar]
29 The number of bytes to deallocate.
30 </dl>
31 <h3>DESCRIPTION</h3>
32 <p>
33 The <strong>vm_deallocate</strong> function deallocates a region of
34 virtual memory in the
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.
43 <p>
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.
46 <h3>NOTES</h3>
47 <p>
48 <strong>vm_deallocate</strong> can be used to deallocate memory passed
49 as out-of-line data in a
50 message.
51 <p>
52 This interface is machine word length specific because of the virtual address
53 parameter.
54 <h3>RETURN VALUES</h3>
55 <dl>
56 <p>
57 <dt> <strong>KERN_INVALID_ADDRESS</strong>
58 <dd>
59 The address is illegal or specifies a non-allocated region.
60 </dl>
61 <h3>RELATED INFORMATION</h3>
62 <p>
63 Functions:
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>.