Przeglądaj źródła

Fixed custom allocators when recording >1 allocation stack depth

Brian Fiete 5 lat temu
rodzic
commit
973b5e73cf
1 zmienionych plików z 21 dodań i 1 usunięć
  1. 21 1
      BeefLibs/corlib/src/Internal.bf

+ 21 - 1
BeefLibs/corlib/src/Internal.bf

@@ -51,8 +51,10 @@ namespace System
 		public static extern void ObjectDynCheck(Object obj, int32 typeId, bool allowNull);
 		public static extern void ObjectDynCheckFailed(Object obj, int32 typeId);
 		public static extern void Dbg_ObjectCreated(Object obj, int size, ClassVData* classVData);
+		public static extern void Dbg_ObjectCreatedEx(Object obj, int size, ClassVData* classVData);
 		public static extern void Dbg_ObjectAllocated(Object obj, int size, ClassVData* classVData);
-		public static extern int Dbg_PrepareStackTrace(int maxDepth);
+		public static extern void Dbg_ObjectAllocatedEx(Object obj, int size, ClassVData* classVData);
+		public static extern int Dbg_PrepareStackTrace(int baseAllocSize, int maxStackTraceDepth);
 		public static extern void Dbg_ObjectStackInit(Object object, ClassVData* classVData);
 		public static extern Object Dbg_ObjectAlloc(TypeInstance typeInst, int size);
 		public static extern Object Dbg_ObjectAlloc(ClassVData* classVData, int size, int align, int maxStackTraceDepth);
@@ -250,4 +252,22 @@ namespace System
         extern static this();
         extern static ~this();
     }
+
+	struct CRTAlloc
+	{
+		public void* Alloc(int size, int align)
+		{
+			return Internal.StdMalloc(size);
+		}
+
+		public void Free(void* ptr)
+		{
+			Internal.StdFree(ptr);
+		}
+	}
+
+	static
+	{
+		public static CRTAlloc gCRTAlloc;
+	}
 }