ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/Unix/vm_alloc.cpp
(Generate patch)

Comparing BasiliskII/src/Unix/vm_alloc.cpp (file contents):
Revision 1.33 by asvitkine, 2011-12-30T20:37:30Z vs.
Revision 1.34 by asvitkine, 2011-12-31T19:47:16Z

# Line 236 | Line 236 | void * vm_acquire(size_t size, int optio
236                  return VM_MAP_FAILED;
237   #endif
238  
239 < #ifdef HAVE_MACH_VM
239 > #if defined(HAVE_MACH_VM)
240          // vm_allocate() returns a zero-filled memory region
241          kern_return_t ret_code = vm_allocate(mach_task_self(), (vm_address_t *)&addr, size, TRUE);
242          if (ret_code != KERN_SUCCESS) {
243                  errno = vm_error(ret_code);
244                  return VM_MAP_FAILED;
245          }
246 < #else
247 < #ifdef HAVE_MMAP_VM
246 > #elif defined(HAVE_MMAP_VM)
247          int fd = zero_fd;
248          int the_map_flags = translate_map_flags(options) | map_flags;
249  
# Line 256 | Line 255 | void * vm_acquire(size_t size, int optio
255                  return VM_MAP_FAILED;
256  
257          next_address = (char *)addr + size;
258 < #else
260 < #ifdef HAVE_WIN32_VM
258 > #elif defined(HAVE_WIN32_VM)
259          int alloc_type = MEM_RESERVE | MEM_COMMIT;
260          if (options & VM_MAP_WRITE_WATCH)
261            alloc_type |= MEM_WRITE_WATCH;
# Line 271 | Line 269 | void * vm_acquire(size_t size, int optio
269          // Omit changes for protections because they are not supported in this mode
270          return addr;
271   #endif
274 #endif
275 #endif
272  
273          // Explicitely protect the newly mapped region here because on some systems,
274          // say MacOS X, mmap() doesn't honour the requested protection flags.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines