首页    期刊浏览 2024年12月01日 星期日
登录注册

文章基本信息

  • 标题:Eliminating Cycles in Weak Tables
  • 本地全文:下载
  • 作者:A. Barros, R. Ierusalimschy
  • 期刊名称:Journal of Universal Computer Science
  • 印刷版ISSN:0948-6968
  • 出版年度:2008
  • 卷号:14
  • 期号:21
  • 出版社:Graz University of Technology and Know-Center
  • 摘要:

    Weak References constitute an elegant mechanism for an application to interact with its garbage collector. In most of its typical uses, weak references are used through weak tables (e.g., Java's WeakHashMap ). However, most implementations of weak tables have a severe limitation: Cyclic references between keys and values in weak tables prevent the elements inside a cycle from being collected, even if they are no longer reachable from outside. This ends up bringing difficulties to the use of weak tables in some kinds of applications.

    In this work, we present our approach for overcoming this problem in the context of the Lua programming language. Our approach consists of an adaptation of the ephemerons mechanism to tables. We modified the garbage collector of the Lua virtual machine in order to offer support to this mechanism. With this adapted garbage collector we could verify the efficiency and effectiveness of the implementation in solving the problem of cycles on weak tables in Lua.

  • 关键词:Garbage collection, weak references, weak tables
国家哲学社会科学文献中心版权所有