Ignore:
Timestamp:
Dec 8, 2005, 10:19:28 AM (19 years ago)
Author:
mjs
Message:

Reviewed by John.

  • fix major memory leak and resultant slowdown on JavaScript iBench from my PassRefPtr changes
  • kjs/ustring.cpp: (KJS::UString::Rep::create): I forgot to change one of the two overloads to create with a refcount of 0 instead of 1 (the smart pointer then bumps it. But instead of changing it, I changed both to start with a refcounter of 1 and use PassRefPtr::adopt to adopt the initial refcount, this may be a hair more efficient.
  • made the assignment operators for smart pointers inline because Shark said so
  • kxmlcore/PassRefPtr.h: (KXMLCore::::operator=):
  • kxmlcore/RefPtr.h: (KXMLCore::::operator=):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/ustring.cpp

    r11472 r11496  
    190190  r->offset = 0;
    191191  r->len = l;
    192   r->rc = 0;
     192  r->rc = 1;
    193193  r->_hash = 0;
    194194  r->isIdentifier = 0;
     
    199199  r->usedPreCapacity = 0;
    200200  r->preCapacity = 0;
    201   return r;
     201  // steal the single reference this Rep was created with
     202  return PassRefPtr<Rep>::adopt(r);
    202203}
    203204
     
    227228  r->usedPreCapacity = 0;
    228229  r->preCapacity = 0;
    229   return r;
     230  // steal the single reference this Rep was created with
     231  return PassRefPtr<Rep>::adopt(r);
    230232}
    231233
Note: See TracChangeset for help on using the changeset viewer.