{
memset(smallItems, 0, sizeof(smallItems));
memset(nChunks, 0, sizeof(nChunks));
- scribble = qgetenv("MM_NO_SCRIBBLE").isEmpty();
+ scribble = !qgetenv("MM_SCRIBBLE").isEmpty();
aggressiveGC = !qgetenv("MM_AGGRESSIVE_GC").isEmpty();
}
return m;
}
-void MemoryManager::scribble(Managed *obj, int c, int size) const
-{
- if (m_d->scribble)
+#define SCRIBBLE(obj, c, size) \
+ if (m_d->scribble) \
::memset((void *)(obj + 1), c, size - sizeof(Managed));
-}
void MemoryManager::mark()
{
m->nextFree = *f;
f = &m->nextFree;
- //scribble(m, 0x99, size);
+ SCRIBBLE(m, 0x99, size);
++freedCount;
}
}
// TODO: try to inline
Managed *alloc(std::size_t size);
- void scribble(Managed *obj, int c, int size) const;
-
ExecutionEngine *engine() const;
#ifdef DETAILED_MM_STATS