Changeset 10701 in webkit for trunk/JavaScriptCore/kjs/array_object.cpp
- Timestamp:
- Oct 3, 2005, 2:13:12 PM (20 years ago)
- File:
-
- 1 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;
Note:
See TracChangeset
for help on using the changeset viewer.