测试内存的free 情况
typedef struct list{
char c;
int i;
char c1;
}list;
struct S_{
char c;
int i;
char c1;
}st1;
struct S_1 {
char c;
char c1;
char c2;
int i;
}st2, *p1;
void freelist(list *listma)
{
free(listma);
if (listma !=NULL)
listma = NULL;
}
void fun(list *listma)
{
printf("yesssssssss\n");
Sleep(4000);
freelist(listma);
}
int main(int argc, char* argv[])
{
list *listma;
listma = (list*)malloc((9000*1024)*sizeof(list)); //申请空间大点, 这样才能看到结果.
//在任务管理器里看CPU
fun(listma);
// free(listma);
// freelist(listma);
return 0;
}