Debian Codegraph @

third_party/rust/mach/src/vm_statistics.rs

raw
1 //! This module roughly corresponds to `mach/vm_statistics.h`
2
3 use vm_types::{integer_t, natural_t};
4
5 pub type vm_statistics_t = *mut vm_statistics;
6 pub type vm_statistics_data_t = vm_statistics;
7 #[cfg(feature = "deprecated")]
8 #[deprecated(
9 since = "0.2.3",
10 note = "`pmap_statistics_t` was removed after MacOSX 10.3.9"
11 )]
12 #[allow(deprecated)]
13 pub type pmap_statistics_t = *mut pmap_statistics;
14
15 pub const VM_PAGE_QUERY_PAGE_PRESENT: integer_t = 1;
16 pub const VM_PAGE_QUERY_PAGE_FICTITIOUS: integer_t = (1 << 1);
17 pub const VM_PAGE_QUERY_PAGE_REF: integer_t = (1 << 2);
18 pub const VM_PAGE_QUERY_PAGE_DIRTY: integer_t = (1 << 3);
19
20 pub const VM_MEMORY_MALLOC: ::libc::c_uint = 1;
21 pub const VM_MEMORY_MALLOC_SMALL: ::libc::c_uint = 2;
22 pub const VM_MEMORY_MALLOC_LARGE: ::libc::c_uint = 3;
23 pub const VM_MEMORY_MALLOC_HUGE: ::libc::c_uint = 4;
24 pub const VM_MEMORY_SBRK: ::libc::c_uint = 5;
25 pub const VM_MEMORY_ANALYSIS_TOOL: ::libc::c_uint = 10;
26 pub const VM_MEMORY_MACH_MSG: ::libc::c_uint = 20;
27 pub const VM_MEMORY_IOKIT: ::libc::c_uint = 21;
28 pub const VM_MEMORY_STACK: ::libc::c_uint = 30;
29 pub const VM_MEMORY_GUARD: ::libc::c_uint = 31;
30 pub const VM_MEMORY_SHARED_PMAP: ::libc::c_uint = 32;
31 pub const VM_MEMORY_DYLIB: ::libc::c_uint = 33;
32 pub const VM_MEMORY_APPKIT: ::libc::c_uint = 40;
33 pub const VM_MEMORY_FOUNDATION: ::libc::c_uint = 41;
34 pub const VM_MEMORY_COREGRAPHICS: ::libc::c_uint = 42;
35 pub const VM_MEMORY_CARBON: ::libc::c_uint = 43;
36 pub const VM_MEMORY_JAVA: ::libc::c_uint = 44;
37 pub const VM_MEMORY_ATS: ::libc::c_uint = 50;
38 pub const VM_MEMORY_DYLD: ::libc::c_uint = 60;
39 pub const VM_MEMORY_DYLD_MALLOC: ::libc::c_uint = 61;
40 pub const VM_MEMORY_APPLICATION_SPECIFIC_1: ::libc::c_uint = 240;
41 pub const VM_MEMORY_APPLICATION_SPECIFIC_16: ::libc::c_uint = 255;
42
43 pub const VM_FLAGS_FIXED: ::libc::c_int = 0x0;
44 pub const VM_FLAGS_ANYWHERE: ::libc::c_int = 0x1;
45 pub const VM_FLAGS_OVERWRITE: ::libc::c_int = 0x4000;
46
47 #[repr(C)]
48 #[derive(Copy, Clone, Debug, Default, Hash, PartialOrd, PartialEq, Eq, Ord)]
49 pub struct vm_statistics {
50 pub free_count: natural_t,
51 pub active_count: natural_t,
52 pub inactive_count: natural_t,
53 pub wire_count: natural_t,
54 pub zero_fill_count: natural_t,
55 pub reactivations: natural_t,
56 pub pageins: natural_t,
57 pub pageouts: natural_t,
58 pub faults: natural_t,
59 pub cow_faults: natural_t,
60 pub lookups: natural_t,
61 pub hits: natural_t,
62 pub purgeable_count: natural_t,
63 pub purges: natural_t,
64 pub speculative_count: natural_t,
65 }
66
67 #[cfg(feature = "deprecated")]
68 #[deprecated(
69 since = "0.2.3",
70 note = "`pmap_statistics` was removed after MacOSX 10.3.9"
71 )]
72 #[cfg_attr(feature = "deprecated", allow(deprecated))]
73 #[repr(C)]
74 #[derive(Copy, Clone, Debug, Default, Hash, PartialOrd, PartialEq, Eq, Ord)]
75 pub struct pmap_statistics {
76 pub resident_count: integer_t,
77 pub wired_count: integer_t,
78 }