The heap consists of blocks. But how do these blocks occur???? Can u explain? thank u) | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

The heap consists of blocks. But how do these blocks occur???? Can u explain? thank u)

it is strictly based on data alignment???

13th May 2020, 12:03 PM
Jai
Jai - avatar
1 Answer
+ 3
I think it depends on the CPU architecture. On a 64 bit machine the memory allocation would be in chunks of 8 bytes. Padding definitely comes into picture and the processor would definitely like to fetch the values in a single cycle hence even an integer value of 4 bytes will have padding of another 4 bytes and gets stored in the memory.
13th May 2020, 12:44 PM
Avinesh
Avinesh - avatar