Q: Reference counting

John Duncan jddst19+ at pitt.edu
Tue Oct 26 05:14:38 UTC 1999


Hi all,

Is there a good, well-known way to do reference counting? I was
thinking that, in the case of the use of many different languages and
support for many encodings, information about character rendering such
as bitmaps, glyph data, et al ought to be reference-counted to provide
good space efficiency. I realize that this can often be done simply
using the garbage collector, but can it always be done in that way? In
other respects, it may be a good idea for things to persist until
there is a good reason to replace them, not simply to do away with
them at the GC's leisure. Hypothetically, if a dictionary were used to
store char data then in a hash collision, a slot that has a zero
refcount could be replaced. If a regular dictionary were used, that
wouldn't happen, and if a weak style dictionary were used, it wouldn't
happen predictably.

Am I looking at this situation wrong? To quickly defray any space
anti-concerns, consider this quantity: Chinese*TTGlyphCount*renderings
is a very large number. It takes too much time to rerender for every
character every time, but it takes too much space to keep all
historical information in the image. Also, if these things start
getting rendered at 600x600dpi, they become enormous.

-John

--
"In any event, once Robert Craft forged the Stravinsky-Schoenberg axis
in the 1950s and the eclecticism of the 1960s alleviated the austere
serialism of the previous decade, the futures market in Hindemithian
repose was struck by panic selling."
                                  -Glenn Gould





More information about the Squeak-dev mailing list