add pausing interrupts

This commit is contained in:
2024-10-29 14:46:02 -05:00
parent 7b3b6c1bd2
commit 5b97a04681
2 changed files with 334 additions and 229 deletions

551
quickjs.c

File diff suppressed because it is too large Load Diff

View File

@@ -99,6 +99,13 @@ typedef struct JSRefCountHeader {
int ref_count; int ref_count;
} JSRefCountHeader; } JSRefCountHeader;
void quickjs_set_dumpout(FILE *f);
void quickjs_set_cycleout(FILE *f);
void JS_SetInterruptRate(int count);
void JS_PrintShapes(JSRuntime *rt);
void JS_PrintAtoms(JSRuntime *rt);
#define JS_FLOAT64_NAN NAN #define JS_FLOAT64_NAN NAN
#ifdef CONFIG_CHECK_JSVALUE #ifdef CONFIG_CHECK_JSVALUE
@@ -369,6 +376,7 @@ JSRuntime *JS_NewRuntime(void);
void JS_SetRuntimeInfo(JSRuntime *rt, const char *info); void JS_SetRuntimeInfo(JSRuntime *rt, const char *info);
void JS_SetMemoryLimit(JSRuntime *rt, size_t limit); void JS_SetMemoryLimit(JSRuntime *rt, size_t limit);
void JS_SetGCThreshold(JSRuntime *rt, size_t gc_threshold); void JS_SetGCThreshold(JSRuntime *rt, size_t gc_threshold);
JSValue JS_GetRTInfo(JSRuntime *rt, JSContext *js);
/* use 0 to disable maximum stack size check */ /* use 0 to disable maximum stack size check */
void JS_SetMaxStackSize(JSRuntime *rt, size_t stack_size); void JS_SetMaxStackSize(JSRuntime *rt, size_t stack_size);
/* should be called when changing thread to update the stack top value /* should be called when changing thread to update the stack top value
@@ -428,6 +436,7 @@ char *js_strndup(JSContext *ctx, const char *s, size_t n);
typedef struct JSMemoryUsage { typedef struct JSMemoryUsage {
int64_t malloc_size, malloc_limit, memory_used_size; int64_t malloc_size, malloc_limit, memory_used_size;
int64_t gc_threshold;
int64_t malloc_count; int64_t malloc_count;
int64_t memory_used_count; int64_t memory_used_count;
int64_t atom_count, atom_size; int64_t atom_count, atom_size;
@@ -443,7 +452,10 @@ typedef struct JSMemoryUsage {
} JSMemoryUsage; } JSMemoryUsage;
void JS_ComputeMemoryUsage(JSRuntime *rt, JSMemoryUsage *s); void JS_ComputeMemoryUsage(JSRuntime *rt, JSMemoryUsage *s);
void JS_FillMemoryState(JSRuntime *rt, JSMemoryUsage *s);
void JS_DumpMemoryUsage(FILE *fp, const JSMemoryUsage *s, JSRuntime *rt); void JS_DumpMemoryUsage(FILE *fp, const JSMemoryUsage *s, JSRuntime *rt);
void JS_DumpMyValue(JSRuntime *rt, JSValue v);
double JS_MyValueSize(JSRuntime *rt, JSValue v);
/* atom support */ /* atom support */
#define JS_ATOM_NULL 0 #define JS_ATOM_NULL 0