Buffer.create

From GiderosMobile

Available since: Gideros 2025.1
Class: buffer_luau

Description

Creates a buffer of the requested size with all bytes initialized to 0. Size limit is 1 GiB, or 1,073,741,824 bytes. Keep in mind that larger buffers might fail to allocate if device is running low on memory.

(buffer) = buffer.create(size)

Parameters

size: (number) the size of the buffer

Return values

Returns (buffer) the created buffer

Example

-- creates a buffer of the requested size with all bytes initialized to 0
local b: buffer = buffer.create(16)
print(buffer.len(b))