template <size_t MinPageSize = 1, zx_vm_option_t ExtraMapFlags = 0>

class ZirconVmar

Defined at line 33 of file ../../src/lib/trivial-allocator/include/lib/trivial-allocator/zircon.h

trivial_allocator::ZirconVmar holds a zx::unowned_vmar and uses it to meet

the Memory API for trivial_allocator::PageAllocator.

The optional first template parameter can give a lower bound on the

page_size() used, which is the granularity of allocation. It's the greater

of this parameter and the system's runtime page size. Setting a floor

reduces the number of VMOs and VMARs created and the number of system calls

made, while perhaps using more address space than is actually needed.

The optional second template parameter can give additional flags for the

zx::vmar::map operations, usually ZX_VM_MAP_RANGE.

Public Methods

void ZirconVmar<MinPageSize, ExtraMapFlags> ()

Defined at line 40 of file ../../src/lib/trivial-allocator/include/lib/trivial-allocator/zircon.h

void ZirconVmar<MinPageSize, ExtraMapFlags> (const ZirconVmar<MinPageSize, ExtraMapFlags> & )

Defined at line 41 of file ../../src/lib/trivial-allocator/include/lib/trivial-allocator/zircon.h

void ZirconVmar<MinPageSize, ExtraMapFlags> (const zx::vmar & vmar)

Defined at line 43 of file ../../src/lib/trivial-allocator/include/lib/trivial-allocator/zircon.h

ZirconVmar<MinPageSize, ExtraMapFlags> & operator= (const ZirconVmar<MinPageSize, ExtraMapFlags> & )

Defined at line 45 of file ../../src/lib/trivial-allocator/include/lib/trivial-allocator/zircon.h

const zx::vmar & vmar ()

Defined at line 47 of file ../../src/lib/trivial-allocator/include/lib/trivial-allocator/zircon.h

size_t page_size ()

Defined at line 49 of file ../../src/lib/trivial-allocator/include/lib/trivial-allocator/zircon.h

std::pair<void *, zx::vmar> Allocate (size_t size)

Defined at line 53 of file ../../src/lib/trivial-allocator/include/lib/trivial-allocator/zircon.h

void Deallocate (zx::vmar sub_vmar, void * ptr, size_t size)

Defined at line 81 of file ../../src/lib/trivial-allocator/include/lib/trivial-allocator/zircon.h

void Release (zx::vmar sub_vmar, void * ptr, size_t size)

Defined at line 88 of file ../../src/lib/trivial-allocator/include/lib/trivial-allocator/zircon.h

void Seal (zx::vmar sub_vmar, void * ptr, size_t size)

The VMAR handle is consumed here, so there will no longer be any way to

"unseal" this allocation (that is, change page protections on the memory).

Defined at line 92 of file ../../src/lib/trivial-allocator/include/lib/trivial-allocator/zircon.h