MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / getbuff

Function getbuff

3rd/lua-5.4.3/src/lobject.c:428–433  ·  view source on GitHub ↗

** Get a space of size 'sz' in the buffer. If buffer has not enough ** space, empty it. 'sz' must fit in an empty buffer. */

Source from the content-addressed store, hash-verified

426** space, empty it. 'sz' must fit in an empty buffer.
427*/
428static char *getbuff (BuffFS *buff, int sz) {
429 lua_assert(buff->blen <= BUFVFS); lua_assert(sz <= BUFVFS);
430 if (sz > BUFVFS - buff->blen) /* not enough space? */
431 clearbuff(buff);
432 return buff->space + buff->blen;
433}
434
435
436#define addsize(b,sz) ((b)->blen += (sz))

Callers 3

addstr2buffFunction · 0.85
addnum2buffFunction · 0.85
luaO_pushvfstringFunction · 0.85

Calls 1

clearbuffFunction · 0.85

Tested by

no test coverage detected