We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
struct mach_task_basic_info info; mach_msg_type_number_t count = MACH_TASK_BASIC_INFO_COUNT; int r = task_info(mach_task_self(), MACH_TASK_BASIC_INFO, (task_info_t)& info, & count); if (r == KERN_SUCCESS) { return info.phys_footprint; } else { return -1; }
中的info为mach_task_basic_info,这个结构体中并没有phys_footprint变量。
int64_t usage = 0; task_vm_info_data_t vmInfo; mach_msg_type_number_t count = TASK_VM_INFO_COUNT; kern_return_t kr = task_info(mach_task_self(), TASK_VM_INFO, (task_info_t) &vmInfo, &count); if(kr != KERN_SUCCESS) { return -1; } usage = (int64_t) vmInfo.phys_footprint; return usage;
换成这个就OK了
The text was updated successfully, but these errors were encountered:
No branches or pull requests
中的info为mach_task_basic_info,这个结构体中并没有phys_footprint变量。
换成这个就OK了
The text was updated successfully, but these errors were encountered: