Authors: | Zahary Karadjov |
---|
This module provides utilities for reserving portions of the address space of a program without consuming physical memory. It can be used to implement a dynamically resizable buffer that is guaranteed to remain in the same memory location. The buffer will be able to grow up to the size of the initially reserved portion of the address space.
Unstable API.
Types
ReservedMem = object
- Source Edit
ReservedMemSeq[T] = object
- Source Edit
Consts
memExecRead = 32
- Source Edit
memExecReadWrite = 64
- Source Edit
memReadWrite = 4
- Source Edit
Procs
func `[]`[T](s: ReservedMemSeq[T]; rpos: BackwardsIndex): lent T
- Source Edit
func `[]`[T](s: var ReservedMemSeq[T]; pos: Natural): var T
- Source Edit
func `[]`[T](s: var ReservedMemSeq[T]; rpos: BackwardsIndex): var T
- Source Edit
proc add[T](s: var ReservedMemSeq[T]; val: T)
- Source Edit
func commitedLen(m: ReservedMem): int {....raises: [], tags: [], forbids: [].}
- Source Edit
func commitedLen[T](s: ReservedMemSeq[T]): int
- Source Edit
func len(m: ReservedMem): int {....raises: [], tags: [], forbids: [].}
- Source Edit
func len[T](s: ReservedMemSeq[T]): int
- Source Edit
func maxLen(m: ReservedMem): int {....raises: [], tags: [], forbids: [].}
- Source Edit
func maxLen[T](s: ReservedMemSeq[T]): int
- Source Edit
proc pop[T](s: var ReservedMemSeq[T]): T
- Source Edit
proc setLen(m: var ReservedMem; newLen: int) {....raises: [OSError], tags: [], forbids: [].}
- Source Edit
proc setLen[T](s: var ReservedMemSeq[T]; newLen: int)
- Source Edit