guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mark procedures and LilyPond


From: Stefan Monnier
Subject: Re: Mark procedures and LilyPond
Date: Fri, 06 Nov 2015 10:05:40 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

>                    __________                    __________
>   Objects in      |          |                  |          |
>   GC-managed      |  SMOB 1  |                  |  SMOB 2  |
>      heap         |__________|                  |__________|
>                      |   ^                         |   ^
> .....................|...|.........................|...|..........
>                    __v___|___      _________     __v___|___
>   Objects in      |          |    |   STL   |   |          |
>   normal heap     |C++ object|--->|container|-->|C++ object|
>   (not scanned    |__________|    |_________|   |__________|
>      by GC)


> The SMOB finalizers free the associated C++ objects below them.  Now,
> suppose that none of the objects above are reachable, so both SMOBs are
> queued for finalization.  Now suppose that SMOB 2 is finalized first,
> thus freeing the C++ object below it.

It's clearly wrong for SMOB2's finalizer to free its C++ object here
since that object is still reachable from C++ objects.


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]