On 2020/04/13 20:26:10, dak wrote: > On 2020/04/13 20:21:29, dak wrote: > > > > https://codereview.appspot.com/575990043/diff/577740043/lily/mutable-properties.cc#newcode109 > > lily/mutable-properties.cc:109: Mutable_properties::mark () const > > This can segfault in GUILEv2 and/or depending on some other circumstances > since > > the C++ members are only getting initialized after the GC hook is already > > operative. > > > > You need to sort the C++ structures potentially accessed by the GC hook into a > > Preinit class (grep for Preinit for existing uses) and inherit from that > before > > inheriting from whatever operates the Smob. Then C++ guarantees an > > initialisation order consistent with GC hook operation. > > Actually, a less involved implementation where the value cell is SCM is to just > use a Scheme vector. That also significantly speeds up garbage collection > relying on mark hooks because then only a single scm_gc_mark call is made and > Guile does the rest internally.
I actually wanted to start that working on that, but I was happy with the numbers. Now that the numbers turned out to be bogus, I want to dig in deeper into measurements. I want to run lilypond through cachegrind to understand better what is happening. In my mind, this code should be strictly better than the alist-based solution, but that is not borne out by timing. https://codereview.appspot.com/575990043/