[Top][All Lists]

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

Re: Lisp object that refers to a C struct

From: Eli Zaretskii
Subject: Re: Lisp object that refers to a C struct
Date: Thu, 18 Oct 2012 13:17:50 +0200

> From: Juanma Barranquero <address@hidden>
> Date: Thu, 18 Oct 2012 10:52:21 +0200
> Cc: Paul Eggert <address@hidden>, address@hidden
> On Thu, Oct 18, 2012 at 6:50 AM, Eli Zaretskii <address@hidden> wrote:
> > No, because, like Stephen  says, the descriptor is first validated
> > against a list of known ones.
> In that case, wouldn't it be better to have the integer be an index
> into a table, like Stefan suggested?

It's easy to do that (of course, at a price of some slightly more
complicated memory management), but I think Stefan still prefers the
"new object" solution.

> It's faster to check that it is in range than compare it with an
> arbitrarily long list of known pointers.

That's not what the code does.  It calls Fassoc_quit to find the
descriptor in the list of known live watches (which will still be
needed under the table suggestion), and then validates the pointer
itself, just in case (which is also independent of the table

reply via email to

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