|
Where is the release version of the allocated block management information such as the block size after allocating memory to a pointer?
Recently, when I deeply analyzed the C ++ problem, I encountered a problem that could not be solved. That is, the use of heap management after C ++ program compilation is not the same as the Debug version. The Debug version is easy to understand, but how does the Release version manage it? The Debug version stores a double linked list structure in the first 32 bytes of the memory block. One member of this structure is the size of the memory block. But where is the Release version? Run the following version of the Release version of the program without knowing what it is? Which prawn can confuse me?
main ()
{
int * pInt = new int [2];
for (int i = 1; i <= 8; i ++)
{
printf ("% x\n", * (pInt-i)); // Print out the first 32 bytes of memory in Pint
}
. . . . .
. . . . .
}
Debug version shows the result is
fdfdfdfd
33
1
8 // Memory block size
0
0
372a80 // Next block address
3729f0 // Previous block address
But the Release version is executed like this
180764
230004
0
0
abababab
abababab
baad0a00
ffffffff
The memory block size is not there at all, where will it be stored? Still do not need to record? How to collect it when released without recording?
What is in the first 32 bytes of Pint? |
|