Re: Privilege-escalation attacks on NT-based Windows are unfixable

From: Leythos (void@nowhere.com)
Date: 08/25/02


From: Leythos <void@nowhere.com>
Date: Sun, 25 Aug 2002 12:16:52 GMT

In article <akaaui$1ghq87$1@ID-124507.news.dfncis.de>,
toreld@netscape.net says...
> Edward Elliott wrote:
> > Tore Lund wrote:
> >> Would someone care to indicate when we would such "horribly inefficient"
> >> copying? I can only guess that this hints at a type of usage that
> >> differs considerably from what I am doing.
> >
> > If length = capacity by design, then every time you change the length of
> > a string you must allocate a new memory block to hold it. The string
> > "hello" would be stored as 5-h-e-l-l-o in your example. If I want to
> > append " world", I have to allocate a new string to hold the result:
> > 11-h-e-l-l-o-w-o-r-l-d. As string concatenation is a very common
> > operation, this approach seems horribly inefficient.
> >
> > If you track both the length and capacity, I can put "hello" in a
> > 20-byte buffer and have 20-5-h-e-l-l-o (or 20-h-e-l-l-o-\0). Then when
> > I want to append " world", there's enough room to do it without
> > allocating a new buffer and copying both strings:
> > 20-11-h-e-l-l-o-_-w-o-r-l-d (or 20-h-e-l-l-o-_-w-o-r-l-d-\0).

Guys, that's whey in early languages the buffer for a string was 255
bytes. In most languages you specify the size of every data type, or
it's already defined for you. It doesn't matter what language, it's
about the same in all of them if you really look close.

-- 
--
Leythos999@columbus.rr.com
(Remove 999 to reply to me)



Relevant Pages

  • Re: Ada Shootout program for K-Nucleotide (patches)
    ... the end of the buffer (easily verified, ... Result'Length without copying: ... function S return String is ... An Ada string is not a C string, you would need to put the ...
    (comp.lang.ada)
  • Re: Ada Shootout program for K-Nucleotide (patches)
    ... the end of the buffer (easily verified, ... 10 times, the copying will happen 1/10 of the time, but execution time ... The idea of using a storage pool is an interesting one, ... But how would you overlay the string on top of the read ...
    (comp.lang.ada)
  • Re: Privilege-escalation attacks on NT-based Windows are unfixable
    ... >> a string you must allocate a new memory block to hold it. ... >> allocating a new buffer and copying both strings: ... that's whey in early languages the buffer for a string was 255 ...
    (comp.security.misc)
  • Re: String and StringBuilder
    ... There is a break even point when it is passed the string may actually be ... slightly faster than the stringbuilder (these are generally very small ... the string builder continues using the same buffer. ... For copying of memory the string example is basically copying the data ...
    (microsoft.public.dotnet.languages.csharp)
  • whats OOPs jargons and complexities?
    ... in advanced languages such as LISP family, it is not uncommon to define ... subroutine f1 ... For example, in Java, a string is a class String. ...
    (comp.lang.perl.misc)

Quantcast