Spec-Zone.ru › Nim

std/reservedmem

Source Edit

Этот модуль предоставляет утилиты для резервирования участков адресного пространства программы без потребления физической памяти. Он может быть использован для реализации динамически изменяемого буфера, гарантированно сохраняющегося в том же месте памяти. Буфер сможет расти до размера первоначально зарезервированной части адресного пространства.

Нестабильный API.

Импорты

oserrors, winlean, win_getsysteminfo

Типы

MemAccessFlags = int
Source Edit
ReservedMem = object
Source Edit
ReservedMemSeq[T] = object
Source Edit

Константы

memExec = 16
Source Edit
memExecRead = 32
Source Edit
memExecReadWrite = 64
Source Edit
memRead = 2
Source Edit
memReadWrite = 4
Source Edit

Процедуры

func `[]`[T](s: ReservedMemSeq[T]; pos: Natural): lent T
Source Edit
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
proc init(SeqType: type ReservedMemSeq; maxLen: Natural; initLen: Natural = 0;
          initCommitLen: Natural = 0; memStart = pointer(nil);
          accessFlags = memReadWrite; maxCommittedAndUnusedPages = 3): SeqType:type
Source Edit
proc init(T: type ReservedMem; maxLen: Natural; initLen: Natural = 0;
          initCommitLen = initLen; memStart = pointer(nil);
          accessFlags = memReadWrite; maxCommittedAndUnusedPages = 3): ReservedMem
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

Шаблоны

template distance(lhs, rhs: pointer): int
Source Edit
template shift(p: pointer; distance: int): pointer
Source Edit

© 2006–2024 Andreas Rumpf
Licensed under the MIT License.
https://nim-lang.org/docs/reservedmem.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API