Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/jsruntime/qv4executableallocator_p.h |
Switch to Source code | Preprocessed file |
Line | Source | Count |
---|---|---|
1 | - | |
2 | namespace WTF { | - |
3 | class PageAllocation; | - |
4 | } | - |
5 | - | |
6 | - | |
7 | - | |
8 | namespace QV4 { | - |
9 | - | |
10 | class __attribute__((visibility("default"))) ExecutableAllocator | - |
11 | { | - |
12 | public: | - |
13 | struct ChunkOfPages; | - |
14 | struct Allocation; | - |
15 | - | |
16 | ExecutableAllocator(); | - |
17 | ~ExecutableAllocator(); | - |
18 | - | |
19 | Allocation *allocate(size_t size); | - |
20 | void free(Allocation *allocation); | - |
21 | - | |
22 | struct Allocation | - |
23 | { | - |
24 | Allocation() | - |
25 | : size(0) | - |
26 | , free(true) | - |
27 | {} executed 1260688 times by 154 tests: end of block Executed by:
| 1260688 |
28 | - | |
29 | void *start() const; | - |
30 | void invalidate() { addr = 0; } never executed: end of block | 0 |
31 | bool isValid() const { return executed 1293132 times by 154 tests: addr != 0;return addr != 0; Executed by:
executed 1293132 times by 154 tests: }return addr != 0; Executed by:
| 1293132 |
32 | void deallocate(ExecutableAllocator *allocator); | - |
33 | - | |
34 | private: | - |
35 | ~Allocation() {} | - |
36 | - | |
37 | friend class ExecutableAllocator; | - |
38 | - | |
39 | Allocation *split(size_t dividingSize); | - |
40 | bool mergeNext(ExecutableAllocator *allocator); | - |
41 | bool mergePrevious(ExecutableAllocator *allocator); | - |
42 | - | |
43 | quintptr addr = 0; | - |
44 | uint size : 31; | - |
45 | uint free : 1; | - |
46 | Allocation *next = nullptr; | - |
47 | Allocation *prev = nullptr; | - |
48 | }; | - |
49 | - | |
50 | - | |
51 | int freeAllocationCount() const { return never executed: freeAllocations.count();return freeAllocations.count(); never executed: }return freeAllocations.count(); | 0 |
52 | int chunkCount() const { return never executed: chunks.count();return chunks.count(); never executed: }return chunks.count(); | 0 |
53 | - | |
54 | struct ChunkOfPages | - |
55 | { | - |
56 | ChunkOfPages() | - |
57 | - | |
58 | {} | - |
59 | ~ChunkOfPages(); | - |
60 | - | |
61 | WTF::PageAllocation *pages = nullptr; | - |
62 | Allocation *firstAllocation = nullptr; | - |
63 | - | |
64 | bool contains(Allocation *alloc) const; | - |
65 | }; | - |
66 | - | |
67 | ChunkOfPages *chunkForAllocation(Allocation *allocation) const; | - |
68 | - | |
69 | private: | - |
70 | QMultiMap<size_t, Allocation*> freeAllocations; | - |
71 | QMap<quintptr, ChunkOfPages*> chunks; | - |
72 | mutable QMutex mutex; | - |
73 | }; | - |
74 | - | |
75 | } | - |
76 | - | |
77 | - | |
Switch to Source code | Preprocessed file |