32#ifndef ZYCORE_API_MEMORY_H
33#define ZYCORE_API_MEMORY_H
41#if defined(ZYAN_WINDOWS)
43#elif defined(ZYAN_POSIX)
46# error "Unsupported platform detected"
58#if defined(ZYAN_WINDOWS)
60 ZYAN_PAGE_READONLY = PAGE_READONLY,
61 ZYAN_PAGE_READWRITE = PAGE_READWRITE,
62 ZYAN_PAGE_EXECUTE = PAGE_EXECUTE,
63 ZYAN_PAGE_EXECUTE_READ = PAGE_EXECUTE_READ,
64 ZYAN_PAGE_EXECUTE_READWRITE = PAGE_EXECUTE_READWRITE
66#elif defined(ZYAN_POSIX)
68 ZYAN_PAGE_READONLY = PROT_READ,
69 ZYAN_PAGE_READWRITE = PROT_READ | PROT_WRITE,
70 ZYAN_PAGE_EXECUTE = PROT_EXEC,
71 ZYAN_PAGE_EXECUTE_READ = PROT_EXEC | PROT_READ,
72 ZYAN_PAGE_EXECUTE_READWRITE = PROT_EXEC | PROT_READ | PROT_WRITE
General helper and platform detection macros.
#define ZYCORE_EXPORT
Symbol is exported in shared library builds.
Definition Defines.h:330
ZYCORE_EXPORT ZyanStatus ZyanMemoryVirtualFree(void *address, ZyanUSize size)
Releases one or more memory pages starting at the given address.
ZYCORE_EXPORT ZyanU32 ZyanMemoryGetSystemAllocationGranularity(void)
Returns the system allocation granularity.
ZYCORE_EXPORT ZyanStatus ZyanMemoryVirtualProtect(void *address, ZyanUSize size, ZyanMemoryPageProtection protection)
Changes the memory protection value of one or more pages.
ZyanMemoryPageProtection_
Defines the ZyanMemoryPageProtection enum.
Definition Memory.h:57
ZYCORE_EXPORT ZyanU32 ZyanMemoryGetSystemPageSize(void)
Returns the system page size.
enum ZyanMemoryPageProtection_ ZyanMemoryPageProtection
Defines the ZyanMemoryPageProtection enum.
Status code definitions and check macros.
ZyanU32 ZyanStatus
Defines the ZyanStatus data type.
Definition Status.h:48
Includes and defines some default data types.
size_t ZyanUSize
Definition Types.h:224
uint32_t ZyanU32
Definition Types.h:218