Re: Boost process and C
- From: Flash Gordon <spam@xxxxxxxxxxxxxxxxxx>
- Date: Thu, 04 May 2006 13:26:56 +0100
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
.
- Follow-Ups:
- Re: Boost process and C
- From: websnarf
- Re: Boost process and C
- References:
- Re: Boost process and C
- From: websnarf
- Re: Boost process and C
- From: Ben Pfaff
- Re: Boost process and C
- From: jacob navia
- Re: Boost process and C
- From: Ben Pfaff
- Re: Boost process and C
- From: websnarf
- Re: Boost process and C
- From: CBFalconer
- Re: Boost process and C
- From: websnarf
- Re: Boost process and C
- From: CBFalconer
- Re: Boost process and C
- From: websnarf
- Re: Boost process and C
- From: Ben C
- Re: Boost process and C
- From: websnarf
- Re: Boost process and C
- From: Flash Gordon
- Re: Boost process and C
- From: jacob navia
- Re: Boost process and C
- Prev by Date: Re: biggest of 3 numbers
- Next by Date: Re: main() called inside main()
- Previous by thread: Re: Boost process and C
- Next by thread: Re: Boost process and C
- Index(es):
Relevant Pages
|