コード例 #1
0
        unsafe static void EnumerateGetAllocationInformationCallback(NativeUtility.MemoryAllocationType allocationType, int size, sbyte *fileName,
                                                                     int lineNumber, int allocationCount)
        {
            string fileInfo;

            if (fileName != null)
            {
                fileInfo = string.Format("{0}:{1}", new string( fileName ), lineNumber);
            }
            else
            {
                fileInfo = "NULL";
            }

            allocations.Add(string.Format("{0} - type: {1}, size: {2} x {3} = {4} (file: {5})", allocationItemName, allocationType,
                                          size, allocationCount, size * allocationCount, fileInfo));

            totalAllocationSize += (ulong)(size * allocationCount);
        }
コード例 #2
0
        ///////////////////////////////////////////

        public static void GetStatistics(NativeUtility.MemoryAllocationType allocationType, out long allocatedMemory, out int allocationCount)
        {
            LoadUtilsNativeWrapperLibrary();
            MemoryManager_GetStatistics(allocationType, out allocatedMemory, out allocationCount);
        }
コード例 #3
0
 static extern void MemoryManager_GetStatistics(NativeUtility.MemoryAllocationType allocationType, out long allocatedMemory, out int allocationCount);