Zycore 1.4.0.0
Loading...
Searching...
No Matches
Typedefs | Enumerations | Functions
Memory.h File Reference
#include <Zycore/Defines.h>
#include <Zycore/Status.h>
#include <Zycore/Types.h>

Go to the source code of this file.

Typedefs

typedef enum ZyanMemoryPageProtection_ ZyanMemoryPageProtection
 

Enumerations

enum  ZyanMemoryPageProtection_
 

Functions

ZYCORE_EXPORT ZyanU32 ZyanMemoryGetSystemPageSize ()
 
ZYCORE_EXPORT ZyanU32 ZyanMemoryGetSystemAllocationGranularity ()
 
ZYCORE_EXPORT ZyanStatus ZyanMemoryVirtualProtect (void *address, ZyanUSize size, ZyanMemoryPageProtection protection)
 
ZYCORE_EXPORT ZyanStatus ZyanMemoryVirtualFree (void *address, ZyanUSize size)
 

Typedef Documentation

◆ ZyanMemoryPageProtection

Defines the ZyanMemoryPageProtection enum.

Enumeration Type Documentation

◆ ZyanMemoryPageProtection_

Defines the ZyanMemoryPageProtection enum.

Function Documentation

◆ ZyanMemoryGetSystemAllocationGranularity()

ZYCORE_EXPORT ZyanU32 ZyanMemoryGetSystemAllocationGranularity ( )

Returns the system allocation granularity.

The system allocation granularity specifies the minimum amount of bytes which can be allocated at a specific address by a single call of ZyanMemoryVirtualAlloc.

This value is typically 64KiB on Windows systems and equal to the page size on most POSIX platforms.

Returns
The system allocation granularity.

◆ ZyanMemoryGetSystemPageSize()

ZYCORE_EXPORT ZyanU32 ZyanMemoryGetSystemPageSize ( )

Returns the system page size.

Returns
The system page size.

◆ ZyanMemoryVirtualFree()

ZYCORE_EXPORT ZyanStatus ZyanMemoryVirtualFree ( void * address,
ZyanUSize size )

Releases one or more memory pages starting at the given address.

Parameters
addressThe start address aligned to a page boundary.
sizeThe size.
Returns
A zyan status code.

◆ ZyanMemoryVirtualProtect()

ZYCORE_EXPORT ZyanStatus ZyanMemoryVirtualProtect ( void * address,
ZyanUSize size,
ZyanMemoryPageProtection protection )

Changes the memory protection value of one or more pages.

Parameters
addressThe start address aligned to a page boundary.
sizeThe size.
protectionThe new page protection value.
Returns
A zyan status code.