From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Antipov Newsgroups: gmane.emacs.devel Subject: Re: Redundant type checking in window.c and w32menu.c Date: Thu, 21 Jun 2007 19:46:32 +0400 Message-ID: <467A9D58.1030309@yandex.ru> References: <4677EBCA.7020405@yandex.ru> <467935CA.9020808@yandex.ru> <467945AF.6010305@gnu.org> <46796A22.000002.16656@pantene.yandex.ru> <46799227.3070905@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1182441006 22106 80.91.229.12 (21 Jun 2007 15:50:06 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 21 Jun 2007 15:50:06 +0000 (UTC) Cc: raeburn@gnu.org, emacs-devel@gnu.org To: Jason Rumney Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jun 21 17:50:03 2007 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.50) id 1I1Ouw-0005fh-UX for ged-emacs-devel@m.gmane.org; Thu, 21 Jun 2007 17:49:59 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I1Ouu-0001e6-Ta for ged-emacs-devel@m.gmane.org; Thu, 21 Jun 2007 11:49:52 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1I1Our-0001e1-Mj for emacs-devel@gnu.org; Thu, 21 Jun 2007 11:49:49 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1I1Ouo-0001cw-5S for emacs-devel@gnu.org; Thu, 21 Jun 2007 11:49:49 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I1Ouo-0001ct-0s for emacs-devel@gnu.org; Thu, 21 Jun 2007 11:49:46 -0400 Original-Received: from smtp3.yandex.ru ([213.180.200.14]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1I1Ou7-0005B3-6L; Thu, 21 Jun 2007 11:49:09 -0400 Original-Received: from rtsoft2.corbina.net ([85.21.88.2]:49036 "EHLO [192.168.1.172]" smtp-auth: "dmantipov" TLS-CIPHER: TLS-PEER-CN1: ) by mail.yandex.ru with ESMTP id S4747362AbXFUPsb (ORCPT + 2 others); Thu, 21 Jun 2007 19:48:31 +0400 X-Comment: RFC 2476 MSA function at smtp3.yandex.ru logged sender identity as: dmantipov User-Agent: Thunderbird 1.5.0.7 (X11/20061008) In-Reply-To: <46799227.3070905@gnu.org> X-detected-kernel: Linux 2.6 (newer, 1) 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:73528 Archived-At: Jason Rumney wrote: > dmantipov wrote: >> Jason Rumney wrote >>> Dmitry Antipov wrote: >>> >>> >>>> +#define Fcar(c) _FCAR (c) >>>> +#define Fcar_safe(c) _FCAR_SAFE (c) >>>> +#define Fcdr(c) _FCDR (c) >>>> +#define Fcdr_safe(c) _FCDR_SAFE (c) >>>> >>> How does lisp code then call these C macros? >>> >> It will call original functions which are preserved in data.c. Lisp code calls them via pointers, so we definitely need to preserve an addressable versions. >> > > > Is this optimisation really worth the confusion of having two versions > of these functions in the code? YMMV :-) - since these functions has the only arg, we shouldn't loose too much on passing an arguments and performing the call. Probably this also depends on compiler options passed and even from the compiler's version. Another interesting thing to try (probably x86 only) is to use __attribute__((regparm (1))) and see what happens... Dmitry