detail
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: llimits.h,v 1.33 2001/10/02 16:45:03 roberto Exp $
|
** $Id: llimits.h,v 1.1 2001/11/29 22:14:34 rieru Exp rieru $
|
||||||
** Limits, basic types, and some other `installation-dependent' definitions
|
** Limits, basic types, and some other `installation-dependent' definitions
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@@ -45,7 +45,8 @@ typedef unsigned int lu_hash;
|
|||||||
/* its signed equivalent */
|
/* its signed equivalent */
|
||||||
typedef int ls_hash;
|
typedef int ls_hash;
|
||||||
|
|
||||||
/* an unsigned integer big enough to count the total memory used by Lua */
|
/* an unsigned integer big enough to count the total memory used by Lua; */
|
||||||
|
/* it should be at least as large as size_t */
|
||||||
typedef unsigned long lu_mem;
|
typedef unsigned long lu_mem;
|
||||||
|
|
||||||
/* an integer big enough to count the number of strings in use */
|
/* an integer big enough to count the number of strings in use */
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ static TString *newlstr (lua_State *L, const char *str, size_t l, lu_hash h) {
|
|||||||
|
|
||||||
TString *luaS_newlstr (lua_State *L, const char *str, size_t l) {
|
TString *luaS_newlstr (lua_State *L, const char *str, size_t l) {
|
||||||
TString *ts;
|
TString *ts;
|
||||||
lu_hash h = l; /* seed */
|
lu_hash h = (lu_hash)l; /* seed */
|
||||||
size_t step = (l>>5)+1; /* if string is too long, don't hash all its chars */
|
size_t step = (l>>5)+1; /* if string is too long, don't hash all its chars */
|
||||||
size_t l1;
|
size_t l1;
|
||||||
for (l1=l; l1>=step; l1-=step) /* compute hash */
|
for (l1=l; l1>=step; l1-=step) /* compute hash */
|
||||||
|
|||||||
Reference in New Issue
Block a user