| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/debugger/qqmlmemoryprofiler_p.h |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||
|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||
| 2 | - | |||||||
| 3 | class __attribute__((visibility("default"))) QQmlMemoryScope | - | ||||||
| 4 | { | - | ||||||
| 5 | public: | - | ||||||
| 6 | explicit QQmlMemoryScope(const QUrl &url) | - | ||||||
| 7 | : pushed(false) | - | ||||||
| 8 | { | - | ||||||
| 9 | if (__builtin_expect(!!(openLibrary()), false)
| 0-329196 | ||||||
| 10 | init(url.path().toUtf8().constData()); never executed: init(url.path().toUtf8().constData()); | 0 | ||||||
| 11 | } executed 329196 times by 141 tests: end of blockExecuted by:
| 329196 | ||||||
| 12 | - | |||||||
| 13 | explicit QQmlMemoryScope(const char *string) | - | ||||||
| 14 | : pushed(false) | - | ||||||
| 15 | { | - | ||||||
| 16 | if (__builtin_expect(!!(openLibrary()), false)
| 0-112690 | ||||||
| 17 | init(string); never executed: init(string); | 0 | ||||||
| 18 | } executed 112690 times by 152 tests: end of blockExecuted by:
| 112690 | ||||||
| 19 | - | |||||||
| 20 | ~QQmlMemoryScope() | - | ||||||
| 21 | { | - | ||||||
| 22 | if (__builtin_expect(!!(pushed), false)
| 0-441886 | ||||||
| 23 | done(); never executed: done(); | 0 | ||||||
| 24 | } executed 441886 times by 152 tests: end of blockExecuted by:
| 441886 | ||||||
| 25 | - | |||||||
| 26 | enum LibraryState | - | ||||||
| 27 | { | - | ||||||
| 28 | Unloaded, | - | ||||||
| 29 | Failed, | - | ||||||
| 30 | Loaded | - | ||||||
| 31 | }; | - | ||||||
| 32 | - | |||||||
| 33 | static bool openLibrary() | - | ||||||
| 34 | { | - | ||||||
| 35 | if (__builtin_expect(!!(state == Loaded), true)
| 0-441886 | ||||||
| 36 | return never executed: true;return true;never executed: return true; | 0 | ||||||
| 37 | if (state == Failed
| 336-441550 | ||||||
| 38 | return executed 441550 times by 147 tests: false;return false;Executed by:
executed 441550 times by 147 tests: return false;Executed by:
| 441550 | ||||||
| 39 | - | |||||||
| 40 | return executed 336 times by 152 tests: doOpenLibrary();return doOpenLibrary();Executed by:
executed 336 times by 152 tests: return doOpenLibrary();Executed by:
| 336 | ||||||
| 41 | } | - | ||||||
| 42 | - | |||||||
| 43 | private: | - | ||||||
| 44 | __attribute__((noinline)) void init(const char *string); | - | ||||||
| 45 | __attribute__((noinline)) void done(); | - | ||||||
| 46 | __attribute__((noinline)) static bool doOpenLibrary(); | - | ||||||
| 47 | - | |||||||
| 48 | static LibraryState state; | - | ||||||
| 49 | - | |||||||
| 50 | bool pushed; | - | ||||||
| 51 | }; | - | ||||||
| 52 | - | |||||||
| 53 | class __attribute__((visibility("default"))) QQmlMemoryProfiler | - | ||||||
| 54 | { | - | ||||||
| 55 | public: | - | ||||||
| 56 | static void enable(); | - | ||||||
| 57 | static void disable(); | - | ||||||
| 58 | static bool isEnabled(); | - | ||||||
| 59 | - | |||||||
| 60 | static void clear(); | - | ||||||
| 61 | static void stats(int *allocCount, int *bytesAllocated); | - | ||||||
| 62 | static void save(const char *filename); | - | ||||||
| 63 | }; | - | ||||||
| 64 | - | |||||||
| 65 | - | |||||||
| 66 | - | |||||||
| 67 | - | |||||||
| 68 | - | |||||||
| 69 | - | |||||||
| 70 | - | |||||||
| Switch to Source code | Preprocessed file |