Click to See Complete Forum and Search --> : limit on <string>?


arlenagha
06-05-2003, 01:08 PM
i just found out that there is a limit on how many characters a string object can hold. its about 4000 characters. at first i knew that there had to be a limit but why is it 4000 characters? how would i get around that limitation??

DragonHead
06-05-2003, 03:03 PM
Actually, the size is machine dependent. On 32bit machines, the size is 4294967296.

That is 2^32.

Stuka
06-05-2003, 03:23 PM
I'd be willing to bet that the limit is more implementation than machine dependent. Per the class definition, you can call max_size() to find out the limit.

Strogian
06-05-2003, 04:18 PM
Originally posted by DragonHead
Actually, the size is machine dependent. On 32bit machines, the size is 4294967296.

That is 2^32.

Well if that's true then there's really no limit, since that's the maximum memory you could have anyway. :)

bwkaz
06-05-2003, 09:47 PM
Heh. Not quite -- Intel processors later than the Pentium (AKA i686 and newer) can actually address up to 64GB of memory using some extension to the paging mechanism.

That's what CONFIG_HIGHMEM_64GB enables. :)

Strogian
06-05-2003, 10:13 PM
Question is -- would enabling those extensions also raise the string limit? :)

DragonHead
06-05-2003, 10:32 PM
I dug around, it is implementation dependent, not machine dependent. That of course, makes sence when you stop and think about it...

bwkaz
06-05-2003, 10:44 PM
Strogian -- heh. No, it wouldn't, because Stuka was right when he said the real limit is implementation-dependent (rather than machine-dependent). :)

Use the max_size() function to see what it is.