# align16
inline function align16(value)Implements the `align16` operation for `miniquake.memory` (align16).
| Parameter | Type | Default | Description |
|---|---|---|---|
value | dynamic | — | Value consumed by `align16`. |
src/miniquake/memory.mlminiquake/protocol_text.ml as quakeText → src/miniquake/protocol_text.mlminiquake/zone.ml as zone → src/miniquake/zone.mlinline function align16(value)Implements the `align16` operation for `miniquake.memory` (align16).
| Parameter | Type | Default | Description |
|---|---|---|---|
value | dynamic | — | Value consumed by `align16`. |
function allocate(state, size, name, kind)Implements the `allocate` operation for `miniquake.memory` (allocate).
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.memory` state used by `allocate`. |
size | dynamic | — | Size of the requested data or resource. |
name | dynamic | — | Stable name that identifies the requested object or option. |
kind | dynamic | — | The kind input consumed by `allocate`. |
function Cache_Alloc(state, user, size, name)Mirror Quake's Cache_Alloc routine and its observable state changes.
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.memory` state used by `Cache_Alloc`. |
user | dynamic | — | The user input consumed by `Cache_Alloc`. |
size | dynamic | — | Size of the requested data or resource. |
name | dynamic | — | Stable name that identifies the requested object or option. |
function Cache_Check(state, user)Implements the `Cache_Check` operation for `miniquake.memory` (cache check).
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.memory` state used by `Cache_Check`. |
user | dynamic | — | The user input consumed by `Cache_Check`. |
function Cache_Compact(state)Mirror Quake's Cache_Compact routine and its observable state changes.
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.memory` state used by `Cache_Compact`. |
function Cache_Flush(state)Mirror Quake's Cache_Flush routine and its observable state changes.
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.memory` state used by `Cache_Flush`. |
function Cache_Free(user)Mirror Quake's Cache_Free routine and its observable state changes.
| Parameter | Type | Default | Description |
|---|---|---|---|
user | dynamic | — | The user input consumed by `Cache_Free`. |
function Cache_FreeHigh(state, newHighHunk)Mirror Quake's Cache_FreeHigh routine and its observable state changes.
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.memory` state used by `Cache_FreeHigh`. |
newHighHunk | dynamic | — | The new high hunk input consumed by `Cache_FreeHigh`. |
function Cache_FreeLow(state, newLowHunk)Mirror Quake's Cache_FreeLow routine and its observable state changes.
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.memory` state used by `Cache_FreeLow`. |
newLowHunk | dynamic | — | The new low hunk input consumed by `Cache_FreeLow`. |
const CACHE_HEADER_SIZE = 40Defines the cache header size value used by `miniquake.memory`.
function Cache_Init(state)Mirror Quake's Cache_Init routine and its observable state changes.
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.memory` state used by `Cache_Init`. |
function Cache_MakeLRU(block)Mirror Quake's Cache_MakeLRU routine and its observable state changes.
| Parameter | Type | Default | Description |
|---|---|---|---|
block | dynamic | — | The block input consumed by `Cache_MakeLRU`. |
function Cache_Move(block)Mirror Quake's Cache_Move routine and its observable state changes.
| Parameter | Type | Default | Description |
|---|---|---|---|
block | dynamic | — | The block input consumed by `Cache_Move`. |
function Cache_Print(state)Mirror Quake's Cache_Print routine and its observable state changes.
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.memory` state used by `Cache_Print`. |
function Cache_Report(state)Mirror Quake's Cache_Report routine and its observable state changes.
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.memory` state used by `Cache_Report`. |
function Cache_TryAlloc(state, size, noBottom)Mirror Quake's Cache_TryAlloc routine and its observable state changes.
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.memory` state used by `Cache_TryAlloc`. |
size | dynamic | — | Size of the requested data or resource. |
noBottom | dynamic | — | The no bottom input consumed by `Cache_TryAlloc`. |
function Cache_UnlinkLRU(block)Mirror Quake's Cache_UnlinkLRU routine and its observable state changes.
| Parameter | Type | Default | Description |
|---|---|---|---|
block | dynamic | — | The block input consumed by `Cache_UnlinkLRU`. |
function cacheAlloc(state, size, name)Implements the `cacheAlloc` operation for `miniquake.memory` (cache alloc).
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.memory` state used by `cacheAlloc`. |
size | dynamic | — | Size of the requested data or resource. |
name | dynamic | — | Stable name that identifies the requested object or option. |
function cacheAllocUser(state, user, size, name)Implements the `cacheAllocUser` operation for `miniquake.memory` (cache alloc user).
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.memory` state used by `cacheAllocUser`. |
user | dynamic | — | The user input consumed by `cacheAllocUser`. |
size | dynamic | — | Size of the requested data or resource. |
name | dynamic | — | Stable name that identifies the requested object or option. |
miniquake.memory.CacheBlock struct
function cacheCheck(state, user)Implements the `cacheCheck` operation for `miniquake.memory` (cache check).
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.memory` state used by `cacheCheck`. |
user | dynamic | — | The user input consumed by `cacheCheck`. |
function cacheCompact(state)Implements the `cacheCompact` operation for `miniquake.memory` (cache compact).
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.memory` state used by `cacheCompact`. |
function cacheFlush(state)Implements the `cacheFlush` operation for `miniquake.memory` (cache flush).
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.memory` state used by `cacheFlush`. |
function cacheFree(user)Implements the `cacheFree` operation for `miniquake.memory` (cache free).
| Parameter | Type | Default | Description |
|---|---|---|---|
user | dynamic | — | The user input consumed by `cacheFree`. |
function cacheFreeHigh(state, newHighHunk)Implements the `cacheFreeHigh` operation for `miniquake.memory` (cache free high).
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.memory` state used by `cacheFreeHigh`. |
newHighHunk | dynamic | — | The new high hunk input consumed by `cacheFreeHigh`. |
function cacheFreeLow(state, newLowHunk)Implements the `cacheFreeLow` operation for `miniquake.memory` (cache free low).
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.memory` state used by `cacheFreeLow`. |
newLowHunk | dynamic | — | The new low hunk input consumed by `cacheFreeLow`. |
function cacheInit(state)Update subsystem state for cache init.
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.memory` state used by `cacheInit`. |
function cacheMove(block)Implements the `cacheMove` operation for `miniquake.memory` (cache move).
| Parameter | Type | Default | Description |
|---|---|---|---|
block | dynamic | — | The block input consumed by `cacheMove`. |
function cachePayloadUsed(state)Implements the `cachePayloadUsed` operation for `miniquake.memory` (cache payload used).
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.memory` state used by `cachePayloadUsed`. |
function cachePrint(state)Implements the `cachePrint` operation for `miniquake.memory` (cache print).
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.memory` state used by `cachePrint`. |
function cacheReport(state)Implements the `cacheReport` operation for `miniquake.memory` (cache report).
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.memory` state used by `cacheReport`. |
function cacheStartIndex(state, block)Return cache start index derived from the active module state.
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.memory` state used by `cacheStartIndex`. |
block | dynamic | — | The block input consumed by `cacheStartIndex`. |
function cacheTryAlloc(state, span, noBottom)Implements the `cacheTryAlloc` operation for `miniquake.memory` (cache try alloc).
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.memory` state used by `cacheTryAlloc`. |
span | dynamic | — | The span input consumed by `cacheTryAlloc`. |
noBottom | dynamic | — | The no bottom input consumed by `cacheTryAlloc`. |
function cacheTryAllocBlock(state, span, noBottom)Cache_TryAlloc itself creates and links a cache header. Cache_Alloc uses the lower-level position search because it must fill the user/name/payload fields atomically before exposing the new block.
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.memory` state used by `cacheTryAllocBlock`. |
span | dynamic | — | The span input consumed by `cacheTryAllocBlock`. |
noBottom | dynamic | — | The no bottom input consumed by `cacheTryAllocBlock`. |
miniquake.memory.CacheUser struct
function create(capacity)Implements the `create` operation for `miniquake.memory` (create).
| Parameter | Type | Default | Description |
|---|---|---|---|
capacity | dynamic | — | Maximum number of entries the destination can hold. |
inline function freeHunkBytes(state)Release state for free hunk bytes.
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.memory` state used by `freeHunkBytes`. |
function freeToHighMark(state, mark)Release state for free to high mark.
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.memory` state used by `freeToHighMark`. |
mark | dynamic | — | The mark input consumed by `freeToHighMark`. |
function freeToLowMark(state, mark)Release state for free to low mark.
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.memory` state used by `freeToLowMark`. |
mark | dynamic | — | The mark input consumed by `freeToLowMark`. |
function highMark(state)Implements the `highMark` operation for `miniquake.memory` (high mark).
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.memory` state used by `highMark`. |
function Hunk_Alloc(state, size)Mirror Quake's Hunk_Alloc routine and its observable state changes.
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.memory` state used by `Hunk_Alloc`. |
size | dynamic | — | Size of the requested data or resource. |
function Hunk_AllocName(state, size, name)Mirror Quake's Hunk_AllocName routine and its observable state changes.
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.memory` state used by `Hunk_AllocName`. |
size | dynamic | — | Size of the requested data or resource. |
name | dynamic | — | Stable name that identifies the requested object or option. |
function Hunk_Check(state)Explicit zone.c entry points. MemoryManager replaces the original global hunk/cache variables, while marks remain byte offsets as in MiniQuake.
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.memory` state used by `Hunk_Check`. |
function Hunk_FreeToHighMark(state, mark)Mirror Quake's Hunk_FreeToHighMark routine and its observable state changes.
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.memory` state used by `Hunk_FreeToHighMark`. |
mark | dynamic | — | The mark input consumed by `Hunk_FreeToHighMark`. |
function Hunk_FreeToLowMark(state, mark)Mirror Quake's Hunk_FreeToLowMark routine and its observable state changes.
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.memory` state used by `Hunk_FreeToLowMark`. |
mark | dynamic | — | The mark input consumed by `Hunk_FreeToLowMark`. |
const HUNK_HEADER_SIZE = 16Defines the hunk header size value used by `miniquake.memory`.
function Hunk_HighAllocName(state, size, name)Mirror Quake's Hunk_HighAllocName routine and its observable state changes.
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.memory` state used by `Hunk_HighAllocName`. |
size | dynamic | — | Size of the requested data or resource. |
name | dynamic | — | Stable name that identifies the requested object or option. |
function Hunk_HighMark(state)Mirror Quake's Hunk_HighMark routine and its observable state changes.
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.memory` state used by `Hunk_HighMark`. |
function Hunk_LowMark(state)Mirror Quake's Hunk_LowMark routine and its observable state changes.
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.memory` state used by `Hunk_LowMark`. |
function Hunk_Print(state, all)Mirror Quake's Hunk_Print routine and its observable state changes.
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.memory` state used by `Hunk_Print`. |
all | dynamic | — | The all input consumed by `Hunk_Print`. |
const HUNK_SENTINEL = 502268397Defines the hunk sentinel value used by `miniquake.memory`.
function Hunk_TempAlloc(state, size)Mirror Quake's Hunk_TempAlloc routine and its observable state changes.
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.memory` state used by `Hunk_TempAlloc`. |
size | dynamic | — | Size of the requested data or resource. |
function hunkAlloc(state, size)Implements the `hunkAlloc` operation for `miniquake.memory` (hunk alloc).
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.memory` state used by `hunkAlloc`. |
size | dynamic | — | Size of the requested data or resource. |
function hunkAllocName(state, size, name)Return hunk alloc name derived from the active module state.
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.memory` state used by `hunkAllocName`. |
size | dynamic | — | Size of the requested data or resource. |
name | dynamic | — | Stable name that identifies the requested object or option. |
miniquake.memory.HunkBlock struct
function hunkCheck(state)Implements the `hunkCheck` operation for `miniquake.memory` (hunk check).
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.memory` state used by `hunkCheck`. |
function hunkHighAllocName(state, size, name)Return hunk high alloc name derived from the active module state.
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.memory` state used by `hunkHighAllocName`. |
size | dynamic | — | Size of the requested data or resource. |
name | dynamic | — | Stable name that identifies the requested object or option. |
function hunkPayloadUsed(state)Implements the `hunkPayloadUsed` operation for `miniquake.memory` (hunk payload used).
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.memory` state used by `hunkPayloadUsed`. |
function hunkPrint(state, all)Implements the `hunkPrint` operation for `miniquake.memory` (hunk print).
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.memory` state used by `hunkPrint`. |
all | dynamic | — | The all input consumed by `hunkPrint`. |
function hunkTempAlloc(state, size, name)Implements the `hunkTempAlloc` operation for `miniquake.memory` (hunk temp alloc).
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.memory` state used by `hunkTempAlloc`. |
size | dynamic | — | Size of the requested data or resource. |
name | dynamic | — | Stable name that identifies the requested object or option. |
function insertCacheSorted(state, block)Add state for insert cache sorted.
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.memory` state used by `insertCacheSorted`. |
block | dynamic | — | The block input consumed by `insertCacheSorted`. |
function leastRecentlyUsed(state)Implements the `leastRecentlyUsed` operation for `miniquake.memory` (least recently used).
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.memory` state used by `leastRecentlyUsed`. |
function lowMark(state)Implements the `lowMark` operation for `miniquake.memory` (low mark).
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.memory` state used by `lowMark`. |
function makeLru(block)Create and initialize lru.
| Parameter | Type | Default | Description |
|---|---|---|---|
block | dynamic | — | The block input consumed by `makeLru`. |
function Memory_Init(capacity, zoneSize)Mirror Quake's Memory_Init routine and its observable state changes.
| Parameter | Type | Default | Description |
|---|---|---|---|
capacity | dynamic | — | Maximum number of entries the destination can hold. |
zoneSize | dynamic | — | Size of the requested data or resource. |
function memoryInit(capacity, zoneSize)Update subsystem state for memory init.
| Parameter | Type | Default | Description |
|---|---|---|---|
capacity | dynamic | — | Maximum number of entries the destination can hold. |
zoneSize | dynamic | — | Size of the requested data or resource. |
function memoryInitArguments(capacity, commandLine)Implements the `memoryInitArguments` operation for `miniquake.memory` (memory init arguments).
| Parameter | Type | Default | Description |
|---|---|---|---|
capacity | dynamic | — | Maximum number of entries the destination can hold. |
commandLine | dynamic | — | The command line input consumed by `memoryInitArguments`. |
miniquake.memory.MemoryManager struct
function newCacheUser(state)Create and initialize cache user.
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.memory` state used by `newCacheUser`. |
function newHunkBlock(state, requestedSize, name, kind, side, start, span)Create and initialize hunk block.
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.memory` state used by `newHunkBlock`. |
requestedSize | dynamic | — | Size of the requested data or resource. |
name | dynamic | — | Stable name that identifies the requested object or option. |
kind | dynamic | — | The kind input consumed by `newHunkBlock`. |
side | dynamic | — | The side input consumed by `newHunkBlock`. |
start | dynamic | — | The start input consumed by `newHunkBlock`. |
span | dynamic | — | The span input consumed by `newHunkBlock`. |
function removeCacheAt(state, index)Release state for remove cache at.
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.memory` state used by `removeCacheAt`. |
index | dynamic | — | Zero-based index of the requested entry. |
function truncateName(name, count)Return truncate name derived from the active module state.
| Parameter | Type | Default | Description |
|---|---|---|---|
name | dynamic | — | Stable name that identifies the requested object or option. |
count | dynamic | — | Number of entries or units to process. |
function unlinkLru(block)Implements the `unlinkLru` operation for `miniquake.memory` (unlink lru).
| Parameter | Type | Default | Description |
|---|---|---|---|
block | dynamic | — | The block input consumed by `unlinkLru`. |
function used(state)Implements the `used` operation for `miniquake.memory` (used).
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.memory` state used by `used`. |
function zoneCheck(state)Implements the `zoneCheck` operation for `miniquake.memory` (zone check).
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.memory` state used by `zoneCheck`. |
function zoneDumpHeap(state)Implements the `zoneDumpHeap` operation for `miniquake.memory` (zone dump heap).
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.memory` state used by `zoneDumpHeap`. |
function zoneFree(block)Implements the `zoneFree` operation for `miniquake.memory` (zone free).
| Parameter | Type | Default | Description |
|---|---|---|---|
block | dynamic | — | The block input consumed by `zoneFree`. |
function zoneFreeMemory(state)Implements the `zoneFreeMemory` operation for `miniquake.memory` (zone free memory).
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.memory` state used by `zoneFreeMemory`. |
function zoneMalloc(state, size, name)Implements the `zoneMalloc` operation for `miniquake.memory` (zone malloc).
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.memory` state used by `zoneMalloc`. |
size | dynamic | — | Size of the requested data or resource. |
name | dynamic | — | Stable name that identifies the requested object or option. |
function zonePayloadUsed(state)Implements the `zonePayloadUsed` operation for `miniquake.memory` (zone payload used).
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.memory` state used by `zonePayloadUsed`. |
function zonePrint(state)Implements the `zonePrint` operation for `miniquake.memory` (zone print).
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.memory` state used by `zonePrint`. |
function zoneState(state)Return zone state derived from the active module state.
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.memory` state used by `zoneState`. |
function zoneTagMalloc(state, size, tag, name)Implements the `zoneTagMalloc` operation for `miniquake.memory` (zone tag malloc).
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.memory` state used by `zoneTagMalloc`. |
size | dynamic | — | Size of the requested data or resource. |
tag | dynamic | — | The tag input consumed by `zoneTagMalloc`. |
name | dynamic | — | Stable name that identifies the requested object or option. |