Mercurial > spidermonkey-playground
diff memory_profiler.cpp @ 63:4910bc49a182
set GC Zeal to 2 and fixed some bugs exposed by it.
author | Atul Varma <varmaa@toolness.com> |
---|---|
date | Thu, 25 Jun 2009 11:39:32 -0700 |
parents | 03078138a4cd |
children | 109d9927c805 |
line wrap: on
line diff
--- a/memory_profiler.cpp Thu Jun 25 10:48:47 2009 -0700 +++ b/memory_profiler.cpp Thu Jun 25 11:39:32 2009 -0700 @@ -145,6 +145,11 @@ } } + if (numObjectChildren != currChild) { + JS_ReportError(cx, "Assertion failure, numObjectChildren != currChild"); + return JS_FALSE; + } + JSObject *children = JS_NewArrayObject(cx, numObjectChildren, childrenVals); if (children == NULL) { JS_ReportOutOfMemory(cx); @@ -227,6 +232,7 @@ if (JS_DHASH_ENTRY_IS_BUSY((JSDHashEntryHdr *)entry)) { JSObject *info = JS_NewObject(cx, NULL, NULL, NULL); + *rval = OBJECT_TO_JSVAL(info); JSObject *target = (JSObject *) id; JSContext *targetCx = tracingState.tracer.context; @@ -364,6 +370,10 @@ JS_BeginRequest(serverCx); +#ifdef DEBUG + JS_SetGCZeal(serverCx, 2); +#endif + JSObject *serverGlobal = JS_NewObject(serverCx, &global_class, NULL, NULL); if (serverGlobal == NULL) {