On Wed, Aug 2, 2017 at 7:37 AM, Enrico Weigelt, metux IT consult <enrico.weig...@gr13.net> wrote: > On 31.07.2017 13:53, smaug wrote: >> Reference counting is needed always if both JS and C++ can have a >> pointer to the object. > > Anybody already thought about garbage collection ?
Reference counting is a garbage collection technique. See https://en.wikipedia.org/wiki/Reference_counting where the introductory paragraphs and the first section specifically refer to it as a garbage collection technique. Or consult _The Garbage Collection Handbook_ by Jones, Hosking, and Moss, which has an entire chapter devoted to reference counting. Note also that Gecko's reference counting tends to be cheaper than the reference counting assumed in the literature, since many of Gecko's reference-counted objects can use non-thread-safe reference counting, as said objects are only ever accessed on a single thread. (Compare http://robert.ocallahan.org/2012/06/computer-science-in-beijing.html) Changing the garbage collection technique used by our C++ code to something other than reference counting would be a large project of dubious worth. -Nathan _______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform