摘要
C语言没有运行时库,无法自动压缩使用中的内存,缩小堆栈所需内存空间。若只申请内存,没有释放,势必造成系统内存不断减少、丢失。长时间的运行,最终导致系统死机。文章阐述了C语言垃圾产生的原因,并从引用计数、标记—清除算法两方面提出如何实现C语言的垃圾回收。
C Language don't have runtime library, can't use the memory automatically compressed, narrowing the stack memory space required. If only for memory, no release, is bound to cause system memory decline and lost. The long time running eventually lead to system crash. The article expounds the cause of C Language trash, and from reference counting and mark-sweep algorithm is put forward how to realize theC Language trash recycling.
出处
《无线互联科技》
2015年第20期90-91,118,共3页
Wireless Internet Technology
关键词
C语言
垃圾回收
引用计数
标记—清除算法
C Language: trash recycling: reference counting: mark-sweep algorithm