zoukankan      html  css  js  c++  java
  • New Garbage Collector http://wiki.luajit.org/New-Garbage-Collector

    New Garbage Collector http://wiki.luajit.org/New-Garbage-Collector

    GC Algorithms

    This is a short overview of the different GC algorithms used in Lua 5.x and LuaJIT 1.x/2.0 as well as the proposed new GC in LuaJIT 3.0.

    All of these implementations use a tracing garbage collector (#) with two basic phases:

    • The mark phase starts at the GC roots (e.g. the main thread) and iteratively marks all reachable (live) objects. Any objects that remain are considered unreachable, i.e. dead.
    • The sweep phase frees all unreachable (dead) objects.

    Any practical GC implementation has a couple more phases (e.g. an atomic phase), but this is not relevant to the following discussion. To avoid a recursive algorithm, a mark stack or mark list can be used to keep track of objects that need to be traversed.

    Note that most of the following is just describing well-established techniques. Please refer to the literature on garbage collection for details.

    (#) 'Tracing' in this context means it's tracing through the live object graph, as opposed to a reference counting garbage collector, which manages reference counts for each object. The terminology is not related to the concept of a trace compiler.

  • 相关阅读:
    几种常见sqlalchemy查询:
    Python error: Unable to find vcvarsall.bat
    ES5中的数组方法
    JQuery的API
    异步加载中按需加载的代码
    js和jQuery中ajax的重要步骤
    编写一个JavaScript函数,把URL参数解析为一个对象
    弹性盒子的用法
    js实现飞机大战小游戏
    H5中的canvas完成动态时钟
  • 原文地址:https://www.cnblogs.com/rsapaper/p/10173510.html
Copyright © 2011-2022 走看看