home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.compilers      Compiler construction, theory, etc. (Mod      2,753 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 1,578 of 2,753   
   Hans-Peter Diettrich to Chris F Clark   
   Re: Internal Representation of Strings   
   16 Feb 09 11:10:15   
   
   From: DrDiettrich1@aol.com   
      
   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   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca