OpenCoverage

OSAllocator.h

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/3rdparty/masm/wtf/OSAllocator.h
Switch to Source codePreprocessed file
LineSourceCount
1-
2namespace WTF {-
3-
4class OSAllocator {-
5public:-
6 enum Usage {-
7 UnknownUsage = -1,-
8 FastMallocPages = 0,-
9 JSGCHeapPages = 1,-
10 JSVMStackPages = 3,-
11 JSJITCodePages = 2,-
12 };-
13-
14-
15-
16-
17 static void* reserveUncommitted(size_t, Usage = UnknownUsage, bool writable = true, bool executable = false);-
18 static void releaseDecommitted(void*, size_t);-
19-
20-
21-
22-
23 static void commit(void*, size_t, bool writable, bool executable);-
24 static void decommit(void*, size_t);-
25-
26-
27-
28-
29 static void* reserveAndCommit(size_t, Usage = UnknownUsage, bool writable = true, bool executable = false, bool includesGuardPages = false);-
30 static void decommitAndRelease(void* base, size_t size);-
31-
32-
33-
34-
35 static void* reserveAndCommit(size_t reserveSize, size_t commitSize, Usage = UnknownUsage, bool writable = true, bool executable = false);-
36 static void decommitAndRelease(void* releaseBase, size_t releaseSize, void* decommitBase, size_t decommitSize);-
37-
38-
39-
40-
41 template<typename T>-
42 static T* reallocateCommitted(T*, size_t oldSize, size_t newSize, Usage = UnknownUsage, bool writable = true, bool executable = false);-
43-
44 static bool canAllocateExecutableMemory();-
45-
46-
47-
48-
49};-
50-
51inline void* OSAllocator::reserveAndCommit(size_t reserveSize, size_t commitSize, Usage usage, bool writable, bool executable)-
52{-
53 void* base = reserveUncommitted(reserveSize, usage, writable, executable);-
54 commit(base, commitSize, writable, executable);-
55 return
never executed: return base;
base;
never executed: return base;
0
56}-
57-
58inline void OSAllocator::decommitAndRelease(void* releaseBase, size_t releaseSize, void* decommitBase, size_t decommitSize)-
59{-
60 (!(decommitBase >= releaseBase && (static_cast<char*>(decommitBase) + decommitSize) <= (static_cast<char*>(releaseBase) + releaseSize)) ? (qmlWTFReportAssertionFailure(__FILE__, 91, __PRETTY_FUNCTION__, "decommitBase >= releaseBase && (static_cast<char*>(decommitBase) + decommitSize) <= (static_cast<char*>(releaseBase) + releaseSize)"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0);-
61-
62-
63-
64-
65-
66 (void)decommitBase;;-
67 (void)decommitSize;;-
68-
69 releaseDecommitted(releaseBase, releaseSize);-
70}
executed 505812 times by 153 tests: end of block
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
505812
71-
72inline void OSAllocator::decommitAndRelease(void* base, size_t size)-
73{-
74 decommitAndRelease(base, size, base, size);-
75}
executed 505820 times by 153 tests: end of block
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
505820
76-
77template<typename T>-
78inline T* OSAllocator::reallocateCommitted(T* oldBase, size_t oldSize, size_t newSize, Usage usage, bool writable, bool executable)-
79{-
80 void* newBase = reserveAndCommit(newSize, usage, writable, executable);-
81 memcpy(newBase, oldBase, std::min(oldSize, newSize));-
82 decommitAndRelease(oldBase, oldSize);-
83 return
never executed: return static_cast<T*>(newBase);
static_cast<T*>(newBase);
never executed: return static_cast<T*>(newBase);
0
84}-
85-
86}-
87-
88using WTF::OSAllocator;-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.0