Ignore:
Timestamp:
Jan 16, 2007, 1:07:54 PM (18 years ago)
Author:
ggaren
Message:

Reviewed by Darin Adler.


Added re-entrency checking to GC allocation and collection. It is an error
to allocate or collect from within a collection. We've had at least one
case of each bug in the past.


Added a comment to the API header, explaining that API clients must not
make this mistake, either.


Layout tests and JS tests pass.

  • API/JSObjectRef.h:
  • kjs/collector.cpp: (KJS::GCLock::GCLock): (KJS::GCLock::~GCLock): (KJS::Collector::allocate): (KJS::Collector::collect):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/API/JSObjectRef.h

    r17017 r18888  
    9999The finalize callback is called on the most derived class first, and the least
    100100derived class (the parent class) last.
     101
     102You must not call any function that may cause a garbage collection or an allocation
     103of a garbage collected object from within a JSObjectFinalizeCallback. This includes
     104all functions that have a JSContextRef parameter.
    101105*/
    102106typedef void           
Note: See TracChangeset for help on using the changeset viewer.