On 2020/02/03 18:13:00, hahnjo wrote: > On 2020/02/03 18:01:09, dak wrote: > > Stupid question: unique_ptr has the purpose of deallocating memory when the > last > > reference is gone. But we have an entire Scheme allocation system exactly for > > that purpose for which we are already paying the price in overhead. Any > chance > > this can be usefully tracked in the SCM scheme of things? > > Why would we want to use GC more than needed? Any marking algorithm will always > be slower than a local variable going out of scope.
unique_ptr has bookkeeping overhead. The marking algorithm runs anyway and has no memory overhead. I have not looked at the actual patch yet, but unique_ptr really is doing pretty much the same job as SCM except that it acts with no delay, so if it is important that the destructors are called right away when the last reference is gone, SCM will not do the job. https://codereview.appspot.com/573500043/