Re: Max size of an NSString
Re: Max size of an NSString
- Subject: Re: Max size of an NSString
- From: Jörn Salewski <email@hidden>
- Date: Tue, 28 Oct 2003 17:13:24 +0100
Theoretically the maximum size of an NSString would be determined by the
maximum size of its index to access the single unichar characters; this
index is defined as an unsigned int, so it would be UINT_MAX unichars.
Therefor, on a 32bit machine you could store up to 4GB of characters in an
NSString. Practically, with such a big string the computer would probably
stop responding because of vm swaping.
(serious question:) Has anybody ever tried this?
unichar *ptr = (unichar *)malloc(UINT_MAX * sizeof(unichar));
I think your problem is related to some character in the file (like a
linebrake) that is interpreted as a terminating NULL charater '\n'.
I'd suggest you check the file with a hexeditor where it gets truncated.
Chears,
JS
am 28.10.2003 14:29 Uhr schrieb Arthur VIGAN unter email@hidden:
>
What is the mximum size of an NSString?
>
>
I am trying to put the content of an HTML file of only 8KB in an
>
NSString, but the file is truncated...
>
>
-- Arthur
>
_______________________________________________
>
cocoa-dev mailing list | email@hidden
>
Help/Unsubscribe/Archives:
>
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
>
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.