Re: Internal Representation of Strings

Hans-Peter Diettrich <DrDiettrich1@aol.com>
Mon, 16 Feb 2009 11:10:15 +0100

          From comp.compilers

Related articles
[4 earlier articles]
Re: Internal Representation of Strings marcov@stack.nl (Marco van de Voort) (2009-02-14)
Re: Internal Representation of Strings anton@mips.complang.tuwien.ac.at (2009-02-14)
Re: Internal Representation of Strings cfc@shell01.TheWorld.com (Chris F Clark) (2009-02-14)
Re: Internal Representation of Strings lkrupp@pssw.nospam.com.invalid (Louis Krupp) (2009-02-14)
Re: Internal Representation of Strings cr88192@hotmail.com (cr88192) (2009-02-16)
Re: Internal Representation of Strings tony@my.net (Tony) (2009-02-15)
Re: Internal Representation of Strings DrDiettrich1@aol.com (Hans-Peter Diettrich) (2009-02-16)
Re: Internal Representation of Strings bartc@freeuk.com (Bartc) (2009-02-16)
Re: Internal Representation of Strings wclodius@lost-alamos.pet (2009-02-16)
Re: Internal Representation of Strings ArarghMail902@Arargh.com (2009-02-17)
Re: Internal Representation of Strings bartc@freeuk.com (Bartc) (2009-02-18)
Re: Internal Representation of Strings tony@my.net (Tony) (2009-02-18)
Re: Internal Representation of Strings tony@my.net (Tony) (2009-02-18)
[23 later articles]
| List of all articles for this month |

From: Hans-Peter Diettrich <DrDiettrich1@aol.com>
Newsgroups: comp.compilers
Date: Mon, 16 Feb 2009 11:10:15 +0100
Organization: Compilers Central
References: 09-02-051 09-02-068
Keywords: storage, design
Posted-Date: 17 Feb 2009 15:56:18 EST

Chris F Clark schrieb:


> The idea of having the length at the end of the string (and perhaps
> pointing to that end also) has a certain appeal. You can even follow
> your length field with a max size field to get a good solution for
> mutable strings with lengths (crude monospaced ascii art below).
>
> pointer-------------------V
> |unused-space|chars....|0|length|max-size|
> ..^............^-----------+......|
> ..+-------------------------------+


What's the essential difference vs. having the length and max-size
information *before* the text?


I only can see disadvantages with many common string operations, in
detail with string concatenation or appending characters to such an
string buffer.


DoDi



Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.