|
|
Subscribe / Log in / New account

reference counting

reference counting

Posted Sep 29, 2014 9:52 UTC (Mon) by oldtomas (guest, #72579)
In reply to: Adding strlcpy() to glibc by nybble41
Parent article: Adding strlcpy() to glibc

> Reference counting is a form of garbage collection, and a fairly efficient one so long as cycles are impossible

No, no. This is a widespread misconception. Ref counting looks so simple, but it transforms what could be read-accesses to memory (taking/releasing a reference) into write accesses (incrementing/decrementing ref counters), which messes horribly with memory caches and clever compilers.

So, I'd rather say ref counting may be fairly efficient as long as your reference graph is pretty sparse. Once it becomes dense, you'll become painfully aware of how slow your main memory really is :-)


to post comments


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds