summaryrefslogblamecommitdiffstats
path: root/src/common/memory_util.h
blob: 76ca5a30c8d3b9cc77166f69b80be0d83676df41 (plain) (tree)
1
2
3
4
5
6
7

                                                                        

                                          
            
 
                  




                                                             
                                                           




                                                                             


                          
// Copyright 2013 Dolphin Emulator Project / 2014 Citra Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.

#pragma once

#include <cstddef>
#include <string>

void* AllocateExecutableMemory(size_t size, bool low = true);
void* AllocateMemoryPages(size_t size);
void FreeMemoryPages(void* ptr, size_t size);
void* AllocateAlignedMemory(size_t size, size_t alignment);
void FreeAlignedMemory(void* ptr);
void WriteProtectMemory(void* ptr, size_t size, bool executable = false);
void UnWriteProtectMemory(void* ptr, size_t size, bool allowExecute = false);
std::string MemUsage();

inline int GetPageSize() {
    return 4096;
}