comparison mem_win.c @ 747:85c98a222fea

Merge
author Michael Pavone <pavone@retrodev.com>
date Thu, 28 May 2015 23:05:32 -0700
parents 80a67be1770b
children bce97fc0bb8a
comparison
equal deleted inserted replaced
740:25c9e9d39997 747:85c98a222fea
1 /*
2 Copyright 2013 Michael Pavone
3 This file is part of BlastEm.
4 BlastEm is free software distributed under the terms of the GNU General Public License version 3 or greater. See COPYING for full license text.
5 */
6
7 #include "mem.h"
8 #include <Windows.h>
9
10 void * alloc_code(size_t *size)
11 {
12 *size += PAGE_SIZE - (*size & (PAGE_SIZE - 1));
13
14 return VirtualAlloc(NULL, *size, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE);
15 }