~ubuntu-branches/ubuntu/precise/lua5.2/precise-security

« back to all changes in this revision

Viewing changes to src/lmem.h

  • Committer: Package Import Robot
  • Author(s): Enrico Tassi
  • Date: 2011-12-07 18:40:43 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20111207184043-0r0wvv6p48zah403
Tags: 5.2.0~rc5-1
* Do not link against ncurses (patch by Sven Joachim) (Closes: #646165) 
* Include manpages (Closes: #636149) 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
** $Id: lmem.h,v 1.36 2010/04/08 17:16:46 roberto Exp $
 
2
** $Id: lmem.h,v 1.38 2011/12/02 13:26:54 roberto Exp $
3
3
** Interface to Memory Manager
4
4
** See Copyright Notice in lua.h
5
5
*/
15
15
 
16
16
 
17
17
#define luaM_reallocv(L,b,on,n,e) \
18
 
        ((cast(size_t, (n)+1) <= MAX_SIZET/(e)) ?  /* +1 to avoid warnings */ \
19
 
                luaM_realloc_(L, (b), (on)*(e), (n)*(e)) : \
20
 
                luaM_toobig(L))
 
18
        ((cast(size_t, (n)+1) > MAX_SIZET/(e)) ?  /* +1 to avoid warnings */ \
 
19
                (luaM_toobig(L), (void *)0) : \
 
20
                luaM_realloc_(L, (b), (on)*(e), (n)*(e)))
21
21
 
22
22
#define luaM_freemem(L, b, s)   luaM_realloc_(L, (b), (s), 0)
23
23
#define luaM_free(L, b)         luaM_realloc_(L, (b), sizeof(*(b)), 0)
37
37
#define luaM_reallocvector(L, v,oldn,n,t) \
38
38
   ((v)=cast(t *, luaM_reallocv(L, v, oldn, n, sizeof(t))))
39
39
 
40
 
LUAI_FUNC void *luaM_toobig (lua_State *L);
 
40
LUAI_FUNC l_noret luaM_toobig (lua_State *L);
41
41
 
42
42
/* not to be called directly */
43
43
LUAI_FUNC void *luaM_realloc_ (lua_State *L, void *block, size_t oldsize,