scheme-api: Store a TOPLEVEL pointer in OBJECT smobs.
When an OBJECT smob is created in Scheme code, and then goes out of
scope without being added to a component or to a page, we need to be
able to delete the object from the Guile garbage collector. This
deletion occurs in a smob free function.
To delete an OBJECT, we need to call s_object_delete(), which requires
an additional TOPLEVEL argument. Previously, we have obtained a
TOPLEVEL by using edascm_c_current_toplevel(). Unfortunately, this
(indirectly) calls scm_fluid_ref(), which is not permitted to be
called from a smob free function; if called in that context, it may
cause a deadlock.
This patch alters OBJECT smobs to be double-length smobs, with the
current TOPLEVEL at the time the smob was created baked into the
second data word. This avoids the need to use
edascm_c_current_toplevel() when garbarge-collecting an OBJECT, but
it's also somewhat hacky. :-(
Closes-bug: lp-909358