equal
deleted
inserted
replaced
253 QList<QScriptEngineAgent*> ownedAgents; |
253 QList<QScriptEngineAgent*> ownedAgents; |
254 QScriptEngineAgent *activeAgent; |
254 QScriptEngineAgent *activeAgent; |
255 int agentLineNumber; |
255 int agentLineNumber; |
256 QScriptValuePrivate *registeredScriptValues; |
256 QScriptValuePrivate *registeredScriptValues; |
257 QScriptValuePrivate *freeScriptValues; |
257 QScriptValuePrivate *freeScriptValues; |
|
258 static const int maxFreeScriptValues = 256; |
|
259 int freeScriptValuesCount; |
258 QScriptStringPrivate *registeredScriptStrings; |
260 QScriptStringPrivate *registeredScriptStrings; |
259 QHash<int, QScriptTypeInfo*> m_typeInfos; |
261 QHash<int, QScriptTypeInfo*> m_typeInfos; |
260 int processEventsInterval; |
262 int processEventsInterval; |
261 QScriptValue abortResult; |
263 QScriptValue abortResult; |
262 bool inEval; |
264 bool inEval; |
375 inline QScriptValuePrivate *QScriptEnginePrivate::allocateScriptValuePrivate(size_t size) |
377 inline QScriptValuePrivate *QScriptEnginePrivate::allocateScriptValuePrivate(size_t size) |
376 { |
378 { |
377 if (freeScriptValues) { |
379 if (freeScriptValues) { |
378 QScriptValuePrivate *p = freeScriptValues; |
380 QScriptValuePrivate *p = freeScriptValues; |
379 freeScriptValues = p->next; |
381 freeScriptValues = p->next; |
|
382 --freeScriptValuesCount; |
380 return p; |
383 return p; |
381 } |
384 } |
382 return reinterpret_cast<QScriptValuePrivate*>(qMalloc(size)); |
385 return reinterpret_cast<QScriptValuePrivate*>(qMalloc(size)); |
383 } |
386 } |
384 |
387 |
385 inline void QScriptEnginePrivate::freeScriptValuePrivate(QScriptValuePrivate *p) |
388 inline void QScriptEnginePrivate::freeScriptValuePrivate(QScriptValuePrivate *p) |
386 { |
389 { |
387 p->next = freeScriptValues; |
390 if (freeScriptValuesCount < maxFreeScriptValues) { |
388 freeScriptValues = p; |
391 p->next = freeScriptValues; |
|
392 freeScriptValues = p; |
|
393 ++freeScriptValuesCount; |
|
394 } else { |
|
395 qFree(p); |
|
396 } |
389 } |
397 } |
390 |
398 |
391 inline void QScriptEnginePrivate::registerScriptValue(QScriptValuePrivate *value) |
399 inline void QScriptEnginePrivate::registerScriptValue(QScriptValuePrivate *value) |
392 { |
400 { |
393 value->prev = 0; |
401 value->prev = 0; |