emacs-devel
[Top][All Lists]
Advanced

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

Re: Lisp object that refers to a C struct


From: Stefan Monnier
Subject: Re: Lisp object that refers to a C struct
Date: Wed, 17 Oct 2012 09:34:40 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux)

>> What happens if someone passes you this same integer some time after
>> you've freed the C struct?
> It won't be found in the list of watches, so the command to remove
> that watch will say "Invalid watch descriptor", and Lisp-level code
> will not find the corresponding Lisp data structure.

So the integer doesn't encode the pointer, instead it's an index into
a table of C structs.  Like POSIX file-descriptors.
That would work, of course.


        Stefan



reply via email to

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