src/platform/windows/memory.c (view raw)
1/* Copyright (c) 2013-2014 Jeffrey Pfau
2 *
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6#include "util/memory.h"
7
8#include <windows.h>
9
10void* anonymousMemoryMap(size_t size) {
11 return VirtualAlloc(NULL, size, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE);
12}
13
14void mappedMemoryFree(void* memory, size_t size) {
15 UNUSED(size);
16 // size is not useful here because we're freeing the memory, not decommitting it
17 VirtualFree(memory, 0, MEM_RELEASE);
18}