Mercurial > repos > rhope
comparison runtime/block_alloc.h @ 63:04baa003de5a
Merged latest changes with better C branch
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Wed, 05 May 2010 22:12:23 -0400 |
parents | 3e20ed8959c4 |
children |
comparison
equal
deleted
inserted
replaced
62:b218af069da7 | 63:04baa003de5a |
---|---|
6 #include <windows.h> | 6 #include <windows.h> |
7 | 7 |
8 #define block_alloc(size) VirtualAlloc(NULL, size, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE); | 8 #define block_alloc(size) VirtualAlloc(NULL, size, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE); |
9 #define block_free(block,size) VirtualFree(block, size, MEM_RELEASE) | 9 #define block_free(block,size) VirtualFree(block, size, MEM_RELEASE) |
10 | 10 |
11 #else | |
12 #define BLOCK_SIZE 1024*4 | |
13 #include <sys/mman.h> | |
14 | |
15 #define block_alloc(size) mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0) | |
16 #define block_free(block,size) munmap(block, size) | |
17 | |
11 #endif | 18 #endif |
12 | 19 |
13 #endif //BLOCK_ALLOC_H_ | 20 #endif //BLOCK_ALLOC_H_ |