162 |
|
return 0; |
163 |
|
|
164 |
|
#ifdef HAVE_MACH_VM |
165 |
< |
int ret_code = vm_deallocate(mach_task_self(), (vm_address_t)addr, size); |
166 |
< |
return ret_code == KERN_SUCCESS ? 0 : -1; |
165 |
> |
if (vm_deallocate(mach_task_self(), (vm_address_t)addr, size) != KERN_SUCCESS) |
166 |
> |
return -1; |
167 |
|
#else |
168 |
|
#ifdef HAVE_MMAP_VM |
169 |
< |
int ret_code = munmap(addr, size); |
170 |
< |
return ret_code == 0 ? 0 : -1; |
169 |
> |
if (munmap(addr, size) != 0) |
170 |
> |
return -1; |
171 |
|
#else |
172 |
|
free(addr); |
173 |
– |
return 0; |
173 |
|
#endif |
174 |
|
#endif |
175 |
+ |
|
176 |
+ |
return 0; |
177 |
|
} |
178 |
|
|
179 |
|
/* Change the memory protection of the region starting at ADDR and |