Struct VirtualMemoryUtility | Collections | 0.15.0-preview.21
docs.unity3d.com
    Show / Hide Table of Contents

    Struct VirtualMemoryUtility

    Namespace: Unity.Collections.LowLevel.Unsafe
    Syntax
    public struct VirtualMemoryUtility

    Properties

    DefaultPageSizeInBytes

    Gets the default virtual memory page size in bytes for this platform.

    Declaration
    public static uint DefaultPageSizeInBytes { get; }
    Property Value
    Type Description
    UInt32

    Methods

    BytesToPageCount(UInt32, UInt32)

    Computes the number of pages required to cover a contiguous area of memory.

    Declaration
    public static uint BytesToPageCount(uint bytes, uint pageSizeInBytes)
    Parameters
    Type Name Description
    UInt32 bytes

    Bytes of the contiguous area of memory.

    UInt32 pageSizeInBytes

    Size of the virtual memory page in bytes.

    Returns
    Type Description
    UInt32

    The page count required to cover the contiguous area of memory.

    CommitMemory(VMRange, out BaselibErrorState)

    Commits memory from reserved address space.

    Declaration
    public static void CommitMemory(VMRange rangeToCommit, out BaselibErrorState outErrorState)
    Parameters
    Type Name Description
    VMRange rangeToCommit

    Reserved virtual address range from which to allocate memory.

    BaselibErrorState outErrorState

    DecommitMemory(VMRange, out BaselibErrorState)

    Decommits committed memory from reserved address space.

    Declaration
    public static void DecommitMemory(VMRange rangeToFree, out BaselibErrorState outErrorState)
    Parameters
    Type Name Description
    VMRange rangeToFree

    Virtual address range from which to free allocated memory.

    BaselibErrorState outErrorState

    FreeAddressSpace(VMRange, out BaselibErrorState)

    Frees reserved address space.

    Declaration
    public static void FreeAddressSpace(VMRange reservedAddressRange, out BaselibErrorState outErrorState)
    Parameters
    Type Name Description
    VMRange reservedAddressRange

    Virtual address range to release.

    BaselibErrorState outErrorState

    ReportWrappedBaselibError(BaselibErrorState)

    Logs baselib errors to the console.

    Declaration
    public static void ReportWrappedBaselibError(BaselibErrorState wrappedErrorState)
    Parameters
    Type Name Description
    BaselibErrorState wrappedErrorState

    Wrapped copy of Baselib_ErrorState.

    ReserveAddressSpace(UInt64, UInt64, out BaselibErrorState)

    Reserves a contiguous range of address space.

    Declaration
    public static VMRange ReserveAddressSpace(ulong sizeOfAddressRangeInPages, ulong pageSizeInBytes, out BaselibErrorState outErrorState)
    Parameters
    Type Name Description
    UInt64 sizeOfAddressRangeInPages
    UInt64 pageSizeInBytes

    Size of a page of virtual memory, in bytes.

    BaselibErrorState outErrorState
    Returns
    Type Description
    VMRange

    A VMRange. Upon failure, the returned VMRange will have a null pointer, 0 sized pages, and 0 page count.

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023