Changeset 4314 for zzuf/trunk/src
- Timestamp:
- Feb 6, 2010, 2:37:52 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
zzuf/trunk/src/libzzuf/lib-mem.c
r4286 r4314 132 132 /* setrlimit(RLIMIT_AS) is ignored on OS X, we need to check memory usage 133 133 * from inside the process. Oh, and getrusage() doesn't work either. */ 134 #if defined HAVE_MACH_TASK_H135 vm_size_t mach_page_size;136 #endif137 138 134 static int memory_exceeded(void) 139 135 { … … 144 140 if (task_info(mach_task_self(), TASK_BASIC_INFO, 145 141 (task_info_t)&tbi, &mmtn) == KERN_SUCCESS 146 && (int64_t)tbi.resident_size * mach_page_size / 1048576 147 > (int64_t)_zz_memory) 142 && (int64_t)tbi.resident_size / 1048576 > (int64_t)_zz_memory) 148 143 return 1; 149 144 #endif … … 157 152 LOADSYM(malloc); 158 153 LOADSYM(realloc); 159 160 #if defined HAVE_MACH_TASK_H161 host_page_size(mach_host_self(), &mach_page_size);162 #endif163 154 } 164 155
Note: See TracChangeset
for help on using the changeset viewer.