All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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
13
14#include "pxr/pxr.h"
15#include "pxr/base/arch/api.h"
16
17#include <cstddef>
18
19PXR_NAMESPACE_OPEN_SCOPE
20
24ARCH_API void *
25ArchReserveVirtualMemory(size_t numBytes);
26
32ARCH_API bool
33ArchCommitVirtualMemoryRange(void *start, size_t numBytes);
34
40ARCH_API bool
41ArchFreeVirtualMemory(void *start, size_t numBytes);
42
45 ArchProtectNoAccess,
46 ArchProtectReadOnly,
47 ArchProtectReadWrite,
48 ArchProtectReadWriteCopy
49};
50
58ARCH_API bool
59ArchSetMemoryProtection(void const *start, size_t numBytes,
60 ArchMemoryProtection protection);
61
62PXR_NAMESPACE_CLOSE_SCOPE
63
64#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().
Definition: virtualMemory.h:44
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 and start + numBytes to protection.