Showing the changes to libraries/script-engine/src/ScriptEngine.h (1 of 6 files). Show all
Unified · Split
| @@ -27,7 +27,8 @@ · 26 unmodified lines | |||
| 27 | #include "ScriptException.h" | 27 | #include "ScriptException.h" |
| 28 | 28 | ||
| 29 | // These are used for debugging memory leaks caused by persistent handles | 29 | // These are used for debugging memory leaks caused by persistent handles |
| 30 | #define OVERTE_V8_HANDLE_COUNTERS | 30 | // V8TODO: Rename to something better, like for example OVERTE_V8_MEMORY_DEBUG |
| 31 | #define OVERTE_V8_MEMORY_DEBUG | ||
| 31 | 32 | ||
| 32 | class QByteArray; | 33 | class QByteArray; |
| 33 | class QLatin1String; | 34 | class QLatin1String; |
| @@ -56,7 +57,7 @@ public: · 22 unmodified lines | |||
| 56 | size_t totalAvailableSize; | 57 | size_t totalAvailableSize; |
| 57 | size_t totalGlobalHandlesSize; | 58 | size_t totalGlobalHandlesSize; |
| 58 | size_t usedGlobalHandlesSize; | 59 | size_t usedGlobalHandlesSize; |
| 59 | #ifdef OVERTE_V8_HANDLE_COUNTERS | 60 | #ifdef OVERTE_V8_MEMORY_DEBUG |
| 60 | size_t scriptValueCount; | 61 | size_t scriptValueCount; |
| 61 | size_t scriptValueProxyCount; | 62 | size_t scriptValueProxyCount; |
| 62 | #endif | 63 | #endif |
| @@ -399,6 +400,16 @@ public: · 336 unmodified lines | |||
| 399 | */ | 400 | */ |
| 400 | virtual ScriptEngineMemoryStatistics getMemoryUsageStatistics() = 0; | 401 | virtual ScriptEngineMemoryStatistics getMemoryUsageStatistics() = 0; |
| 401 | 402 | ||
| 403 | /** | ||
| 404 | * @brief Start collecting object statistics that can later be reported with dumpHeapObjectStatistics(). | ||
| 405 | */ | ||
| 406 | virtual void startCollectingObjectStatistics() = 0; | ||
| 407 | |||
| 408 | /** | ||
| 409 | * @brief Prints heap statistics to a file. Collecting needs to first be started with dumpHeapObjectStatistics(). | ||
| 410 | */ | ||
| 411 | virtual void dumpHeapObjectStatistics() = 0; | ||
| 412 | |||
| 402 | public: | 413 | public: |
| 403 | // helper to detect and log warnings when other code invokes QScriptEngine/BaseScriptEngine in thread-unsafe ways | 414 | // helper to detect and log warnings when other code invokes QScriptEngine/BaseScriptEngine in thread-unsafe ways |
| 404 | bool IS_THREADSAFE_INVOCATION(const QString& method); | 415 | bool IS_THREADSAFE_INVOCATION(const QString& method); |