garbage-collect icon indicating copy to clipboard operation
garbage-collect copied to clipboard

garbage collector algorithm 垃圾回收算法的系列实现

gc-learning

GitHub GitHub code size in bytes

垃圾回收算法的分析与实现,基于c实现各系列gc docs:分析文档

在编程语言中引入gc的例子:tu-lang

> dos2unix auto_test.sh
> sh auto_test.sh

@demo

#include "gc.h"

Obj* p = gc_malloc(sizeof(Obj));
// don't need care the `free`,let it go

@analysis

  • [x] python的gc实现
  • [x] golang的gc实现
    • [x] 内存分配
    • [x] 标记+清除
    • [ ] 并发gc实现
  • [ ] 实现一个可生产应用的gc

@mark-sweep

  • [x] 标记清除算法-基础实现
  • [x] 标记清除算法-多链表法实现
  • [x] 标记清除算法-位图式

@reference-count

  • [x] 引用计数算法

@copying

  • [x] 复制算法-基础实现
  • [x] 复制算法+标记清除-组合应用实现

@compact

  • [x] 压缩算法-lisp2算法
  • [x] 压缩算法-two_finger

@generational

  • [x] 分代算法-复制+标记清除

@incremental

  • [x] 增量式算法-三色标记