| 1 |
// |
| 2 |
// Copyright (c) 2008, Wei Mingzhi. All rights reserved. |
| 3 |
// |
| 4 |
// Use, redistribution and modification of this code is unrestricted |
| 5 |
// as long as this notice is preserved. |
| 6 |
// |
| 7 |
// This code is provided with ABSOLUTELY NO WARRANTY. |
| 8 |
// |
| 9 |
|
| 10 |
#ifndef MMAN_H |
| 11 |
#define MMAN_H |
| 12 |
|
| 13 |
#include <windows.h> |
| 14 |
|
| 15 |
#define mmap(start, length, prot, flags, fd, offset) \ |
| 16 |
((unsigned char *)VirtualAlloc(NULL, (length), MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE)) |
| 17 |
|
| 18 |
#define munmap(start, length) do { VirtualFree((start), (length), MEM_RELEASE); } while (0) |
| 19 |
|
| 20 |
#endif |