Paper

Reference Counting in Library Design -- Optionally and with Union-Find Optimization. Lutz Kettner. Proceedings of the First International Workshop on Library Centric Software Design (LCSD'05), October 2005, San Diego, CA. Rensselaer Polytechnic Institute, Computer Science Department, Technical Report 06-12, pp. 34-43, 2006.

Abstract

Reference counting has been used and described in abundance. We present novel ideas aimed at class implementations in library design: (1) In library design, generic classes can have variable size, such that an optimal decision for or against reference counting is not possible. We postpone this decision to the place of class use. (2) In a context, where equality comparison for the case of equality is expensive, e.g., for exact algebraic number representations, we unify representations whenever equality is detected, thus effectively memoizing equality tests. We explain an efficient implementation based on an union-find data structure. (3) Reference counting and polymorphic class hierarchies can be combined reusing the pointer in the handle class for the polymorphism. A policy-based generic C++ solution realizes all ideas. Standard allocators manage all dynamic memory.

[PDF]
[PostScript]


Lutz Kettner (<surname>@mpi-inf.mpg.de). Last modified on Sunday, 14-Jan-2007 22:32:11 MET.