Changeset 12512 in webkit for trunk/JavaScriptCore


Ignore:
Timestamp:
Jan 31, 2006, 10:24:32 PM (19 years ago)
Author:
mjs
Message:

Reviewed by Darin.


  • fixed leak of hundreds of thousands of JS parser nodes on the layout tests, and added an exit counter that would catch them
  • kjs/nodes.cpp: (NodeCounter::~NodeCounter): Added debug-only node counter. (Node::Node): (Node::~Node):
  • kxmlcore/VectorTraits.h: Simple classes like RefPtr do in fact need destruction.
Location:
trunk/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r12511 r12512  
     12006-01-31  Maciej Stachowiak  <[email protected]>
     2
     3        Reviewed by Darin.
     4       
     5        - fixed leak of hundreds of thousands of JS parser nodes on the layout tests, and added an exit counter
     6        that would catch them
     7
     8        * kjs/nodes.cpp:
     9        (NodeCounter::~NodeCounter): Added debug-only node counter.
     10        (Node::Node):
     11        (Node::~Node):
     12        * kxmlcore/VectorTraits.h: Simple classes like RefPtr do in fact need destruction.
     13
    1142006-01-31  Darin Adler  <[email protected]>
    215
  • trunk/JavaScriptCore/kjs/nodes.cpp

    r12489 r12512  
    8686// ------------------------------ Node -----------------------------------------
    8787
     88
     89#ifndef NDEBUG
     90struct NodeCounter {
     91    static int count;
     92    ~NodeCounter() { if (count != 0) fprintf(stderr, "LEAK: %d KJS::Node\n", count); }
     93};
     94int NodeCounter::count = 0;
     95static NodeCounter nodeImplCounter;
     96#endif NDEBUG
     97
     98
    8899Node::Node()
    89100{
     101#ifndef NDEBUG
     102    ++NodeCounter::count;
     103#endif
    90104  line = Lexer::curr()->lineNo();
    91105  sourceURL = Lexer::curr()->sourceURL();
     
    96110Node::~Node()
    97111{
     112#ifndef NDEBUG
     113    --NodeCounter::count;
     114#endif
    98115}
    99116
  • trunk/JavaScriptCore/kxmlcore/VectorTraits.h

    r12435 r12512  
    7979    struct SimpleClassVectorTraits
    8080    {
    81         static const bool needsDestruction = false;
     81        static const bool needsDestruction = true;
    8282        static const bool needsInitialization = true;
    8383        static const bool canInitializeWithMemset = true;
Note: See TracChangeset for help on using the changeset viewer.