legc.h 474 B

1234567891011121314151617
  1. // Lua EGC (Emergeny Garbage Collector) interface
  2. #ifndef __LEGC_H__
  3. #define __LEGC_H__
  4. #include "lstate.h"
  5. // EGC operations modes
  6. #define EGC_NOT_ACTIVE 0 // EGC disabled
  7. #define EGC_ON_ALLOC_FAILURE 1 // run EGC on allocation failure
  8. #define EGC_ON_MEM_LIMIT 2 // run EGC when an upper memory limit is hit
  9. #define EGC_ALWAYS 4 // always run EGC before an allocation
  10. void legc_set_mode(lua_State *L, int mode, unsigned limit);
  11. #endif