---
name: "Memory.h"
section: "3"
platform: "linux"
package: "libzycore-doc"
version: "1.5.2-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Memory.h"
---

# Memory.h(3)

## NAME

include/Zycore/API/Memory.h

## SYNOPSIS

`#include <Zycore/Defines.h>`\
 `#include <Zycore/Status.h>`\
 `#include <Zycore/Types.h>`\

### Typedefs

typedef enum **ZyanMemoryPageProtection\_** **ZyanMemoryPageProtection**\

### Enumerations

enum **ZyanMemoryPageProtection\_** \

### Functions

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

## Typedef Documentation

### typedef enum ZyanMemoryPageProtection\_ ZyanMemoryPageProtection

Defines the `ZyanMemoryPageProtection` enum.

## Enumeration Type Documentation

### enum ZyanMemoryPageProtection\_

Defines the `ZyanMemoryPageProtection` enum.

## Function Documentation

### ZYCORE\_EXPORT ZyanU32 ZyanMemoryGetSystemAllocationGranularity (void)

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.

### ZYCORE\_EXPORT ZyanU32 ZyanMemoryGetSystemPageSize (void)

Returns the system page size.

**Returns**

The system page size.

### ZYCORE\_EXPORT ZyanStatus ZyanMemoryVirtualFree (void \* address, ZyanUSize size)

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

**Parameters**

*address* The start address aligned to a page boundary. \
 *size* The size.

**Returns**

A zyan status code.

### ZYCORE\_EXPORT ZyanStatus ZyanMemoryVirtualProtect (void \* address, ZyanUSize size, ZyanMemoryPageProtection protection)

Changes the memory protection value of one or more pages.

**Parameters**

*address* The start address aligned to a page boundary. \
 *size* The size. \
 *protection* The new page protection value.

**Returns**

A zyan status code.

## Author

Generated automatically by Doxygen for Zycore from the source code.
