003 File Manager
Current Path:
/usr/src/sys/contrib/openzfs/module/lua
usr
/
src
/
sys
/
contrib
/
openzfs
/
module
/
lua
/
📁
..
📄
Makefile.in
(852 B)
📄
README.zfs
(3.38 KB)
📄
lapi.c
(30.73 KB)
📄
lapi.h
(583 B)
📄
lauxlib.c
(22.21 KB)
📄
lbaselib.c
(7.23 KB)
📄
lcode.c
(22.03 KB)
📄
lcode.h
(3.08 KB)
📄
lcompat.c
(1.43 KB)
📄
lcorolib.c
(3.59 KB)
📄
lctype.c
(2.26 KB)
📄
lctype.h
(1.83 KB)
📄
ldebug.c
(16.15 KB)
📄
ldebug.h
(1.1 KB)
📄
ldo.c
(22.2 KB)
📄
ldo.h
(1.53 KB)
📄
lfunc.c
(4.19 KB)
📄
lfunc.h
(1.06 KB)
📄
lgc.c
(36.9 KB)
📄
lgc.h
(5.31 KB)
📄
llex.c
(15.02 KB)
📄
llex.h
(2.18 KB)
📄
llimits.h
(7.73 KB)
📄
lmem.c
(2.61 KB)
📄
lmem.h
(1.79 KB)
📄
lobject.c
(7.68 KB)
📄
lobject.h
(14.62 KB)
📄
lopcodes.c
(3.04 KB)
📄
lopcodes.h
(8.32 KB)
📄
lparser.c
(45.19 KB)
📄
lparser.h
(3.29 KB)
📄
lstate.c
(7.54 KB)
📄
lstate.h
(7.46 KB)
📄
lstring.c
(4.85 KB)
📄
lstring.h
(1.28 KB)
📄
lstrlib.c
(28.3 KB)
📄
ltable.c
(16.18 KB)
📄
ltable.h
(1.42 KB)
📄
ltablib.c
(7.62 KB)
📄
ltm.c
(1.78 KB)
📄
ltm.h
(1.14 KB)
📄
lvm.c
(30.16 KB)
📄
lvm.h
(1.49 KB)
📄
lzio.c
(1.61 KB)
📄
lzio.h
(1.5 KB)
📁
setjmp
Editing: lmem.c
/* BEGIN CSTYLED */ /* ** $Id: lmem.c,v 1.84.1.1 2013/04/12 18:48:47 roberto Exp $ ** Interface to Memory Manager ** See Copyright Notice in lua.h */ #define lmem_c #define LUA_CORE #include <sys/lua/lua.h> #include "ldebug.h" #include "ldo.h" #include "lgc.h" #include "lmem.h" #include "lobject.h" #include "lstate.h" /* ** About the realloc function: ** void * frealloc (void *ud, void *ptr, size_t osize, size_t nsize); ** (`osize' is the old size, `nsize' is the new size) ** ** * frealloc(ud, NULL, x, s) creates a new block of size `s' (no ** matter 'x'). ** ** * frealloc(ud, p, x, 0) frees the block `p' ** (in this specific case, frealloc must return NULL); ** particularly, frealloc(ud, NULL, 0, 0) does nothing ** (which is equivalent to free(NULL) in ANSI C) ** ** frealloc returns NULL if it cannot create or reallocate the area ** (any reallocation to an equal or smaller size cannot fail!) */ #define MINSIZEARRAY 4 void *luaM_growaux_ (lua_State *L, void *block, int *size, size_t size_elems, int limit, const char *what) { void *newblock; int newsize; if (*size >= limit/2) { /* cannot double it? */ if (*size >= limit) /* cannot grow even a little? */ luaG_runerror(L, "too many %s (limit is %d)", what, limit); newsize = limit; /* still have at least one free place */ } else { newsize = (*size)*2; if (newsize < MINSIZEARRAY) newsize = MINSIZEARRAY; /* minimum size */ } newblock = luaM_reallocv(L, block, *size, newsize, size_elems); *size = newsize; /* update only when everything else is OK */ return newblock; } l_noret luaM_toobig (lua_State *L) { luaG_runerror(L, "memory allocation error: block too big"); } /* ** generic allocation routine. */ void *luaM_realloc_ (lua_State *L, void *block, size_t osize, size_t nsize) { void *newblock; global_State *g = G(L); size_t realosize = (block) ? osize : 0; lua_assert((realosize == 0) == (block == NULL)); #if defined(HARDMEMTESTS) if (nsize > realosize && g->gcrunning) luaC_fullgc(L, 1); /* force a GC whenever possible */ #endif newblock = (*g->frealloc)(g->ud, block, osize, nsize); if (newblock == NULL && nsize > 0) { api_check(L, nsize > realosize, "realloc cannot fail when shrinking a block"); if (g->gcrunning) { luaC_fullgc(L, 1); /* try to free some memory... */ newblock = (*g->frealloc)(g->ud, block, osize, nsize); /* try again */ } if (newblock == NULL) luaD_throw(L, LUA_ERRMEM); } lua_assert((nsize == 0) == (newblock == NULL)); g->GCdebt = (g->GCdebt + nsize) - realosize; return newblock; } /* END CSTYLED */
Upload File
Create Folder