summaryrefslogtreecommitdiffstats
path: root/third_party/rust/mach/src/vm_statistics.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
commit36d22d82aa202bb199967e9512281e9a53db42c9 (patch)
tree105e8c98ddea1c1e4784a60a5a6410fa416be2de /third_party/rust/mach/src/vm_statistics.rs
parentInitial commit. (diff)
downloadfirefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz
firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/rust/mach/src/vm_statistics.rs')
-rw-r--r--third_party/rust/mach/src/vm_statistics.rs78
1 files changed, 78 insertions, 0 deletions
diff --git a/third_party/rust/mach/src/vm_statistics.rs b/third_party/rust/mach/src/vm_statistics.rs
new file mode 100644
index 0000000000..5cc3a15548
--- /dev/null
+++ b/third_party/rust/mach/src/vm_statistics.rs
@@ -0,0 +1,78 @@
+//! This module roughly corresponds to `mach/vm_statistics.h`
+
+use vm_types::{integer_t, natural_t};
+
+pub type vm_statistics_t = *mut vm_statistics;
+pub type vm_statistics_data_t = vm_statistics;
+#[cfg(feature = "deprecated")]
+#[deprecated(
+ since = "0.2.3",
+ note = "`pmap_statistics_t` was removed after MacOSX 10.3.9"
+)]
+#[allow(deprecated)]
+pub type pmap_statistics_t = *mut pmap_statistics;
+
+pub const VM_PAGE_QUERY_PAGE_PRESENT: integer_t = 1;
+pub const VM_PAGE_QUERY_PAGE_FICTITIOUS: integer_t = (1 << 1);
+pub const VM_PAGE_QUERY_PAGE_REF: integer_t = (1 << 2);
+pub const VM_PAGE_QUERY_PAGE_DIRTY: integer_t = (1 << 3);
+
+pub const VM_MEMORY_MALLOC: ::libc::c_uint = 1;
+pub const VM_MEMORY_MALLOC_SMALL: ::libc::c_uint = 2;
+pub const VM_MEMORY_MALLOC_LARGE: ::libc::c_uint = 3;
+pub const VM_MEMORY_MALLOC_HUGE: ::libc::c_uint = 4;
+pub const VM_MEMORY_SBRK: ::libc::c_uint = 5;
+pub const VM_MEMORY_ANALYSIS_TOOL: ::libc::c_uint = 10;
+pub const VM_MEMORY_MACH_MSG: ::libc::c_uint = 20;
+pub const VM_MEMORY_IOKIT: ::libc::c_uint = 21;
+pub const VM_MEMORY_STACK: ::libc::c_uint = 30;
+pub const VM_MEMORY_GUARD: ::libc::c_uint = 31;
+pub const VM_MEMORY_SHARED_PMAP: ::libc::c_uint = 32;
+pub const VM_MEMORY_DYLIB: ::libc::c_uint = 33;
+pub const VM_MEMORY_APPKIT: ::libc::c_uint = 40;
+pub const VM_MEMORY_FOUNDATION: ::libc::c_uint = 41;
+pub const VM_MEMORY_COREGRAPHICS: ::libc::c_uint = 42;
+pub const VM_MEMORY_CARBON: ::libc::c_uint = 43;
+pub const VM_MEMORY_JAVA: ::libc::c_uint = 44;
+pub const VM_MEMORY_ATS: ::libc::c_uint = 50;
+pub const VM_MEMORY_DYLD: ::libc::c_uint = 60;
+pub const VM_MEMORY_DYLD_MALLOC: ::libc::c_uint = 61;
+pub const VM_MEMORY_APPLICATION_SPECIFIC_1: ::libc::c_uint = 240;
+pub const VM_MEMORY_APPLICATION_SPECIFIC_16: ::libc::c_uint = 255;
+
+pub const VM_FLAGS_FIXED: ::libc::c_int = 0x0;
+pub const VM_FLAGS_ANYWHERE: ::libc::c_int = 0x1;
+pub const VM_FLAGS_OVERWRITE: ::libc::c_int = 0x4000;
+
+#[repr(C)]
+#[derive(Copy, Clone, Debug, Default, Hash, PartialOrd, PartialEq, Eq, Ord)]
+pub struct vm_statistics {
+ pub free_count: natural_t,
+ pub active_count: natural_t,
+ pub inactive_count: natural_t,
+ pub wire_count: natural_t,
+ pub zero_fill_count: natural_t,
+ pub reactivations: natural_t,
+ pub pageins: natural_t,
+ pub pageouts: natural_t,
+ pub faults: natural_t,
+ pub cow_faults: natural_t,
+ pub lookups: natural_t,
+ pub hits: natural_t,
+ pub purgeable_count: natural_t,
+ pub purges: natural_t,
+ pub speculative_count: natural_t,
+}
+
+#[cfg(feature = "deprecated")]
+#[deprecated(
+ since = "0.2.3",
+ note = "`pmap_statistics` was removed after MacOSX 10.3.9"
+)]
+#[cfg_attr(feature = "deprecated", allow(deprecated))]
+#[repr(C)]
+#[derive(Copy, Clone, Debug, Default, Hash, PartialOrd, PartialEq, Eq, Ord)]
+pub struct pmap_statistics {
+ pub resident_count: integer_t,
+ pub wired_count: integer_t,
+}