Changeset 12559 in webkit for trunk/JavaScriptCore/kjs/collector.cpp
- Timestamp:
- Feb 4, 2006, 3:29:43 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/collector.cpp
r12329 r12559 1 // -*- c-basic-offset: 2-*-1 // -*- mode: c++; c-basic-offset: 4 -*- 2 2 /* 3 3 * This file is part of the KDE libraries … … 35 35 #if __APPLE__ 36 36 37 #include <CoreFoundation/CoreFoundation.h>38 37 #include <pthread.h> 39 38 #include <mach/mach_port.h> … … 597 596 } 598 597 599 size_t Collector::numGCNotAllowedObjects() 600 { 601 return 0; 602 } 603 604 size_t Collector::numReferencedObjects() 598 size_t Collector::numProtectedObjects() 605 599 { 606 600 return protectedValues().size(); 607 601 } 608 602 609 #if __APPLE__ 610 611 static const char *className(JSCell *val) 603 static const char *typeName(JSCell *val) 612 604 { 613 605 const char *name = "???"; … … 642 634 } 643 635 644 const void *Collector::rootObjectClasses() 645 { 646 // FIXME: this should be a HashSet (or maybe even CountedHashSet) 647 CFMutableSetRef classes = CFSetCreateMutable(NULL, 0, &kCFTypeSetCallBacks); 648 649 ProtectCounts& pv = protectedValues(); 650 ProtectCounts::iterator end = pv.end(); 651 for (ProtectCounts::iterator it = pv.begin(); it != end; ++it) { 652 JSCell *val = it->first; 653 CFStringRef name = CFStringCreateWithCString(NULL, className(val), kCFStringEncodingASCII); 654 CFSetAddValue(classes, name); 655 CFRelease(name); 656 } 657 658 return classes; 659 } 660 661 #endif 636 HashCountedSet<const char*>* Collector::rootObjectTypeCounts() 637 { 638 HashCountedSet<const char*>* counts = new HashCountedSet<const char*>; 639 640 ProtectCounts& pv = protectedValues(); 641 ProtectCounts::iterator end = pv.end(); 642 for (ProtectCounts::iterator it = pv.begin(); it != end; ++it) 643 counts->add(typeName(it->first)); 644 645 return counts; 646 } 662 647 663 648 } // namespace KJS
Note:
See TracChangeset
for help on using the changeset viewer.