array = renew array T[(int)pos + 1];
count = (int)pos + 1;
if(justAdded) *justAdded = true;
+#if !defined(MEMINFO) && defined(MEMTRACKING)
+ if(array)
+ {
+ MemBlock block = (MemBlock)((byte *)array - sizeof(class MemBlock));
+ block._class = class(T);
+ }
+#endif
}
return ((int)pos < count && array) ? (IteratorPointer)(array + (int)pos) : null;
}
else if(value > count)
memset((byte *)array + count * class(T).typeSize, 0, (value - count) * class(T).typeSize);
count = value;
-#if defined(_DEBUG) && !defined(MEMINFO) && defined(MEMTRACKING)
+#if !defined(MEMINFO) && defined(MEMTRACKING)
if(array)
{
MemBlock block = (MemBlock)((byte *)array - sizeof(class MemBlock));
array = renew array T[value];
minAllocSize = value;
}
+#if !defined(MEMINFO) && defined(MEMTRACKING)
+ if(array)
+ {
+ MemBlock block = (MemBlock)((byte *)array - sizeof(class MemBlock));
+ block._class = class(T);
+ }
+#endif
}
}
if(count > minAllocSize)
array = renew array T[count];
+#if !defined(MEMINFO) && defined(MEMTRACKING)
+ if(array)
+ {
+ MemBlock block = (MemBlock)((byte *)array - sizeof(class MemBlock));
+ block._class = class(T);
+ }
+#endif
+
// TOFIX: Precomp fails on (BuiltInContainer *)
if((source._class == class(BuiltInContainer) && ((struct BuiltInContainer *)source)->type.type != structClass ) ||
eClass_IsDerived(source._class, class(Array)))
MemBlock prev, next;
MemPart part;
uint size;
-#if defined(_DEBUG) && !defined(MEMINFO) && defined(MEMTRACKING)
+#if !defined(MEMINFO) && defined(MEMTRACKING)
Class _class;
#endif
};
block = pools[p].Add();
if(block)
{
-#if defined(_DEBUG) && defined(MEMTRACKING)
+#if defined(MEMTRACKING)
block._class = null;
#endif
block.size = size;
TOTAL_MEM += sizeof(class MemBlock) + size;
OUTSIDE_MEM += sizeof(class MemBlock) + size;
block.part = null;
-#if defined(_DEBUG) && defined(MEMTRACKING)
+#if defined(MEMTRACKING)
block._class = null;
#endif
block.size = size;
memMutex.Release();
#endif
-#if defined(_DEBUG) && !defined(MEMINFO) && defined(MEMTRACKING)
+#if !defined(MEMINFO) && defined(MEMTRACKING)
{
MemBlock block = (MemBlock)((byte *)instance - sizeof(class MemBlock));
block._class = _class;
namespace com;
-#if defined(_DEBUG) && !defined(MEMINFO) && defined(MEMTRACKING)
+#if !defined(MEMINFO) && defined(MEMTRACKING)
import "Map"
Map<Class, int> blocksByClass { };
public void queryMemInfo(char * string)
{
-#if defined(_DEBUG) && !defined(MEMINFO) && defined(MEMTRACKING)
+#if !defined(MEMINFO) && defined(MEMTRACKING) && !defined(DISABLE_MEMMGR)
char s[1024];
int p;
uint numBlocks = 0;