From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ken Raeburn Newsgroups: gmane.emacs.devel Subject: Re: Copying one Lisp_Object to another in C code? Date: Thu, 1 Jul 2010 21:33:55 -0400 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1278034460 20641 80.91.229.12 (2 Jul 2010 01:34:20 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 2 Jul 2010 01:34:20 +0000 (UTC) Cc: emacs-devel@gnu.org To: James Cloos Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 02 03:34:19 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OUV8z-0000Kj-87 for ged-emacs-devel@m.gmane.org; Fri, 02 Jul 2010 03:34:17 +0200 Original-Received: from localhost ([127.0.0.1]:38186 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OUV8y-0002ko-3B for ged-emacs-devel@m.gmane.org; Thu, 01 Jul 2010 21:34:16 -0400 Original-Received: from [140.186.70.92] (port=51890 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OUV8s-0002kj-3b for emacs-devel@gnu.org; Thu, 01 Jul 2010 21:34:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OUV8r-0002nb-50 for emacs-devel@gnu.org; Thu, 01 Jul 2010 21:34:10 -0400 Original-Received: from splat.raeburn.org ([69.25.196.39]:34847 helo=raeburn.org) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OUV8f-0002mc-UV for emacs-devel@gnu.org; Thu, 01 Jul 2010 21:34:09 -0400 Original-Received: from squish.raeburn.org (squish.raeburn.org [10.0.0.172]) by raeburn.org (8.14.3/8.14.1) with ESMTP id o621XuRO018787; Thu, 1 Jul 2010 21:33:56 -0400 (EDT) In-Reply-To: X-Mailer: Apple Mail (2.1081) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:126670 Archived-At: On Jul 1, 2010, at 20:18, James Cloos wrote: > Given: >=20 > static void (foo) > Lisp_Object foo; > { > Lisp_Object bar; > /* etc */ >=20 > is it OK to do: >=20 > bar =3D foo; >=20 > or is there a function or macro one should call? Simple assignments are done all over the place currently. It would take = some drastic reworking if some macro invocation were to become = necessary. > I presume GCPRO1 (foo) is in order either way? Depending on the details of your usage, yes. (If the value is always = stored in other places where the version of the GC system that doesn't = scan the entire stack and register set automatically will be able to = find it, at any of the points where the GC system can be invoked, then = you don't need an explicit GCPRO. But then you have to understand where = the old GC scanner will look, and when it can get invoked.) Just being = conservative about it shouldn't hurt, either. Ken=