diff options
-rw-r--r-- | jim.c | 12 | ||||
-rw-r--r-- | jim.h | 2 |
2 files changed, 7 insertions, 7 deletions
@@ -5444,20 +5444,20 @@ int Jim_Collect(Jim_Interp *interp) } Jim_FreeHashTable(&marks); interp->lastCollectId = interp->referenceNextId; - interp->lastCollectTime = time(NULL); + interp->lastCollectTime = JimClock(); return collected; } -#define JIM_COLLECT_ID_PERIOD 5000 -#define JIM_COLLECT_TIME_PERIOD 300 +#define JIM_COLLECT_ID_PERIOD 5000000 +#define JIM_COLLECT_TIME_PERIOD 300000 void Jim_CollectIfNeeded(Jim_Interp *interp) { unsigned long elapsedId; - int elapsedTime; + jim_wide elapsedTime; elapsedId = interp->referenceNextId - interp->lastCollectId; - elapsedTime = time(NULL) - interp->lastCollectTime; + elapsedTime = JimClock() - interp->lastCollectTime; if (elapsedId > JIM_COLLECT_ID_PERIOD || elapsedTime > JIM_COLLECT_TIME_PERIOD) { @@ -5488,7 +5488,7 @@ Jim_Interp *Jim_CreateInterp(void) i->maxCallFrameDepth = JIM_MAX_CALLFRAME_DEPTH; i->maxEvalDepth = JIM_MAX_EVAL_DEPTH; - i->lastCollectTime = time(NULL); + i->lastCollectTime = JimClock(); /* Note that we can create objects only after the * interpreter liveList and freeList pointers are @@ -539,7 +539,7 @@ typedef struct Jim_Interp { is running as sentinel to avoid to recursive calls via the [collect] command inside finalizers. */ - time_t lastCollectTime; /* unix time of the last GC execution */ + jim_wide lastCollectTime; /* unix time of the last GC execution */ Jim_Obj *stackTrace; /* Stack trace object. */ Jim_Obj *errorProc; /* Name of last procedure which returned an error */ Jim_Obj *unknown; /* Unknown command cache */ |