Starboard Module Reference: memory.h
Stay organized with collections
Save and categorize content based on your preferences.
Defines functions for memory allocation, alignment, copying, and comparing.
Porters
All of the "Unchecked" and "Free" functions must be implemented, but they should
not be called directly. The Starboard platform wraps them with extra accounting
under certain circumstances.
Porters and Application Developers
Nobody should call the "Checked", "Unchecked" or "Free" functions directly
because that evades Starboard's memory tracking. In both port implementations
and Starboard client application code, you should always call SbMemoryAllocate
and SbMemoryDeallocate rather than SbMemoryAllocateUnchecked and SbMemoryFree.
The "checked" functions are SbMemoryAllocateChecked(),
SbMemoryReallocateChecked(), and SbMemoryAllocateAlignedChecked().
The "unchecked" functions are SbMemoryAllocateUnchecked(),
SbMemoryReallocateUnchecked(), and SbMemoryAllocateAlignedUnchecked().
The "free" functions are SbMemoryFree() and SbMemoryFreeAligned().
Enums
SbMemoryMapFlags
The bitwise OR of these flags should be passed to SbMemoryMap to indicate how
the mapped memory can be used.
Values
kSbMemoryMapProtectReserved
No flags set: Reserves virtual address space. SbMemoryProtect() can later
make it accessible.
kSbMemoryMapProtectRead
kSbMemoryMapProtectWrite
kSbMemoryMapProtectExec
kSbMemoryMapProtectReadWrite
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-06-29 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-06-29 UTC."],[[["Provides functions for managing memory, including allocation, reallocation, and deallocation, with both checked and unchecked variants."],["Offers memory mapping functionalities with configurable protection flags like read, write, and execute."],["Encourages utilizing `SbMemoryAllocate` and `SbMemoryDeallocate` for memory management to enable Starboard's memory tracking capabilities."],["\"Unchecked\" and \"Free\" functions should be implemented by porters but not called directly, as they are wrapped by Starboard for accounting purposes."]]],[]]