Why free() doesn't really frees memory?
问题 i'm doing some tests allocating and deallocating memory. This is the code i'm using: #include <stdlib.h> #include <stdio.h> #define WAVE_SIZE 100000000 int main(int argc,char* argv[]){ int i; int **p; printf("%d allocs...\n",WAVE_SIZE); // Malloc printf("Allocating memory...\n"); p = (int**)malloc(WAVE_SIZE*sizeof(int*)); for(i = 0;i < WAVE_SIZE;i++) p[i] = (int*)malloc(sizeof(int)); // Break printf("Press a key to continue...\n"); scanf("%*s"); // Dealloc printf("Deallocating memory...\n");