UMDH exit consciousness

Background

I installed a test harness to test a set of functions from a DLL that I am developing for a project.

I want to verify that functions have zero memory leaks on a Windows system.

I configured UMDH correctly and I can get a comparison file between two heap dumps. Even the stack trace shows up well.

Problem

The way out of diff is puzzling me, and I was hoping that someone could explain why I get the output that I get.

Result from comparison log:

+      56 (     56 -      0)      1 allocs  BackTrace9C160
+       1 (      1 -      0)    BackTrace9C160  allocations

I set log1 and log2 as a single distribution separately, just to check my setup.

, 1 , , 56- . sizeof (int) . int 4 , +4, +56.

, , ,

new int; //purposely leak memory

?

:

IDE/: Visual Studio 2010

64

DLL ( int)

, +0 . , , , 1 , ...

. SleuthEye . , , , , , :

, .exe, , umdh , . , .

+4
2

56 , (CRT) C , MSDN.

dbbint.h, _CrtMemBlockHeader :

#define nNoMansLandSize 4

typedef struct _CrtMemBlockHeader
{
        struct _CrtMemBlockHeader * pBlockHeaderNext;
        struct _CrtMemBlockHeader * pBlockHeaderPrev;
        char *                      szFileName;
        int                         nLine;
#ifdef _WIN64
        /* These items are reversed on Win64 to eliminate gaps in the struct
         * and ensure that sizeof(struct)%16 == 0, so 16-byte alignment is
         * maintained in the debug heap.
         */
        int                         nBlockUse;
        size_t                      nDataSize;
#else  /* _WIN64 */
        size_t                      nDataSize;
        int                         nBlockUse;
#endif  /* _WIN64 */
        long                        lRequest;
        unsigned char               gap[nNoMansLandSize];
        /* followed by:
         *  unsigned char           data[nDataSize];
         *  unsigned char           anotherGap[nNoMansLandSize];
         */
} _CrtMemBlockHeader;

, int, 4 "NoMansLand". , 64- int sizeof(_CrtMemBlockHeader)+sizeof(int)+4= 48+4+4= 56.

, , ( _CrtMemBlockHeader ), :

+       4 (      4 -      0)      1 allocs  BackTrace2
+       1 (      1 -      0)    BackTrace2  allocations
+4
+2

All Articles