使用valgrind我运行以下代码:
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char** argv){
printf("Hello World!");
return EXIT_SUCCESS;
}
valgrind输出是:
HEAP SUMMARY:
==22613== in use at exit: 0 bytes in 0 blocks
==22613== total heap usage: 1 allocs, 1 frees, 1,024 bytes allocated
为什么printf语句在堆上分配1,024个字节?