aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4mm.cpp
diff options
context:
space:
mode:
authorJocelyn Turcotte <jocelyn.turcotte@digia.com>2014-12-12 16:38:09 +0100
committerLars Knoll <lars.knoll@digia.com>2014-12-18 09:42:08 +0100
commit6a69ccc297e4de9726fa1a08555b49abef3f12a9 (patch)
tree0a789ef91aef0f2ad8c4fe0823fe4b405a10301f /src/qml/jsruntime/qv4mm.cpp
parent7c0f21ce044eb39c203e524e5ddde53e25d9ed17 (diff)
Revert parts of "Fix the V4 valgrind integration"
Keep the MemoryManager as the pool argument of VALGRIND MEMPOOL functions and access it through ExecutionEngine::memoryManager. Change-Id: Iadb881ce8676088efe81870680aa75f6ba834248 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4mm.cpp')
-rw-r--r--src/qml/jsruntime/qv4mm.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/qml/jsruntime/qv4mm.cpp b/src/qml/jsruntime/qv4mm.cpp
index 451b5b8b7b..4aebda0916 100644
--- a/src/qml/jsruntime/qv4mm.cpp
+++ b/src/qml/jsruntime/qv4mm.cpp
@@ -171,7 +171,7 @@ struct ChunkSweepData {
bool isEmpty;
};
-void sweepChunk(const MemoryManager::Data::Chunk &chunk, ChunkSweepData *sweepData, uint *itemsInUse, MemoryManager::Data *data)
+void sweepChunk(const MemoryManager::Data::Chunk &chunk, ChunkSweepData *sweepData, uint *itemsInUse, ExecutionEngine *engine)
{
char *chunkStart = reinterpret_cast<char*>(chunk.memory.base());
std::size_t itemSize = chunk.chunkSize;
@@ -204,9 +204,9 @@ void sweepChunk(const MemoryManager::Data::Chunk &chunk, ChunkSweepData *sweepDa
memset(m, 0, itemSize);
#ifdef V4_USE_VALGRIND
VALGRIND_DISABLE_ERROR_REPORTING;
- VALGRIND_MEMPOOL_FREE(data, m);
+ VALGRIND_MEMPOOL_FREE(engine->memoryManager, m);
#endif
- Q_V4_PROFILE_DEALLOC(data->engine, m, itemSize, Profiling::SmallItem);
+ Q_V4_PROFILE_DEALLOC(engine, m, itemSize, Profiling::SmallItem);
++(*itemsInUse);
}
// Relink all free blocks to rewrite references to any released chunk.
@@ -227,7 +227,7 @@ MemoryManager::MemoryManager()
, m_weakValues(0)
{
#ifdef V4_USE_VALGRIND
- VALGRIND_CREATE_MEMPOOL(m_d.data(), 0, true);
+ VALGRIND_CREATE_MEMPOOL(this, 0, true);
#endif
}
@@ -310,7 +310,7 @@ Heap::Base *MemoryManager::allocData(std::size_t size)
found:
#ifdef V4_USE_VALGRIND
- VALGRIND_MEMPOOL_ALLOC(m_d.data(), m, size);
+ VALGRIND_MEMPOOL_ALLOC(this, m, size);
#endif
Q_V4_PROFILE_ALLOC(m_d->engine, size, Profiling::SmallItem);
@@ -427,7 +427,7 @@ void MemoryManager::sweep(bool lastSweep)
for (int i = 0; i < m_d->heapChunks.size(); ++i) {
const MemoryManager::Data::Chunk &chunk = m_d->heapChunks[i];
- sweepChunk(chunk, &chunkSweepData[i], &itemsInUse[chunk.chunkSize >> 4], m_d.data());
+ sweepChunk(chunk, &chunkSweepData[i], &itemsInUse[chunk.chunkSize >> 4], m_d->engine);
}
Heap::Base **tails[MemoryManager::Data::MaxItemSize/16];
@@ -591,7 +591,7 @@ MemoryManager::~MemoryManager()
sweep(/*lastSweep*/true);
#ifdef V4_USE_VALGRIND
- VALGRIND_DESTROY_MEMPOOL(m_d.data());
+ VALGRIND_DESTROY_MEMPOOL(this);
#endif
}