better GC debugging, added base object for tables

This commit is contained in:
2020-11-02 22:32:39 -06:00
parent a15c8d67a1
commit fe93a0b715
7 changed files with 70 additions and 13 deletions

View File

@@ -28,11 +28,22 @@
#define cosmoM_isFrozen(state) \
state->freezeGC > 0
// if debugging, print the locations of when the state is frozen/unfrozen
#ifdef GC_DEBUG
#define cosmoM_freezeGC(state) \
state->freezeGC++; \
printf("freezing state at %s:%d [%d]\n", __FILE__, __LINE__, state->freezeGC)
#define cosmoM_unfreezeGC(state) \
state->freezeGC--; \
printf("unfreezing state at %s:%d [%d]\n", __FILE__, __LINE__, state->freezeGC)
#else
#define cosmoM_freezeGC(state) \
state->freezeGC++
#define cosmoM_unfreezeGC(state) \
state->freezeGC--
#endif
COSMO_API void *cosmoM_reallocate(CState* state, void *buf, size_t oldSize, size_t newSize);
COSMO_API void cosmoM_collectGarbage(CState* state);