You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Ruffles/Memory/HeapMemory.cs
+15-2Lines changed: 15 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -25,6 +25,10 @@ public byte[] Buffer
25
25
privatebyte[]_buffer;
26
26
internalboolisDead;
27
27
28
+
#if DEBUG
29
+
internalstringallocStacktrace;
30
+
#endif
31
+
28
32
publicHeapMemory(uintsize)
29
33
{
30
34
_buffer=newbyte[size];
@@ -53,11 +57,20 @@ public void EnsureSize(uint size)
53
57
{
54
58
if(!isDead)
55
59
{
56
-
if(Logging.CurrentLogLevel<=LogLevel.Warning)Logging.LogWarning("Memory was just leaked from the MemoryManager [Size="+Buffer.Length+"]");
60
+
#if DEBUG
61
+
if(Logging.CurrentLogLevel<=LogLevel.Warning)Logging.LogWarning("Memory was just leaked from the MemoryManager [Size="+Buffer.Length+"] AllocStack: "+allocStacktrace);
62
+
#else
63
+
if(Logging.CurrentLogLevel<=LogLevel.Warning)Logging.LogWarning("Memory was just leaked from the MemoryManager [Size="+Buffer.Length+"]");
64
+
65
+
#endif
57
66
}
58
67
else
59
68
{
60
-
if(Logging.CurrentLogLevel<=LogLevel.Debug)Logging.LogWarning("Dead memory was just leaked from the MemoryManager [Size="+_buffer.Length+"]");
69
+
#if DEBUG
70
+
if(Logging.CurrentLogLevel<=LogLevel.Debug)Logging.LogWarning("Dead memory was just leaked from the MemoryManager [Size="+_buffer.Length+"] AllocStack: "+allocStacktrace);
71
+
#else
72
+
if(Logging.CurrentLogLevel<=LogLevel.Debug)Logging.LogWarning("Dead memory was just leaked from the MemoryManager [Size="+_buffer.Length+"]");
0 commit comments