~registry/dolphin-emu/triforce

« back to all changes in this revision

Viewing changes to Source/Core/Common/Src/MemoryUtil.h

  • Committer: Sérgio Benjamim
  • Date: 2015-02-13 05:54:40 UTC
  • Revision ID: sergio_br2@yahoo.com.br-20150213055440-ey2rt3sjpy27km78
Dolphin Triforce branch from code.google, commit b957980 (4.0-315).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright 2013 Dolphin Emulator Project
 
2
// Licensed under GPLv2
 
3
// Refer to the license.txt file included.
 
4
 
 
5
 
 
6
#ifndef _MEMORYUTIL_H
 
7
#define _MEMORYUTIL_H
 
8
 
 
9
#include <string>
 
10
 
 
11
#ifndef _WIN32
 
12
#include <sys/mman.h>
 
13
#endif
 
14
 
 
15
void* AllocateExecutableMemory(size_t size, bool low = true);
 
16
void* AllocateMemoryPages(size_t size);
 
17
void FreeMemoryPages(void* ptr, size_t size);
 
18
void* AllocateAlignedMemory(size_t size,size_t alignment);
 
19
void FreeAlignedMemory(void* ptr);
 
20
void WriteProtectMemory(void* ptr, size_t size, bool executable = false);
 
21
void UnWriteProtectMemory(void* ptr, size_t size, bool allowExecute = false);
 
22
std::string MemUsage();
 
23
 
 
24
inline int GetPageSize() { return 4096; }
 
25
 
 
26
#endif