HolyLib Wiki

CreateStackWriteBuffer

  bitbuf.CreateStackWriteBuffer( string data, function callback )

Description

Create a write buffer with the given size or with the given data allocated on the stack making it faster.

The buffer will be stack allocated, do NOT call this function recursively and the buffer is only valid inside the callback function.
This is because you could cause a crash if you were to create too many stack allocated buffers!

The size is clamped internally between a minimum of 4 bytes and a maximum of 65536 bytes on Linux and to 8192 on Windows.

Recently Added

This was recently added in version (0.8 - DEV).

Arguments

1string data
string to created the buffer from or a number as size
2function callback

the callback inside which you can use the buffer, the buffer will become invalid once the call is over!

Function argument(s):
1bf_write bf - the buffer