Advertisement
Guest User

Untitled

a guest
Oct 3rd, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
D 0.35 KB | None | 0 0
  1. MemoryMapping mmap(IMemoryMappable mmappable, size_t size = size_t.max,
  2.     size_t offset = 0, Protection prot = Protection.readWrite, void* addr = null)
  3. {
  4.     auto p = sys_mmap(addr, size, prot, MAP_SHARED, mmappable.handle, offset);
  5.     if (p == cast(void*)-1)
  6.         throw new SystemException("Memory mapping failed");
  7.     return MemoryMapping(p);
  8. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement