I am experimenting with how memory is allocated on the heap. It appears, when I do malloc back to back, the first one returns an address in one page, and the second one returns an address in another page(4096 bytes page size). I was expecting( most likely incorrectly) that it will be in the same page, but would be separated by the allocation table data. Does every malloc goes and fetch addresses from different pages?
int i, j;
int * firstArray = malloc(sizeof(int)*20);
int *secondArray = malloc(sizeof(int)*10);
for( j = 0; j < 5; j++)
secondArray[j] = 11;
for( i = 0; i < 25; i++)
firstArray[i] = 10;