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 08:59:35 +0400 Message-ID: <5407F1B7.6090704@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> 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 1409828534 16708 80.91.229.3 (4 Sep 2014 11:02:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 4 Sep 2014 11:02:14 +0000 (UTC) Cc: Emacs development discussions To: Paul Eggert Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Sep 04 07:00:00 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 1XPP9K-0001X9-PL for ged-emacs-devel@m.gmane.org; Thu, 04 Sep 2014 06:59:58 +0200 Original-Received: from localhost ([::1]:48762 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPP9K-0001gI-G8 for ged-emacs-devel@m.gmane.org; Thu, 04 Sep 2014 00:59:58 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34744) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPP99-0001fg-Rg for emacs-devel@gnu.org; Thu, 04 Sep 2014 00:59:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XPP92-0004M8-JQ for emacs-devel@gnu.org; Thu, 04 Sep 2014 00:59:47 -0400 Original-Received: from forward10l.mail.yandex.net ([2a02:6b8:0:1819::a]:51899) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPP92-0004Ly-6I for emacs-devel@gnu.org; Thu, 04 Sep 2014 00:59:40 -0400 Original-Received: from smtp6.mail.yandex.net (smtp6.mail.yandex.net [77.88.61.56]) by forward10l.mail.yandex.net (Yandex) with ESMTP id 5390DBA11E6; Thu, 4 Sep 2014 08:59:37 +0400 (MSK) Original-Received: from smtp6.mail.yandex.net (localhost [127.0.0.1]) by smtp6.mail.yandex.net (Yandex) with ESMTP id E4D7D16418F0; Thu, 4 Sep 2014 08:59:36 +0400 (MSK) Original-Received: from unknown (unknown [37.139.80.10]) by smtp6.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id fkHx7MKxX7-xaFunBoQ; Thu, 4 Sep 2014 08:59:36 +0400 (using TLSv1.2 with cipher AES128-SHA (128/128 bits)) (Client certificate not present) X-Yandex-Uniq: ff3b1a8a-e395-4a1c-a037-82ab21eec288 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1409806776; bh=PQ4Dxb5F5MNtm5S+oaB3DRWvP7gxFpHwuRMmV1GzUrc=; h=Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject: References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=qZpPRTDsuXWO9j9j30fP5ePkBgP8SngoW6MrsfzxCTRnmLBZEVNuY8xh2t4W53l40 5JsWaINTDGhj6FB1S4nJnBNjdY1mncXhD6t0fxwrnUrEbjZQecDwQXH/VdQWOP0OfH 8JWaSKLUPrp7KHQc+1+Lo8pQJhwlmIB3KgNdjzbI= Authentication-Results: smtp6.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: <540744F5.2010804@cs.ucla.edu> 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:174000 On 09/03/2014 08:42 PM, Paul Eggert wrote: > For GCC, we can define struct Lisp_Cons via 'struct __attribute__ ((aligned (GCALIGNMENT))) Lisp_Cons { ... };'. > For compilers that don't support this syntax we can align the struct by hand, by using a character-array compound > literal that's a bit too large, aligning the resulting pointer by hand, and then using the aligned pointer. Yes, that seems to work: Lisp_Object obj; struct Lisp_Cons *c = ((struct Lisp_Cons *) (((uintptr_t) (char [2 * sizeof (struct Lisp_Cons) - 1]) {} + (GCALIGNMENT - 1)) & ~(GCALIGNMENT - 1))); c->car = Qnil; c->u.cdr = Qnil; XSETCONS (obj, c); But I don't see how to fold this snippet into a macro which can be used as an rvalue, just like: Lisp_Object obj = scoped_cons (Qnil, Qnil); Dmitry