Example #1
0
bool
js::gc::InitTrace(GCRuntime &gc)
{
    /* This currently does not support multiple runtimes. */
    MOZ_ALWAYS_TRUE(!gcTraceFile);

    char *filename = getenv("JS_GC_TRACE");
    if (!filename)
        return true;

    if (!tracedClasses.init() || !tracedTypes.init()) {
        FinishTrace();
        return false;
    }

    gcTraceFile = fopen(filename, "w");
    if (!gcTraceFile) {
        FinishTrace();
        return false;
    }

    TraceEvent(TraceEventInit, 0, TraceFormatVersion);

    /* Trace information about thing sizes. */
    for (unsigned kind = 0; kind < FINALIZE_LIMIT; ++kind)
        TraceEvent(TraceEventThingSize, Arena::thingSize((AllocKind)kind));

    return true;
}
Example #2
0
bool
CheckHeapTracer::init()
{
    return visited.init();
}