Changeset 10701 in webkit for trunk/JavaScriptCore/kjs
- Timestamp:
- Oct 3, 2005, 2:13:12 PM (20 years ago)
- Location:
- trunk/JavaScriptCore/kjs
- Files:
-
- 36 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/array_object.cpp
r10207 r10701 21 21 */ 22 22 23 #include "config.h" 23 24 #include "array_object.h" 24 25 … … 50 51 , storageLength(initialLength < sparseArrayCutoff ? initialLength : 0) 51 52 , capacity(storageLength) 52 , storage(capacity ? (ValueImp **) calloc(capacity, sizeof(ValueImp *)) : 0)53 , storage(capacity ? (ValueImp **)fastCalloc(capacity, sizeof(ValueImp *)) : 0) 53 54 { 54 55 } … … 59 60 , storageLength(length) 60 61 , capacity(storageLength) 61 , storage(capacity ? (ValueImp **) malloc(sizeof(ValueImp *) * capacity) : 0)62 , storage(capacity ? (ValueImp **)fastMalloc(sizeof(ValueImp *) * capacity) : 0) 62 63 { 63 64 ListIterator it = list.begin(); … … 70 71 ArrayInstanceImp::~ArrayInstanceImp() 71 72 { 72 f ree(storage);73 fastFree(storage); 73 74 } 74 75 … … 216 217 } 217 218 } 218 storage = (ValueImp **) realloc(storage, newCapacity * sizeof (ValueImp *));219 storage = (ValueImp **)fastRealloc(storage, newCapacity * sizeof (ValueImp *)); 219 220 memset(storage + capacity, 0, sizeof(ValueImp *) * (newCapacity - capacity)); 220 221 capacity = newCapacity; -
trunk/JavaScriptCore/kjs/bool_object.cpp
r10207 r10701 21 21 */ 22 22 23 #include "config.h" 23 24 #include "value.h" 24 25 #include "object.h" -
trunk/JavaScriptCore/kjs/collector.cpp
r10641 r10701 20 20 */ 21 21 22 #include "config.h" 22 23 #include "collector.h" 23 24 24 25 #include <kxmlcore/FastMalloc.h> 26 #include <kxmlcore/FastMallocInternal.h> 25 27 #include "internal.h" 26 28 #include "list.h" … … 225 227 if (!pthread_getspecific(registeredThreadKey)) { 226 228 pthread_t pthread = pthread_self(); 229 KXMLCore::fastMallocRegisterThread(pthread); 227 230 Collector::Thread *thread = new Collector::Thread(pthread, pthread_mach_thread_np(pthread)); 228 231 thread->next = registeredThreads; -
trunk/JavaScriptCore/kjs/config.h
r10634 r10701 33 33 34 34 #define KXC_CHANGES 1 35 36 #ifdef __cplusplus 37 #undef new 38 #undef delete 39 #include <kxmlcore/FastMalloc.h> 40 #endif -
trunk/JavaScriptCore/kjs/debugger.cpp
r10084 r10701 21 21 */ 22 22 23 #include "config.h" 23 24 #include "debugger.h" 24 25 #include "value.h" -
trunk/JavaScriptCore/kjs/error_object.cpp
r10178 r10701 21 21 */ 22 22 23 #include "config.h" 23 24 #include "value.h" 24 25 #include "object.h" -
trunk/JavaScriptCore/kjs/fpconst.cpp
r4206 r10701 18 18 */ 19 19 20 #include <config.h>20 #include "config.h" 21 21 22 22 // This file exists because JavaScriptCore needs to define the NaN and Inf globals in a way -
trunk/JavaScriptCore/kjs/function.cpp
r10634 r10701 23 23 */ 24 24 25 #include "config.h" 25 26 #include "function.h" 26 27 -
trunk/JavaScriptCore/kjs/function_object.cpp
r10634 r10701 21 21 */ 22 22 23 #include "config.h" 23 24 #include "function_object.h" 24 25 #include "internal.h" -
trunk/JavaScriptCore/kjs/identifier.cpp
r10634 r10701 34 34 #endif 35 35 36 #include "config.h" 36 37 #include "identifier.h" 37 38 … … 288 289 _tableSize = newTableSize; 289 290 _tableSizeMask = newTableSize - 1; 290 _table = (UString::Rep **) calloc(newTableSize, sizeof(UString::Rep *));291 _table = (UString::Rep **)fastCalloc(newTableSize, sizeof(UString::Rep *)); 291 292 292 293 for (int i = 0; i != oldTableSize; ++i) … … 294 295 insert(key); 295 296 296 f ree(oldTable);297 fastFree(oldTable); 297 298 } 298 299 -
trunk/JavaScriptCore/kjs/internal.cpp
r10653 r10701 22 22 */ 23 23 24 #include "config.h" 24 25 #include <stdio.h> 25 26 #include <math.h> … … 368 369 if (numNewNodes == newNodesCapacity) { 369 370 newNodesCapacity = (newNodesCapacity == 0) ? initialCapacity : newNodesCapacity * growthFactor; 370 newNodes = (Node **) realloc(newNodes, sizeof(Node *) * newNodesCapacity);371 newNodes = (Node **)fastRealloc(newNodes, sizeof(Node *) * newNodesCapacity); 371 372 } 372 373 … … 380 381 delete newNodes[i]; 381 382 } 382 delete newNodes;383 fastFree(newNodes); 383 384 newNodes = 0; 384 385 numNewNodes = 0; -
trunk/JavaScriptCore/kjs/interpreter.cpp
r10563 r10701 23 23 */ 24 24 25 #include "config.h" 25 26 #include "value.h" 26 27 #include "object.h" -
trunk/JavaScriptCore/kjs/lexer.cpp
r10588 r10701 835 835 delete identifiers[i]; 836 836 } 837 f ree(identifiers);837 fastFree(identifiers); 838 838 identifiers = 0; 839 839 numIdentifiers = 0; … … 843 843 delete strings[i]; 844 844 } 845 f ree(strings);845 fastFree(strings); 846 846 strings = 0; 847 847 numStrings = 0; … … 856 856 if (numIdentifiers == identifiersCapacity) { 857 857 identifiersCapacity = (identifiersCapacity == 0) ? initialCapacity : identifiersCapacity *growthFactor; 858 identifiers = (KJS::Identifier **) realloc(identifiers, sizeof(KJS::Identifier *) * identifiersCapacity);858 identifiers = (KJS::Identifier **)fastRealloc(identifiers, sizeof(KJS::Identifier *) * identifiersCapacity); 859 859 } 860 860 … … 868 868 if (numStrings == stringsCapacity) { 869 869 stringsCapacity = (stringsCapacity == 0) ? initialCapacity : stringsCapacity *growthFactor; 870 strings = (UString **) realloc(strings, sizeof(UString *) * stringsCapacity);870 strings = (UString **)fastRealloc(strings, sizeof(UString *) * stringsCapacity); 871 871 } 872 872 -
trunk/JavaScriptCore/kjs/list.cpp
r10456 r10701 20 20 */ 21 21 22 #include "config.h" 22 23 #include "list.h" 23 24 -
trunk/JavaScriptCore/kjs/lookup.cpp
r9768 r10701 21 21 */ 22 22 23 #include "config.h" 23 24 #include <stdio.h> 24 25 #include <string.h> … … 27 28 28 29 #ifdef HAVE_CONFIG_H 29 #include <config.h>30 30 #endif 31 31 -
trunk/JavaScriptCore/kjs/math_object.cpp
r10456 r10701 20 20 */ 21 21 22 #include "config.h" 22 23 #include <math.h> 23 24 #include <stdlib.h> -
trunk/JavaScriptCore/kjs/nodes.cpp
r10646 r10701 22 22 */ 23 23 24 #include "config.h" 24 25 #include "nodes.h" 25 26 -
trunk/JavaScriptCore/kjs/nodes.h
r10646 r10701 26 26 #define _NODES_H_ 27 27 28 #include <kxmlcore/FastMalloc.h>29 28 #include <kxmlcore/SharedPtr.h> 30 29 … … 72 71 }; 73 72 74 class Node : public FastAllocated{73 class Node { 75 74 public: 76 75 Node(); -
trunk/JavaScriptCore/kjs/nodes2string.cpp
r10646 r10701 21 21 */ 22 22 23 #include "config.h" 23 24 #include "nodes.h" 24 25 -
trunk/JavaScriptCore/kjs/number_object.cpp
r10456 r10701 20 20 */ 21 21 22 #include "config.h" 22 23 #include "value.h" 23 24 #include "object.h" … … 97 98 98 99 if (length <= decimalPoint) { 99 buf = (char*) malloc(decimalPoint+1);100 buf = (char*)fastMalloc(decimalPoint+1); 100 101 strcpy(buf,result); 101 102 memset(buf+length,'0',decimalPoint-length); 102 103 } else { 103 buf = (char*) malloc(decimalPoint+1);104 buf = (char*)fastMalloc(decimalPoint+1); 104 105 strncpy(buf,result,decimalPoint); 105 106 } … … 107 108 buf[decimalPoint] = '\0'; 108 109 str += UString(buf); 109 f ree(buf);110 fastFree(buf); 110 111 } 111 112 … … 117 118 static UString char_sequence(char c, int count) 118 119 { 119 char *buf = (char*) malloc(count+1);120 char *buf = (char*)fastMalloc(count+1); 120 121 memset(buf,c,count); 121 122 buf[count] = '\0'; 122 123 UString s(buf); 123 f ree(buf);124 fastFree(buf); 124 125 return s; 125 126 } -
trunk/JavaScriptCore/kjs/object.cpp
r10207 r10701 23 23 */ 24 24 25 #include "config.h" 25 26 #include "value.h" 26 27 #include "object.h" -
trunk/JavaScriptCore/kjs/object_object.cpp
r10207 r10701 20 20 */ 21 21 22 #include "config.h" 22 23 #include "value.h" 23 24 #include "object.h" -
trunk/JavaScriptCore/kjs/operations.cpp
r10456 r10701 21 21 */ 22 22 23 #include "config.h" 23 24 #include "operations.h" 24 25 25 #include "config.h"26 26 27 27 #include <stdio.h> -
trunk/JavaScriptCore/kjs/property_map.cpp
r10634 r10701 20 20 */ 21 21 22 #include "config.h" 22 23 #include "property_map.h" 23 24 -
trunk/JavaScriptCore/kjs/property_slot.cpp
r10084 r10701 22 22 23 23 24 #include "config.h" 24 25 #include "property_slot.h" 25 26 -
trunk/JavaScriptCore/kjs/protected_values.cpp
r10563 r10701 21 21 */ 22 22 23 #include "config.h" 23 24 #include "protected_values.h" 24 25 … … 185 186 _tableSize = newTableSize; 186 187 _tableSizeMask = newTableSize - 1; 187 _table = (KeyValue *) calloc(newTableSize, sizeof(KeyValue));188 _table = (KeyValue *)fastCalloc(newTableSize, sizeof(KeyValue)); 188 189 189 190 for (int i = 0; i != oldTableSize; ++i) … … 191 192 insert(oldTable[i].key, oldTable[i].value); 192 193 193 f ree(oldTable);194 fastFree(oldTable); 194 195 } 195 196 -
trunk/JavaScriptCore/kjs/reference.cpp
r10621 r10701 21 21 */ 22 22 23 #include "config.h" 23 24 #include "reference.h" 25 24 26 #include "internal.h" 25 27 -
trunk/JavaScriptCore/kjs/reference_list.cpp
r10563 r10701 21 21 */ 22 22 23 #include "config.h" 23 24 #include "reference_list.h" 25 24 26 #include "protected_reference.h" 25 27 -
trunk/JavaScriptCore/kjs/regexp.cpp
r10456 r10701 20 20 */ 21 21 22 #include "config.h" 22 23 #include "regexp.h" 23 24 -
trunk/JavaScriptCore/kjs/regexp_object.cpp
r10556 r10701 21 21 */ 22 22 23 #include "config.h" 24 #include "regexp_object.h" 25 23 26 #include <stdio.h> 24 25 27 #include "value.h" 26 28 #include "object.h" … … 30 32 #include "internal.h" 31 33 #include "regexp.h" 32 #include "regexp_object.h"33 34 #include "error_object.h" 34 35 -
trunk/JavaScriptCore/kjs/scope_chain.cpp
r9768 r10701 20 20 */ 21 21 22 #include "config.h" 22 23 #include "scope_chain.h" 23 24 -
trunk/JavaScriptCore/kjs/scope_chain.h
r10634 r10701 23 23 #define KJS_SCOPE_CHAIN_H 24 24 25 #include <kxmlcore/FastMalloc.h>26 27 25 namespace KJS { 28 26 29 27 class ObjectImp; 30 28 31 class ScopeChainNode : public FastAllocated{29 class ScopeChainNode { 32 30 public: 33 31 ScopeChainNode(ScopeChainNode *n, ObjectImp *o) -
trunk/JavaScriptCore/kjs/string_object.cpp
r10634 r10701 21 21 */ 22 22 23 #include "config.h" 24 #include "string_object.h" 25 23 26 #include "value.h" 24 27 #include "object.h" … … 28 31 #include "regexp.h" 29 32 #include "regexp_object.h" 30 #include "string_object.h"31 33 #include "error_object.h" 32 34 #include <stdio.h> -
trunk/JavaScriptCore/kjs/testkjs.cpp
r10563 r10701 22 22 */ 23 23 24 #include "config.h" 24 25 #include <stdio.h> 25 26 #include <stdlib.h> -
trunk/JavaScriptCore/kjs/ustring.h
r10634 r10701 194 194 * @short Unicode string class 195 195 */ 196 class UString : public FastAllocated{196 class UString { 197 197 friend bool operator==(const UString&, const UString&); 198 198 friend class UCharReference; … … 205 205 */ 206 206 struct Rep { 207 208 FAST_ALLOCATED_POD;209 207 210 208 static Rep *create(UChar *d, int l); -
trunk/JavaScriptCore/kjs/value.cpp
r10556 r10701 22 22 */ 23 23 24 #include "config.h" 24 25 #include "value.h" 25 26
Note:
See TracChangeset
for help on using the changeset viewer.