Loading...
Searching...
No Matches
virtualMemory.h
Go to the documentation of this file.
1//
2// Copyright 2019 Pixar
3//
4// Licensed under the terms set forth in the LICENSE.txt file available at
5// https://openusd.org/license.
6//
7#ifndef PXR_BASE_ARCH_VIRTUAL_MEMORY_H
8#define PXR_BASE_ARCH_VIRTUAL_MEMORY_H
9
29
30#include "pxr/pxr.h"
31#include "pxr/base/arch/api.h"
32
33#include <cstddef>
34
35PXR_NAMESPACE_OPEN_SCOPE
36
40ARCH_API void *
41ArchReserveVirtualMemory(size_t numBytes);
42
49ARCH_API bool
50ArchCommitVirtualMemoryRange(void *start, size_t numBytes);
51
62ARCH_API bool
63ArchFreeVirtualMemory(void *start, size_t numBytes);
64
73 ArchProtectNoAccess,
74 ArchProtectReadOnly,
75 ArchProtectReadWrite,
76 ArchProtectReadWriteCopy
77};
78
84ARCH_API bool
85ArchSetMemoryProtection(void const *start, size_t numBytes,
86 ArchMemoryProtection protection);
87
88PXR_NAMESPACE_CLOSE_SCOPE
89
90#endif // PXR_BASE_ARCH_VIRTUAL_MEMORY_H
ARCH_API bool ArchCommitVirtualMemoryRange(void *start, size_t numBytes)
Make the range of numBytes bytes starting at start available for reading and writing.
ArchMemoryProtection
Memory protection options, see ArchSetMemoryProtection().
ARCH_API bool ArchFreeVirtualMemory(void *start, size_t numBytes)
Return memory obtained with ArchReserveVirtualMemory() to the system.
ARCH_API void * ArchReserveVirtualMemory(size_t numBytes)
Reserve numBytes bytes of virtual memory.
ARCH_API bool ArchSetMemoryProtection(void const *start, size_t numBytes, ArchMemoryProtection protection)
Change the memory protection on the pages containing start through start + numBytes to protection.