mirror of
https://github.com/lua/lua
synced 2024-12-24 03:16:50 +03:00
details in 'luaM_reallocvchar'
This commit is contained in:
parent
6321041058
commit
eb45f3a9b6
5
lmem.h
5
lmem.h
@ -1,5 +1,5 @@
|
||||
/*
|
||||
** $Id: lmem.h,v 1.41 2014/10/08 20:25:51 roberto Exp roberto $
|
||||
** $Id: lmem.h,v 1.42 2014/12/19 13:45:40 roberto Exp roberto $
|
||||
** Interface to Memory Manager
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
@ -35,7 +35,8 @@
|
||||
/*
|
||||
** Arrays of chars do not need any test
|
||||
*/
|
||||
#define luaM_reallocvchar(L,b,on,n) luaM_realloc_(L, (b), (on), (n))
|
||||
#define luaM_reallocvchar(L,b,on,n) \
|
||||
cast(char *, luaM_realloc_(L, (b), (on)*sizeof(char), (n)*sizeof(char)))
|
||||
|
||||
#define luaM_freemem(L, b, s) luaM_realloc_(L, (b), (s), 0)
|
||||
#define luaM_free(L, b) luaM_realloc_(L, (b), sizeof(*(b)), 0)
|
||||
|
6
lzio.h
6
lzio.h
@ -1,5 +1,5 @@
|
||||
/*
|
||||
** $Id: lzio.h,v 1.28 2014/01/31 15:14:22 roberto Exp roberto $
|
||||
** $Id: lzio.h,v 1.29 2014/12/19 13:45:40 roberto Exp roberto $
|
||||
** Buffered streams
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
@ -37,8 +37,8 @@ typedef struct Mbuffer {
|
||||
|
||||
|
||||
#define luaZ_resizebuffer(L, buff, size) \
|
||||
((buff)->buffer = cast(char *, luaM_reallocvchar(L, (buff)->buffer, \
|
||||
(buff)->buffsize, size)), \
|
||||
((buff)->buffer = luaM_reallocvchar(L, (buff)->buffer, \
|
||||
(buff)->buffsize, size), \
|
||||
(buff)->buffsize = size)
|
||||
|
||||
#define luaZ_freebuffer(L, buff) luaZ_resizebuffer(L, buff, 0)
|
||||
|
Loading…
Reference in New Issue
Block a user