mirror of
https://github.com/0O0o0oOoO00/Alas.git
synced 2026-05-22 10:29:28 +08:00
27 lines
691 B
C++
27 lines
691 B
C++
#ifndef PLATFORM_INTERFACE_COMMON_PLATFORM_H
|
|
#define PLATFORM_INTERFACE_COMMON_PLATFORM_H
|
|
|
|
#include "dobby/common.h"
|
|
|
|
// ================================================================
|
|
// base :: OSMemory
|
|
|
|
enum MemoryPermission { kNoAccess, kRead, kReadWrite, kReadWriteExecute, kReadExecute };
|
|
|
|
class OSMemory {
|
|
public:
|
|
static int PageSize();
|
|
|
|
static void *Allocate(size_t size, MemoryPermission access);
|
|
|
|
static void *Allocate(size_t size, MemoryPermission access, void *fixed_address);
|
|
|
|
static bool Free(void *address, size_t size);
|
|
|
|
static bool Release(void *address, size_t size);
|
|
|
|
static bool SetPermission(void *address, size_t size, MemoryPermission access);
|
|
};
|
|
|
|
#endif
|