HolyLib Wiki

CreateStackReadBuffer

  bitbuf.CreateStackReadBuffer( string data, function callback )

Description

Creates a read buffer from the given data allocated on the stack making it faster.
Useful if you want to read the userdata of the instancebaseline stringtable.

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 on
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_read bf - the buffer