luamem.h 520 B

12345678910111213141516171819202122232425
  1. /*
  2. ** mem.c
  3. ** memory manager for lua
  4. ** $Id: mem.h,v 1.1 1994/11/16 17:38:08 roberto Stab roberto $
  5. */
  6. #ifndef mem_h
  7. #define mem_h
  8. #ifndef NULL
  9. #define NULL 0
  10. #endif
  11. void luaI_free (void *block);
  12. void *luaI_malloc (unsigned long size);
  13. void *luaI_realloc (void *oldblock, unsigned long size);
  14. char *luaI_strdup (char *str);
  15. #define new(s) ((s *)luaI_malloc(sizeof(s)))
  16. #define newvector(n,s) ((s *)luaI_malloc((n)*sizeof(s)))
  17. #define growvector(old,n,s) ((s *)luaI_realloc(old,(n)*sizeof(s)))
  18. #endif