aboutsummaryrefslogtreecommitdiff
path: root/assets/blender/ks
diff options
context:
space:
mode:
authorMaverick2797 <git.maverick2797@gmail.com>2024-08-17 11:43:35 +0800
committerorwell <orwell@bleipb.de>2024-09-02 22:22:38 +0200
commit55108ae38e467e190abd6f9bf087a9a73f953a08 (patch)
tree691ccfb1d31621033067f3f9dd4f86c16f1a6dbc /assets/blender/ks
parent3b83580faccfbe5b23cea04bd3e6e0810572c7c0 (diff)
downloadadvtrains-55108ae38e467e190abd6f9bf087a9a73f953a08.tar.gz
advtrains-55108ae38e467e190abd6f9bf087a9a73f953a08.tar.bz2
advtrains-55108ae38e467e190abd6f9bf087a9a73f953a08.zip
LuaATC set_fc(): add argument to reset fc index to 1
Diffstat (limited to 'assets/blender/ks')
0 files changed, 0 insertions, 0 deletions
reates a new block of size `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 *errormsg) { void *newblock; int newsize; if (*size >= limit/2) { /* cannot double it? */ if (*size >= limit) /* cannot grow even a little? */ luaG_runerror(L, errormsg); 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; } void *luaM_toobig (lua_State *L) { luaG_runerror(L, "memory allocation error: block too big"); return NULL; /* to avoid warnings */ } /* ** generic allocation routine. */