From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Lisp object that refers to a C struct Date: Wed, 17 Oct 2012 09:34:40 -0400 Message-ID: References: <83ehkz4edw.fsf@gnu.org> <83bog33wdr.fsf@gnu.org> <837gqq49j7.fsf@gnu.org> <83r4ox3frd.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1350480903 24963 80.91.229.3 (17 Oct 2012 13:35:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 17 Oct 2012 13:35:03 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Oct 17 15:35:08 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TOTm4-0003LX-Jc for ged-emacs-devel@m.gmane.org; Wed, 17 Oct 2012 15:35:04 +0200 Original-Received: from localhost ([::1]:58428 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOTlx-0007qJ-Jg for ged-emacs-devel@m.gmane.org; Wed, 17 Oct 2012 09:34:57 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:40591) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOTlq-0007ou-6H for emacs-devel@gnu.org; Wed, 17 Oct 2012 09:34:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TOTlk-00082j-HM for emacs-devel@gnu.org; Wed, 17 Oct 2012 09:34:50 -0400 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]:52395) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOTlk-00082c-DR; Wed, 17 Oct 2012 09:34:44 -0400 Original-Received: from fmsmemgm.homelinux.net (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id q9HDYg9J028426; Wed, 17 Oct 2012 09:34:42 -0400 Original-Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id 8431CAE5BE; Wed, 17 Oct 2012 09:34:41 -0400 (EDT) In-Reply-To: <83r4ox3frd.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 17 Oct 2012 06:05:10 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV4373=0 X-NAI-Spam-Version: 2.2.0.9309 : core <4373> : streams <840124> : uri <1245333> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.20 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:154380 Archived-At: >> 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