![]() |
|
|
|
#1 |
|
I am implementing the bitstring type in the container library, and
obviously I store the number of bits in a size_t... Problem is, in 64 bit versions, size_t grows to 8 bytes, what is an absolute overkill for a number that in most cases will fit in 16 bits, or, at most 32. And this happens in all containers. I do not see most applications use containers with more than 4G elements... In a 64 bit system size_t is just too much waste. Now I see the problems Malcom was pointing at when he ranted at size_t. What would be the alternatives? uin32_t? That one looks better. Any problem with that? jacob navia |
|
|
|
|
#2 |
|
Posts: n/a
|
On 15 Oct, 10:41, jacob navia <ja...@nospam.org> wrote:
> I am implementing the bitstring type in the container library, and > obviously I store the number of bits in a size_t... obviously... > Problem is, in 64 bit versions, size_t grows to 8 bytes, what > is an absolute overkill for a number that in most cases will > fit in 16 bits, or, at most 32. > > And this happens in all containers. I do not see most applications > use containers with more than 4G elements... if you don't want containers with more than 4G elements why are you using a 64-bit system? > In a 64 bit system size_t is just too much waste. > > Now I see the problems Malcom was pointing at when he ranted at size_t. I always thought his rant was a bit odd > What would be the alternatives? > > uin32_t? > > That one looks better. Any problem with that? it won't hold more than 4G elements! Nick Keighley |
|
|
|
#3 |
|
Posts: n/a
|
jacob navia wrote:
> [...] size_t grows to 8 bytes, what is an absolute overkill [...] <OT grammar nit> In this context, one would write "which" not "what". (English native speakers: is my statement correct?) I've seen several francophone posters make this mistake. Is this grammatical rule incorrectly taught in school, perhaps? </OT> Noob |
|
|
|
#4 |
|
Posts: n/a
|
On 15 Oct, 12:12, Noob <r...@127.0.0.1> wrote:
> jacob navia wrote: > > [...] size_t grows to 8 bytes, what is an absolute overkill [...] > > <OT grammar nit> > In this context, one would write "which" not "what". > (English native speakers: is my statement correct?) yes > I've seen several francophone posters make this mistake. > Is this grammatical rule incorrectly taught in school, perhaps? > </OT> Nick Keighley |
|
|
|
#5 |
|
Posts: n/a
|
In article <hb7032$o2$> Noob <root@127.0.0.1> writes:
> jacob navia wrote: > > > [...] size_t grows to 8 bytes, what is an absolute overkill [...] > > <OT grammar nit> > In this context, one would write "which" not "what". > (English native speakers: is my statement correct?) > I've seen several francophone posters make this mistake. > Is this grammatical rule incorrectly taught in school, perhaps? > </OT> In French (as in Dutch) which translates in this position to a word that is also a translation of what. So when you use the translated word in your native language you have to think about the difference in meaning when translating into English. Similar to "teach" and "learn" that can be (and frequently will be) translated to the same word in Dutch. -- dik t. winter, cwi, science park 123, 1098 xg amsterdam, nederland, +31205924131 home: bovenover 215, 1025 jn amsterdam, nederland; http://www.cwi.nl/~dik/ Dik T. Winter |
|
|
|
#6 |
|
Posts: n/a
|
jacob navia <> writes:
> I am implementing the bitstring type in the container library, and > obviously I store the number of bits in a size_t... > > Problem is, in 64 bit versions, size_t grows to 8 bytes, what > is an absolute overkill for a number that in most cases will > fit in 16 bits, or, at most 32. I can't see why bitstrings > > And this happens in all containers. I do not see most applications > use containers with more than 4G elements... In a 64 bit system > size_t is just too much waste. > > Now I see the problems Malcom was pointing at when he ranted at size_t. > > What would be the alternatives? > > uin32_t? > > That one looks better. Any problem with that? -- Ben. Ben Bacarisse |
|
|
|
#7 |
|
Posts: n/a
|
Dik T. Winter wrote:
> In article <hb7032$o2$> Noob <root@127.0.0.1> writes: >> jacob navia wrote: >> >>> [...] size_t grows to 8 bytes, what is an absolute overkill [...] >> >> <OT grammar nit> >> In this context, one would write "which" not "what". >> (English native speakers: is my statement correct?) >> I've seen several francophone posters make this mistake. >> Is this grammatical rule incorrectly taught in school, perhaps? >> </OT> > > In French (as in Dutch) which translates in this position to a word > that is also a translation of what. So when you use the translated > word in your native language you have to think about the difference > in meaning when translating into English. Same in German. > Similar to "teach" and "learn" that can be (and frequently will be) > translated to the same word in Dutch. Happens in German too, but is utterly wrong. "teach" is "lehren", "lern" is "lernen". Quite a few Germans don't care and use "lernen" in either case. Bye, Jojo Joachim Schmitz |
|
|
|
#8 |
|
Posts: n/a
|
[I cancelled a previous reply sent unfinished (hardly begun!) but I
image it will get though. Please ignore it.] jacob navia <> writes: > I am implementing the bitstring type in the container library, and > obviously I store the number of bits in a size_t... > > Problem is, in 64 bit versions, size_t grows to 8 bytes, what > is an absolute overkill for a number that in most cases will > fit in 16 bits, or, at most 32. > > And this happens in all containers. I do not see most applications > use containers with more than 4G elements... In a 64 bit system > size_t is just too much waste. If the implementation has decided that size_t should be 64 bits, then I'd want containers that can be that large. I don't see that as a problem but I don't use ever use low-memory systems with 64-bit size_t. It soulds like you are worrying about a corner case. > Now I see the problems Malcom was pointing at when he ranted at > size_t. I though he objected to not using int and wanted int, on all systems, to be 64 bits? That would have a much higher memory impact the not using size_t. <snip> -- Ben. Ben Bacarisse |
|
|
|
#9 |
|
Posts: n/a
|
In article <hb7b29$u9e$> "Joachim Schmitz" <> writes:
> Dik T. Winter wrote: .... > > Similar to "teach" and "learn" that can be (and frequently will be) > > translated to the same word in Dutch. > > Happens in German too, but is utterly wrong. "teach" is "lehren", "lern" is > "lernen". But in Dutch it is correct. "leren" has two meanings, transitive and intransitive, which makes a sentence like: De man leert pianospelen ambiguous (the man teaches/learns playing piano). -- dik t. winter, cwi, science park 123, 1098 xg amsterdam, nederland, +31205924131 home: bovenover 215, 1025 jn amsterdam, nederland; http://www.cwi.nl/~dik/ Dik T. Winter |
|
|
|
#10 |
|
Posts: n/a
|
Dik T. Winter wrote:
> In article <hb7b29$u9e$> "Joachim Schmitz" > <> writes: >> Dik T. Winter wrote: > ... >>> Similar to "teach" and "learn" that can be (and frequently will be) >>> translated to the same word in Dutch. >> >> Happens in German too, but is utterly wrong. "teach" is "lehren", >> "lern" is "lernen". > > But in Dutch it is correct. "leren" has two meanings, transitive and > intransitive, which makes a sentence like: > De man leert pianospelen > ambiguous (the man teaches/learns playing piano). OK, then I now know where that mistake stems from (living so 60km from the Dutch border Bye, Jojo Joachim Schmitz |
|
![]() |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Comcast + Wireless Internet Problem | shadoweloc | General Help Related Topics | 1 | 07-01-2008 06:19 PM |
| Dial Up Problem | smackedass | A+ Certification | 3 | 02-02-2007 11:59 PM |
| Re: Virus Problem ** Help!** | David BlandIII | A+ Certification | 1 | 03-02-2004 06:00 PM |
| Re: Serious Computer Problem | hootnholler | A+ Certification | 1 | 11-24-2003 12:18 PM |
| Re: Serious Computer Problem | Bret | A+ Certification | 0 | 11-19-2003 12:51 AM |