Skip to content

Commit 38864a5

Browse files
committed
Merge branch 'main' into gizmos-v1
2 parents 9aa8ff9 + 4baa4ac commit 38864a5

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/app/memorychecker.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,13 @@ void MemoryChecker::sGetFreeKB(intKB& procFreeKB, intKB& sysFreeKB)
9999
&physical_memory_used,
100100
&bytes_in_use_by_app);
101101
#elif defined(Q_OS_MACOS)
102-
struct mach_task_basic_info info;
103-
mach_msg_type_number_t infoCount = MACH_TASK_BASIC_INFO_COUNT;
104-
if ( task_info( mach_task_self( ), MACH_TASK_BASIC_INFO,
105-
(task_info_t)&info, &infoCount ) == KERN_SUCCESS ) {
106-
bytes_in_use_by_app = info.resident_size;
102+
task_vm_info_data_t vm_info;
103+
mach_msg_type_number_t vm_info_count = TASK_VM_INFO_COUNT;
104+
if (task_info(mach_task_self(),
105+
TASK_VM_INFO,
106+
(task_info_t)&vm_info,
107+
&vm_info_count) == KERN_SUCCESS) {
108+
bytes_in_use_by_app = vm_info.phys_footprint;
107109
}
108110
#endif
109111

0 commit comments

Comments
 (0)