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: Benchmarking temporary Lisp objects [Was: Re: [RFC] temporary Lisp_Strings] Date: Thu, 04 Sep 2014 17:37:30 +0400 Message-ID: <54086B1A.8070506@yandex.ru> References: <5405BE5D.1090003@yandex.ru> <5405DE8B.4050201@yandex.ru> <5406EC21.4060200@yandex.ru> <5407281C.3090302@cs.ucla.edu> <54073621.2040403@yandex.ru> <540744F5.2010804@cs.ucla.edu> <5407F1B7.6090704@yandex.ru> <5407F4E6.2040809@cs.ucla.edu> <5407FDF4.7020504@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1409837902 29599 80.91.229.3 (4 Sep 2014 13:38:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 4 Sep 2014 13:38:22 +0000 (UTC) Cc: Paul Eggert , Emacs development discussions To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Sep 04 15:38:15 2014 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 1XPXEr-0005qp-7d for ged-emacs-devel@m.gmane.org; Thu, 04 Sep 2014 15:38:13 +0200 Original-Received: from localhost ([::1]:51093 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPXEq-0007oF-Oy for ged-emacs-devel@m.gmane.org; Thu, 04 Sep 2014 09:38:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40116) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPXEO-0007mz-NB for emacs-devel@gnu.org; Thu, 04 Sep 2014 09:37:52 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XPXEF-0003t4-Em for emacs-devel@gnu.org; Thu, 04 Sep 2014 09:37:44 -0400 Original-Received: from forward10l.mail.yandex.net ([2a02:6b8:0:1819::a]:56754) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPXEF-0003sp-1V for emacs-devel@gnu.org; Thu, 04 Sep 2014 09:37:35 -0400 Original-Received: from smtp2h.mail.yandex.net (smtp2h.mail.yandex.net [84.201.187.145]) by forward10l.mail.yandex.net (Yandex) with ESMTP id E6E19BA1248; Thu, 4 Sep 2014 17:37:32 +0400 (MSK) Original-Received: from smtp2h.mail.yandex.net (localhost [127.0.0.1]) by smtp2h.mail.yandex.net (Yandex) with ESMTP id 4EC081705760; Thu, 4 Sep 2014 17:37:32 +0400 (MSK) Original-Received: from unknown (unknown [37.139.80.10]) by smtp2h.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id lb5A9reIYb-bV4mpIGQ; Thu, 4 Sep 2014 17:37:31 +0400 (using TLSv1.2 with cipher AES128-SHA (128/128 bits)) (Client certificate not present) X-Yandex-Uniq: 2163fad7-3af0-4413-8956-50a7ff97a235 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1409837851; bh=K+Rw9frg5sNT+BKlZVIGzL6Jc4uxp669kU+RdPozAco=; h=Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject: References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=JrOK34b03EWgXoO4OF7pWBJpl2zB4KgiX5TEA+Iz5voYhNVPbsxQU0q/nsYmSUIL1 HDRwcq6P5OReBmjS0YKvkplDSSBDDPK9EQsAJHLMJRhYtM+RtpUZd6gDKpS3Ymptlo DuqBhRMlf2rgIMtutgZQFDsd2bh3D9ddFUvIOoE4= Authentication-Results: smtp2h.mail.yandex.net; dkim=pass header.i=@yandex.ru User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a02:6b8:0:1819::a 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:174005 Archived-At: On 09/04/2014 05:11 PM, Stefan Monnier wrote: > Let's not worry about this case, we can/should punt to Fcons for them. Thanks to Paul, there is a C99-compilant solution: #if (__GNUC__ || __HP_cc || __HP_aCC || __IBMC__ \ || __IBMCPP__ || __ICC || 0x5110 <= __SUNPRO_C) /* have __attribute__ ((aligned (GCALIGNMENT))) for conses */ #define scoped_cons(car, cdr) \ make_lisp_ptr (&((struct Lisp_Cons) { car, { cdr } }), Lisp_Cons) #else /* another compiler, need an explicit alignment */ INLINE Lisp_Object scoped_cons_init (void *ptr, Lisp_Object x, Lisp_Object y) { struct Lisp_Cons *c = (struct Lisp_Cons *) (((uintptr_t) ptr + (GCALIGNMENT - 1)) & ~(GCALIGNMENT - 1)); c->car = x; c->u.cdr = y; return make_lisp_ptr (c, Lisp_Cons); } #define scoped_cons(car, cdr) \ scoped_cons_init ((char[sizeof (struct Lisp_Cons) \ + (GCALIGNMENT - 1)]) {}, (car), (cdr)) #endif /* compiler selection */