Re: Boost process and C



jacob navia wrote:
Flash Gordon a écrit :

Is an extra byte (or word, or double word) for a flags field really that big an overhead?

Well, I have that extra "Flags" field in the string library of lcc-win32. I have the size as a size_t as you propose, and I need 32 bits for the flags.

The problem is that 32 bits is quite a lot for a few bits info... For programs that use extensively strings, 32 bits multiplied by several thousand small strings can make a big difference in RAM used, specially for the more common short strings.

I see the point of Bstrlib, and it is a very valid design decision.

I've yet to see software where short strings made up a significant portion of the memory footprint and saving the memory that avoiding the flags would be of real use. Of course, such applications might exist.

Personally I would say that using negative lengths was asking for problems because at some point a negative length will be checked without first changing it to positive.
--
Flash Gordon, living in interesting times.
Web site - http://home.flash-gordon.me.uk/
comp.lang.c posting guidelines and intro:
http://clc-wiki.net/wiki/Intro_to_clc
.



Relevant Pages

  • Re: Flexible Collating (feedback please)
    ... Although it is still quite a bit slower than a bare list.sort, that is to be expected as collate is locale aware and does additional transformations on the data which you would need to do anyways. ... Changed the flag types from integer values to a list of named strings. ... The reason for this is it makes finding errors easier and you can examine the flags attribute and get a readable list of flags. ... It now separates numerals in the middle of the string. ...
    (comp.lang.python)
  • Re: tracking down disk spinups.
    ... I implemented the BusyBox mount command last year. ... (The new flags _replace_ the old flags, ... of course, not all of them are flags, some remain strings, but you can't keep ... (because otherwise the kernel got log message diarrhea). ...
    (Linux-Kernel)
  • Re: Boost process and C
    ... bits for the flags. ... thousand small strings can make a big difference in RAM used, ... portion of the memory footprint and saving the memory that avoiding the ... So it reduces overhead, while increasing safety and ...
    (comp.lang.c)
  • Re: Flexable Collating (feedback please)
    ... # use current locale settings ... flags = flags.upper.split ... """ This allows the Collate class to be used as a sort key. ... """ Return a collated list of strings. ...
    (comp.lang.python)