Skip to content

Try Realloc

Makes sure a valid DynamicWriter has the amount of space specified, resizing the buffer if necessary.

The buffer may change

After calling light.internal.try_realloc(), the buffer the writer contains may change because it had to be resized. Do not hold onto buffers when using this API. Each time you call it, the only safe way to get the buffer is with light.io.get_writer_buff().

function light.internal.try_realloc()

Client Server Shared Experimental Synchronous
1
2
3
4
function try_realloc(
    writer: DynamicWriter,
    target_ptr: number
): ()