Use the right ifdef macro, reviewed by Jason
llvm-svn: 240739
This commit is contained in:
parent
773e8c3966
commit
459a23e0a3
|
@ -384,7 +384,7 @@ MachTask::GetProfileData (DNBProfileDataScanType scanType)
|
|||
|
||||
#if defined (HOST_VM_INFO64_COUNT)
|
||||
vm_statistics64_data_t vminfo;
|
||||
#elif
|
||||
#else
|
||||
struct vm_statistics vminfo;
|
||||
#endif
|
||||
uint64_t physical_memory;
|
||||
|
@ -450,7 +450,7 @@ MachTask::GetProfileData (DNBProfileDataScanType scanType)
|
|||
{
|
||||
#if defined (HOST_VM_INFO64_COUNT)
|
||||
static vm_size_t pagesize = vm_kernel_page_size;
|
||||
#elif
|
||||
#else
|
||||
static vm_size_t pagesize;
|
||||
static bool calculated = false;
|
||||
if (!calculated)
|
||||
|
@ -468,7 +468,7 @@ MachTask::GetProfileData (DNBProfileDataScanType scanType)
|
|||
#if defined (HOST_VM_INFO64_COUNT)
|
||||
// This mimicks Activity Monitor.
|
||||
uint64_t total_used_count = (physical_memory / vm_kernel_page_size) - (vminfo.free_count - vminfo.speculative_count) - vminfo.external_page_count - vminfo.purgeable_count;
|
||||
#elif
|
||||
#else
|
||||
uint64_t total_used_count = vminfo.wire_count + vminfo.inactive_count + vminfo.active_count;
|
||||
#endif
|
||||
profile_data_stream << "used:" << total_used_count * pagesize << ';';
|
||||
|
|
|
@ -420,7 +420,7 @@ GetPurgeableAndAnonymous(task_t task, uint64_t &purgeable, uint64_t &anonymous)
|
|||
#if defined (HOST_VM_INFO64_COUNT)
|
||||
nub_bool_t
|
||||
MachVMMemory::GetMemoryProfile(DNBProfileDataScanType scanType, task_t task, struct task_basic_info ti, cpu_type_t cputype, nub_process_t pid, vm_statistics64_data_t &vminfo, uint64_t &physical_memory, mach_vm_size_t &rprvt, mach_vm_size_t &rsize, mach_vm_size_t &vprvt, mach_vm_size_t &vsize, mach_vm_size_t &dirty_size, mach_vm_size_t &purgeable, mach_vm_size_t &anonymous)
|
||||
#elif
|
||||
#else
|
||||
nub_bool_t
|
||||
MachVMMemory::GetMemoryProfile(DNBProfileDataScanType scanType, task_t task, struct task_basic_info ti, cpu_type_t cputype, nub_process_t pid, vm_statistics_data_t &vminfo, uint64_t &physical_memory, mach_vm_size_t &rprvt, mach_vm_size_t &rsize, mach_vm_size_t &vprvt, mach_vm_size_t &vsize, mach_vm_size_t &dirty_size, mach_vm_size_t &purgeable, mach_vm_size_t &anonymous)
|
||||
#endif
|
||||
|
@ -434,7 +434,7 @@ MachVMMemory::GetMemoryProfile(DNBProfileDataScanType scanType, task_t task, str
|
|||
#if defined (HOST_VM_INFO64_COUNT)
|
||||
mach_msg_type_number_t count = HOST_VM_INFO64_COUNT;
|
||||
host_statistics64(localHost, HOST_VM_INFO64, (host_info64_t)&vminfo, &count);
|
||||
#elif
|
||||
#else
|
||||
mach_msg_type_number_t count = HOST_VM_INFO_COUNT;
|
||||
host_statistics(localHost, HOST_VM_INFO, (host_info_t)&vminfo, &count);
|
||||
vminfo.wire_count += GetStolenPages(task);
|
||||
|
|
|
@ -30,7 +30,7 @@ public:
|
|||
nub_bool_t GetMemoryRegionInfo(task_t task, nub_addr_t address, DNBRegionInfo *region_info);
|
||||
#if defined (HOST_VM_INFO64_COUNT)
|
||||
nub_bool_t GetMemoryProfile(DNBProfileDataScanType scanType, task_t task, struct task_basic_info ti, cpu_type_t cputype, nub_process_t pid, vm_statistics64_data_t &vminfo, uint64_t &physical_memory, mach_vm_size_t &rprvt, mach_vm_size_t &rsize, mach_vm_size_t &vprvt, mach_vm_size_t &vsize, mach_vm_size_t &dirty_size, mach_vm_size_t &purgeable, mach_vm_size_t &anonymous);
|
||||
#elif
|
||||
#else
|
||||
nub_bool_t GetMemoryProfile(DNBProfileDataScanType scanType, task_t task, struct task_basic_info ti, cpu_type_t cputype, nub_process_t pid, vm_statistics_data_t &vminfo, uint64_t &physical_memory, mach_vm_size_t &rprvt, mach_vm_size_t &rsize, mach_vm_size_t &vprvt, mach_vm_size_t &vsize, mach_vm_size_t &dirty_size, mach_vm_size_t &purgeable, mach_vm_size_t &anonymous);
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in New Issue