Changeset 24874 in webkit for trunk/JavaScriptCore/API/JSBase.cpp


Ignore:
Timestamp:
Aug 5, 2007, 3:16:41 AM (18 years ago)
Author:
darin
Message:

Reviewed by Maciej.

  • fix <rdar://problem/5371862> crash in Dashcode due to Quartz Composer JavaScript garbage collector reentrancy
  • API/JSBase.cpp: (JSGarbageCollect): Don't call collector() if isBusy() returns true.
  • kjs/collector.h: Added isBusy(), removed the unused return value from collect()
  • kjs/collector.cpp: Added an "operation in progress" flag to the allocator. (KJS::Collector::allocate): Call abort() if an operation is already in progress. Set the new flag instead of using the debug-only GCLock. (KJS::Collector::collect): Ditto. (KJS::Collector::isBusy): Added.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/API/JSBase.cpp

    r16371 r24874  
    11// -*- mode: c++; c-basic-offset: 4 -*-
    22/*
    3  * Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
     3 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
    44 *
    55 * Redistribution and use in source and binary forms, with or without
     
    8080{
    8181    JSLock lock;
    82     Collector::collect();
     82    if (!Collector::isBusy())
     83        Collector::collect();
     84    // FIXME: Perhaps we should trigger a second mark and sweep
     85    // once the garbage collector is done if this is called when
     86    // the collector is busy.
    8387}
Note: See TracChangeset for help on using the changeset viewer.