Download unify/third_party/lua/src/lmem.h from Snapkitty/repoverse: direct link, hf CLI and curl.
- Browser
- Download file 3.37 kB
-
https://huggingface.co/Snapkitty/repoverse/resolve/main/unify/third_party/lua/src/lmem.h
- Command line
-
hf download hf://Snapkitty/repoverse/unify/third_party/lua/src/lmem.h
-
curl -L -o lmem.h https://huggingface.co/Snapkitty/repoverse/resolve/main/unify/third_party/lua/src/lmem.h
3.37 kB
| /* | |
| ** $Id: lmem.h $ | |
| ** Interface to Memory Manager | |
| ** See Copyright Notice in lua.h | |
| */ | |
| /* | |
| ** This macro tests whether it is safe to multiply 'n' by the size of | |
| ** type 't' without overflows. Because 'e' is always constant, it avoids | |
| ** the runtime division MAX_SIZET/(e). | |
| ** (The macro is somewhat complex to avoid warnings: The 'sizeof' | |
| ** comparison avoids a runtime comparison when overflow cannot occur. | |
| ** The compiler should be able to optimize the real test by itself, but | |
| ** when it does it, it may give a warning about "comparison is always | |
| ** false due to limited range of data type"; the +1 tricks the compiler, | |
| ** avoiding this warning but also this optimization.) | |
| */ | |
| /* | |
| ** Computes the minimum between 'n' and 'MAX_SIZET/sizeof(t)', so that | |
| ** the result is not larger than 'n' and cannot overflow a 'size_t' | |
| ** when multiplied by the size of type 't'. (Assumes that 'n' is an | |
| ** 'int' or 'unsigned int' and that 'int' is not larger than 'size_t'.) | |
| */ | |
| /* | |
| ** Arrays of chars do not need any test | |
| */ | |
| LUAI_FUNC l_noret luaM_toobig (lua_State *L); | |
| /* not to be called directly */ | |
| LUAI_FUNC void *luaM_realloc_ (lua_State *L, void *block, size_t oldsize, | |
| size_t size); | |
| LUAI_FUNC void *luaM_saferealloc_ (lua_State *L, void *block, size_t oldsize, | |
| size_t size); | |
| LUAI_FUNC void luaM_free_ (lua_State *L, void *block, size_t osize); | |
| LUAI_FUNC void *luaM_growaux_ (lua_State *L, void *block, int nelems, | |
| int *size, int size_elem, int limit, | |
| const char *what); | |
| LUAI_FUNC void *luaM_shrinkvector_ (lua_State *L, void *block, int *nelem, | |
| int final_n, int size_elem); | |
| LUAI_FUNC void *luaM_malloc_ (lua_State *L, size_t size, int tag); | |