# lua/lstring.c File Reference

`#include <string.h>`
`#include "lua.h"`
`#include "lmem.h"`
`#include "lobject.h"`
`#include "lstate.h"`
`#include "lstring.h"`

Include dependency graph for lstring.c:

Go to the source code of this file.

## Defines

#define | lstring_c
#define | LUA_CORE

## Functions

void | luaS_resize (lua_State *L, int newsize)
static TString * | newlstr (lua_State *L, const char *str, size_t l, unsigned int h)
TString * | luaS_newlstr (lua_State *L, const char *str, size_t l)
Udata * | luaS_newudata (lua_State *L, size_t s, Table *e)

## Define Documentation

#define lstring_c

Definition at line 10 of file lstring.c.

#define LUA_CORE

Definition at line 11 of file lstring.c.

## Function Documentation

TString* luaS_newlstr | ( | lua_State * | L,
|  | const char * | str,
|  | size_t | l |
| ) |  |  |

Definition at line 75 of file lstring.c.

References cast, changewhite, G, GCObject::gch, getstr, isdead, TString::len, lmod, newlstr(), GCheader::next, rawgco2ts, and TString::tsv.

Referenced by LoadString(), lua_concat(), lua_pushlstring(), luaO_pushvfstring(), luaV_concat(), and luaX_newstring().

Udata* luaS_newudata | ( | lua_State * | L,
|  | size_t | s,
|  | Table * | e |
| ) |  |  |

Definition at line 96 of file lstring.c.

References cast, Udata::env, G, Udata::len, luaC_white, luaM_malloc, luaM_toobig(), Udata::marked, MAX_SIZET, Udata::metatable, Udata::next, obj2gco, Udata::tt, and Udata::uv.

Referenced by lua_newuserdata().

void luaS_resize | ( | lua_State * | L,
|  | int | newsize |
| ) |  |  |

Definition at line 22 of file lstring.c.

References cast_int, G, GCObject::gch, gco2ts, GCSsweepstring, stringtable::hash, lmod, lua_assert, luaM_freearray, luaM_newvector, GCheader::next, next, and stringtable::size.

Referenced by checkSizes(), f_luaopen(), and newlstr().

static TString* newlstr | ( | lua_State * | L,
|  | const char * | str,
|  | size_t | l,
|  | unsigned int | h |
| ) |  |  | `[static]`

Definition at line 50 of file lstring.c.

References cast, G, stringtable::hash, TString::hash, TString::len, lmod, luaC_white, luaM_malloc, luaM_toobig(), luaS_resize(), TString::marked, MAX_INT, MAX_SIZET, TString::next, stringtable::nuse, obj2gco, TString::reserved, stringtable::size, TString::tsv, and TString::tt.

Referenced by luaS_newlstr().