| 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 |
|
| 8 |
pub const VM_PAGE_QUERY_PAGE_PRESENT: integer_t = 1; |
| 9 |
pub const VM_PAGE_QUERY_PAGE_FICTITIOUS: integer_t = 1 << 1; |
| 10 |
pub const VM_PAGE_QUERY_PAGE_REF: integer_t = 1 << 2; |
| 11 |
pub const VM_PAGE_QUERY_PAGE_DIRTY: integer_t = 1 << 3; |
| 12 |
|
| 13 |
pub const VM_MEMORY_MALLOC: ::libc::c_uint = 1; |
| 14 |
pub const VM_MEMORY_MALLOC_SMALL: ::libc::c_uint = 2; |
| 15 |
pub const VM_MEMORY_MALLOC_LARGE: ::libc::c_uint = 3; |
| 16 |
pub const VM_MEMORY_MALLOC_HUGE: ::libc::c_uint = 4; |
| 17 |
pub const VM_MEMORY_SBRK: ::libc::c_uint = 5; |
| 18 |
pub const VM_MEMORY_ANALYSIS_TOOL: ::libc::c_uint = 10; |
| 19 |
pub const VM_MEMORY_MACH_MSG: ::libc::c_uint = 20; |
| 20 |
pub const VM_MEMORY_IOKIT: ::libc::c_uint = 21; |
| 21 |
pub const VM_MEMORY_STACK: ::libc::c_uint = 30; |
| 22 |
pub const VM_MEMORY_GUARD: ::libc::c_uint = 31; |
| 23 |
pub const VM_MEMORY_SHARED_PMAP: ::libc::c_uint = 32; |
| 24 |
pub const VM_MEMORY_DYLIB: ::libc::c_uint = 33; |
| 25 |
pub const VM_MEMORY_APPKIT: ::libc::c_uint = 40; |
| 26 |
pub const VM_MEMORY_FOUNDATION: ::libc::c_uint = 41; |
| 27 |
pub const VM_MEMORY_COREGRAPHICS: ::libc::c_uint = 42; |
| 28 |
pub const VM_MEMORY_CARBON: ::libc::c_uint = 43; |
| 29 |
pub const VM_MEMORY_JAVA: ::libc::c_uint = 44; |
| 30 |
pub const VM_MEMORY_ATS: ::libc::c_uint = 50; |
| 31 |
pub const VM_MEMORY_DYLD: ::libc::c_uint = 60; |
| 32 |
pub const VM_MEMORY_DYLD_MALLOC: ::libc::c_uint = 61; |
| 33 |
pub const VM_MEMORY_APPLICATION_SPECIFIC_1: ::libc::c_uint = 240; |
| 34 |
pub const VM_MEMORY_APPLICATION_SPECIFIC_16: ::libc::c_uint = 255; |
| 35 |
|
| 36 |
pub const VM_FLAGS_FIXED: ::libc::c_int = 0x0; |
| 37 |
pub const VM_FLAGS_ANYWHERE: ::libc::c_int = 0x1; |
| 38 |
pub const VM_FLAGS_OVERWRITE: ::libc::c_int = 0x4000; |
| 39 |
|
| 40 |
#[repr(C)] |
| 41 |
#[derive(Copy, Clone, Debug, Default, Hash, PartialOrd, PartialEq, Eq, Ord)] |
| 42 |
pub struct vm_statistics { |
| 43 |
pub free_count: natural_t, |
| 44 |
pub active_count: natural_t, |
| 45 |
pub inactive_count: natural_t, |
| 46 |
pub wire_count: natural_t, |
| 47 |
pub zero_fill_count: natural_t, |
| 48 |
pub reactivations: natural_t, |
| 49 |
pub pageins: natural_t, |
| 50 |
pub pageouts: natural_t, |
| 51 |
pub faults: natural_t, |
| 52 |
pub cow_faults: natural_t, |
| 53 |
pub lookups: natural_t, |
| 54 |
pub hits: natural_t, |
| 55 |
pub purgeable_count: natural_t, |
| 56 |
pub purges: natural_t, |
| 57 |
pub speculative_count: natural_t, |
| 58 |
} |