diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2018-01-09 09:03:53 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2018-01-09 10:45:21 +0000 |
commit | 4cc883452b37dbe3148064150dc2f6b282b6b816 (patch) | |
tree | c4a2e6bf2c4a057f3d154d0d450c001d8e3b1fb7 /src/qml/jsruntime/qv4profiling_p.h | |
parent | 53985897ef09a88cd2121962405decf355974e6f (diff) |
V4 Profiler: Re-add memory profiling macros
This is a partial revert of 6a91dcba2e4fa85dc345c2d403c757ab7676e28c
Change-Id: I3a501c6a8f17cea8192dca1dba493a8351e429da
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4profiling_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4profiling_p.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4profiling_p.h b/src/qml/jsruntime/qv4profiling_p.h index 8a24c71815..5742dd3062 100644 --- a/src/qml/jsruntime/qv4profiling_p.h +++ b/src/qml/jsruntime/qv4profiling_p.h @@ -59,6 +59,8 @@ #if !QT_CONFIG(qml_debug) +#define Q_V4_PROFILE_ALLOC(engine, size, type) (!engine) +#define Q_V4_PROFILE_DEALLOC(engine, size, type) (!engine) QT_BEGIN_NAMESPACE @@ -72,6 +74,16 @@ QT_END_NAMESPACE #else +#define Q_V4_PROFILE_ALLOC(engine, size, type)\ + (engine->profiler() &&\ + (engine->profiler()->featuresEnabled & (1 << Profiling::FeatureMemoryAllocation)) ?\ + engine->profiler()->trackAlloc(size, type) : false) + +#define Q_V4_PROFILE_DEALLOC(engine, size, type) \ + (engine->profiler() &&\ + (engine->profiler()->featuresEnabled & (1 << Profiling::FeatureMemoryAllocation)) ?\ + engine->profiler()->trackDealloc(size, type) : false) + QT_BEGIN_NAMESPACE namespace QV4 { |