Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


Allocate

Allocate space in a buffer.
Read time 1 minuteLast updated 13 days ago

Definition

  • Type: Method
  • Namespace: Unity.Collections
  • Assembly: UnityEngine.ManagedKernelModule

Allocate<T>()

Allocate space in a buffer.
public ref T Allocate<T>() where T : unmanaged

Returns

Type

Description

TA reference to the allocation.

Remarks

The space is allocated in the buffer which was specified with NativeStream.Writer.BeginForEachIndex.

Allocate(int)

Allocate space in a buffer.
public byte* Allocate(int size)

Parameters

size

The number of bytes to allocate.

Returns

Type

Description

byte*The allocation.

Remarks

The space is allocated in the buffer which was specified with NativeStream.Writer.BeginForEachIndex.