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 13:44:25 -0800 Organization: UCLA Computer Science Department Message-ID: <4ED6A3B9.4060301@cs.ucla.edu> References: <4ED35057.8010103@yandex.ru> <4ED4089C.3050203@cs.ucla.edu> <4ED49CC9.6080808@cs.ucla.edu> <4ED5C0FD.8030301@yandex.ru> <4ED5F8C9.7060703@cs.ucla.edu> <75F68EF4-5C72-4A02-8DE4-1B699576A6B3@raeburn.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1322689481 10824 80.91.229.12 (30 Nov 2011 21:44:41 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 30 Nov 2011 21:44:41 +0000 (UTC) Cc: Dmitry Antipov , emacs-devel@gnu.org To: Ken Raeburn Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Nov 30 22:44:33 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 1RVrxB-0001KG-RL for ged-emacs-devel@m.gmane.org; Wed, 30 Nov 2011 22:44:33 +0100 Original-Received: from localhost ([::1]:57342 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RVrxB-0002oK-Ee for ged-emacs-devel@m.gmane.org; Wed, 30 Nov 2011 16:44:33 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:52300) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RVrx9-0002nv-0v for emacs-devel@gnu.org; Wed, 30 Nov 2011 16:44:32 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RVrx7-0007sQ-OS for emacs-devel@gnu.org; Wed, 30 Nov 2011 16:44:30 -0500 Original-Received: from smtp.cs.ucla.edu ([131.179.128.62]:34415) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RVrx7-0007sC-Gc for emacs-devel@gnu.org; Wed, 30 Nov 2011 16:44:29 -0500 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id E25B839E800B; Wed, 30 Nov 2011 13:44:26 -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 W6Jhukt0xOy2; Wed, 30 Nov 2011 13:44:26 -0800 (PST) Original-Received: from penguin.cs.ucla.edu (Penguin.CS.UCLA.EDU [131.179.64.200]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 8B55F39E800A; Wed, 30 Nov 2011 13:44:26 -0800 (PST) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20111115 Thunderbird/8.0 In-Reply-To: <75F68EF4-5C72-4A02-8DE4-1B699576A6B3@raeburn.org> 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:146371 Archived-At: On 11/30/11 08:43, Ken Raeburn wrote: > Currently it appears that we can have both unibyte and multibyte zero-length strings Thanks good point. There are other possibilities. We can use PTRDIFF_MAX, not -1, as the special value indicating that the string is unibyte. Or we could have size_byte count the trailing null, and use 0 as the special value; that might be more efficient. Or we could use a special marker in the immediate data (after the trailing null), used only with empty strings, to specify whether the empty string is multibyte. I'm sure there are other ways to do it -- the point is that we need not arbitrarily restrict strings to half their size merely to get one special size value.