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: immediate strings #2 Date: Wed, 30 Nov 2011 01:35:05 -0800 Organization: UCLA Computer Science Department Message-ID: <4ED5F8C9.7060703@cs.ucla.edu> References: <4ED35057.8010103@yandex.ru> <4ED4089C.3050203@cs.ucla.edu> <4ED49CC9.6080808@cs.ucla.edu> <4ED5C0FD.8030301@yandex.ru> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1322645730 1843 80.91.229.12 (30 Nov 2011 09:35:30 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 30 Nov 2011 09:35:30 +0000 (UTC) Cc: emacs-devel@gnu.org To: Dmitry Antipov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Nov 30 10:35:25 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RVgZX-0008VS-JX for ged-emacs-devel@m.gmane.org; Wed, 30 Nov 2011 10:35:23 +0100 Original-Received: from localhost ([::1]:44638 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RVgZW-0007DY-SW for ged-emacs-devel@m.gmane.org; Wed, 30 Nov 2011 04:35:22 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:51021) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RVgZQ-0007DR-R3 for emacs-devel@gnu.org; Wed, 30 Nov 2011 04:35:20 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RVgZP-0007SI-8Q for emacs-devel@gnu.org; Wed, 30 Nov 2011 04:35:16 -0500 Original-Received: from smtp.cs.ucla.edu ([131.179.128.62]:32793) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RVgZP-0007N3-3D for emacs-devel@gnu.org; Wed, 30 Nov 2011 04:35:15 -0500 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 562C139E800A; Wed, 30 Nov 2011 01:35:05 -0800 (PST) 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 Q1SxzgTim4za; Wed, 30 Nov 2011 01:35:05 -0800 (PST) Original-Received: from [192.168.1.10] (pool-71-189-109-235.lsanca.fios.verizon.net [71.189.109.235]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 0384139E8006; Wed, 30 Nov 2011 01:35:04 -0800 (PST) User-Agent: Mozilla/5.0 (X11; Linux i686; rv:8.0) Gecko/20111124 Thunderbird/8.0 In-Reply-To: <4ED5C0FD.8030301@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:146359 Archived-At: On 11/29/11 21:37, Dmitry Antipov wrote: > It looks like I miss the point. For an immediate strings, we need > two extra bits - 1 for GC, 1 for string subtype, so the question is > simple: where to get them if both size and size_byte are ptrdiff_t? You can get 1 bit from 'size' since it's always nonnegative. You can get the other bit from 'size_byte' if you change it so that it's always nonnegative. This can be done by using 0 rather than -1 as its special value indicating that it is unibyte and the actual byte size is given in 'size'.