From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.devel Subject: Re: Proposal: immediate strings Date: Thu, 31 May 2012 09:34:53 -0700 Organization: UCLA Computer Science Department Message-ID: <4FC79DAD.5040904@cs.ucla.edu> References: <4FBB51E7.6080601@yandex.ru> <4FC472E6.5020005@yandex.ru> <4FC47CE1.6050901@cs.ucla.edu> <4FC4D025.9020608@yandex.ru> <4FC4EA10.702@cs.ucla.edu> <4FC739B4.30408@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1338482116 13309 80.91.229.3 (31 May 2012 16:35:16 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 31 May 2012 16:35:16 +0000 (UTC) Cc: Stefan Monnier , emacs-devel@gnu.org To: Dmitry Antipov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu May 31 18:35:14 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 1Sa8L8-00031Q-1t for ged-emacs-devel@m.gmane.org; Thu, 31 May 2012 18:35:10 +0200 Original-Received: from localhost ([::1]:33975 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sa8L7-0002Lh-Fw for ged-emacs-devel@m.gmane.org; Thu, 31 May 2012 12:35:09 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:51573) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sa8L0-0002HN-Lv for emacs-devel@gnu.org; Thu, 31 May 2012 12:35:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sa8Kv-0005XX-Mk for emacs-devel@gnu.org; Thu, 31 May 2012 12:35:02 -0400 Original-Received: from smtp.cs.ucla.edu ([131.179.128.62]:45187) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sa8Kv-0005XL-Gp for emacs-devel@gnu.org; Thu, 31 May 2012 12:34:57 -0400 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 4476FA60002; Thu, 31 May 2012 09:34:54 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Original-Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id uBe8yNGmik96; Thu, 31 May 2012 09:34:53 -0700 (PDT) Original-Received: from penguin.cs.ucla.edu (Penguin.CS.UCLA.EDU [131.179.64.200]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 8C3EBA60001; Thu, 31 May 2012 09:34:53 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1 In-Reply-To: <4FC739B4.30408@yandex.ru> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 131.179.128.62 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:150697 Archived-At: On 05/31/2012 02:28 AM, Dmitry Antipov wrote: > IIUC this is the only possible layout which: 1) uses bitfields 2) not requires > __attribute__((packed)) and 3) provides 16-bytes Lisp_String with 10 bytes > for immediate data on 32-bit and 32-bytes Lisp_String with 22 bytes > for immediate data on 64-bit. Ah, sorry, I misunderstood 's proposal. I thought that it grew struct Lisp_String. Part of my misunderstanding was due to that the code confuses 'unsigned long' with 'ptrdiff_t'. The two types need not be the same width. The code should use 'sizeof (ptrdiff_t)' where it currently uses 'sizeof (unsigned long)', and we need a BITS_PER_PTRDIFF_T enum to size the fields correctly. What are the performance results for this version?