This function resizes the allocated memory block. The contents of the buffer will be retained in the new memory block.
Parameter | Description |
---|---|
size | new size of the memory block |
padding | if set to true the new block may be automatically padded internally for faster resizing |
Returns true if the memory block is successfully resized, otherwise false is returned.
-- Create a buffer
local buffer = CreateBuffer(10)
-- Resize the buffer
buffer:Resize(20)
-- Get the buffer size
Print(buffer:GetSize())