[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Proposal: immediate strings

From: Dmitry Antipov
Subject: Re: Proposal: immediate strings
Date: Tue, 29 May 2012 17:33:25 +0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1

On 05/29/2012 11:38 AM, Paul Eggert wrote:

On 05/28/2012 11:55 PM, Dmitry Antipov wrote:
To avoid using 'packed' attribute and speedup an inefficient access to 
field, it's possible to use 'ptrdiff_t X : BITS_PER_PTRDIFF_T - 2'
bitfields - it's still wide enough to hold the values up to STRING_BYTES_BOUND.

That's not true on 32-bit hosts configured --with-wide-int.
On such hosts, a string can contain up to PTRDIFF_MAX - 1 bytes.
This proposal would lower the limit to PTRDIFF_MAX / 4 bytes.
In contrast, the proposal in
would merely lower it to PTRDIFF_MAX - 65536 bytes.

OK, this allows

min (MOST_POSITIVE_FIXNUM, (ptrdiff_t) min (SIZE_MAX, PTRDIFF_MAX - 1) - 1)

in all configurations (so PTRDIFF_MAX - 2 for --with-wide-int), eventually
uses _all_ bits by eliminating signed values.


Attachment: immstr-dev.patch
Description: Text document

reply via email to

[Prev in Thread] Current Thread [Next in Thread]