guile-devel
[Top][All Lists]
Advanced

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

The “finalized” SMOB type


From: Ludovic Courtès
Subject: The “finalized” SMOB type
Date: Sat, 08 Oct 2016 23:07:37 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)

Hello,

Commit 8dff3af087c6eaa83ae0d72aa8b22aef5c65d65d (introduced in 2.0.12)
changes the type of SMOBs to the “finalized” type just before calling
the SMOB’s free function.

This doesn’t play well with free functions that up to now assumed they
would be getting a SMOB of the type they handle.  One of Guile-SSH’s
free functions goes like this:

--8<---------------cut here---------------start------------->8---
size_t
free_session (SCM session_smob)
{
  struct session_data *data = _scm_to_session_data (session_smob);

  [...]

  return 0;
}
--8<---------------cut here---------------end--------------->8---

… where ‘_scm_to_session_data’ raises a wrong-type-arg error if its
argument is not a session SMOB.  With 2.0.12, this exception is
systematically triggered.

I don’t have a good solution to this and I think Guile-SSH will have to
work around it anyway, but I think this situation is not uncommon.

Thoughts?

Ludo’.



reply via email to

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