docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method EnsureCapacity

    EnsureCapacity(int)

    Ensures that the buffer has at least the specified capacity.

    Declaration
    public void EnsureCapacity(int length)
    Parameters
    Type Name Description
    int length

    The buffer capacity is ensured to be at least this big.

    Remarks

    If length is greater than the current Capacity of this buffer and greater than the capacity reserved with InternalBufferCapacityAttribute, this function allocates a new memory block and copies the current buffer to it. The number of elements in the buffer remains unchanged.

    Examples
    buffer.EnsureCapacity(buffer.Capacity + 10);
    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)