class GuardedPageBlock

Defined at line 112 of file ../../sdk/lib/c/zircon/vmar.h

This describes a page-aligned block mapped inside a VMAR with guard regions.

This is used for thread stacks, and for the thread area.

Public Methods

void GuardedPageBlock ()

Defined at line 114 of file ../../sdk/lib/c/zircon/vmar.h

void GuardedPageBlock (const GuardedPageBlock & )

Defined at line 115 of file ../../sdk/lib/c/zircon/vmar.h

void GuardedPageBlock (iovec iov, zx::unowned_vmar vmar)

This transfers ownership that's been stored using in legacy C code by

using TakeIovec() to move an earlier GuardedPageBlock object.

Defined at line 119 of file ../../sdk/lib/c/zircon/vmar.h

void GuardedPageBlock (GuardedPageBlock && other)

Defined at line 125 of file ../../sdk/lib/c/zircon/vmar.h

GuardedPageBlock & operator= (GuardedPageBlock && other)

Defined at line 130 of file ../../sdk/lib/c/zircon/vmar.h

void reset ()

Defined at line 146 of file ../../sdk/lib/c/zircon/vmar.h

uintptr_t release ()

Defined at line 152 of file ../../sdk/lib/c/zircon/vmar.h

void ~GuardedPageBlock ()

Defined at line 158 of file ../../sdk/lib/c/zircon/vmar.h

size_t size_bytes ()

Defined at line 160 of file ../../sdk/lib/c/zircon/vmar.h

const zx::vmar & vmar ()

Defined at line 162 of file ../../sdk/lib/c/zircon/vmar.h

iovec TakeIovec ()

This transfers ownership to the returned iovec. This is only used for the

legacy glue with C code that uses iovec to store regions to be unmapped.

The object is left fully moved-from; callers must use vmar() first.

Defined at line 167 of file ../../sdk/lib/c/zircon/vmar.h

template <typename T = std::byte>
zx::result<std::span<T>> Allocate (zx::unowned_vmar allocate_from, AllocationVmo & vmo, PageRoundedSize data_size, PageRoundedSize guard_below, PageRoundedSize guard_above)

Allocate a guarded block by consuming the next pages of the VMO.

The returned span does not include the guard regions.

The generic template is implemented inline below.

Defined at line 190 of file ../../sdk/lib/c/zircon/vmar.h

template <>
zx::result<std::span<std::byte>> Allocate<std::byte> (zx::unowned_vmar allocate_from, AllocationVmo & vmo, PageRoundedSize data_size, PageRoundedSize guard_below, PageRoundedSize guard_above)

The underlying implementation is out-of-line in this specialization.

Defined at line 26 of file ../../sdk/lib/c/zircon/vmar.cc