+#if defined(__APPLE__)
+ // ignore the multiplier
+
+ task_t task;
+ if (task_for_pid (mach_task_self (), pid, &task) != KERN_SUCCESS)
+ RET_ERROR (MONO_PROCESS_ERROR_NOT_FOUND);
+
+ struct task_basic_info t_info;
+ mach_msg_type_number_t th_count = TASK_BASIC_INFO_COUNT;
+
+ if (task_info (task, TASK_BASIC_INFO, (task_info_t)&t_info, &th_count) != KERN_SUCCESS)
+ RET_ERROR (MONO_PROCESS_ERROR_OTHER);
+
+ if (strcmp (item, "VmRSS") == 0 || strcmp (item, "VmHWM") == 0)
+ return t_info.resident_size;
+ else if (strcmp (item, "VmSize") == 0 || strcmp (item, "VmPeak") == 0)
+ return t_info.virtual_size;
+ else if (strcmp (item, "Threads") == 0)
+ return th_count;
+ return 0;
+#else