How big a heap frame is in Visual C ++

In Visual C ++, if I use new to create an object on the heap, how much extra space is there for the header and fill the heap frame, in particular in the release code? I expected the int to tell how much space was available in the block, and another, perhaps to say how much of this space was currently used, and frame sizes rounded to the nearest 32 or 64 bits based on the architecture. It’s just interesting if VC ++ adds anything superfluous, like protective bytes, flags, etc ... and frame sizes are rounded to a larger minimum size. In other words, for large amounts of data it is inefficient to use a large number of small blocks of data on the heap.

+4
source share
1 answer

Hackety Hack:

int* p = new int; int* q = new int; std::cout << (char*)q - (char*)p << std::endl; 

Yes, I know, technically undefined behavior, but I think it should answer the question :)

+6
source

All Articles