Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的应用程序占用内存,但不会泄漏它。在分析过程中,我发现大部分分配的内存来自getc并fprintf调用谁做malloc(16kb)。不知道那些函数是在堆上分配内存的?特别是fprintf?我怎样才能释放它?
getc
fprintf
malloc
在关闭流之前,我忘记在流上调用 fflush ......(结果我的设置不允许 fflush 流,因为它们仍然被取消的线程阻塞......)。谢谢你的帮助!