[Coco] Re: optimizing
Roger Taylor
rtaylor at bayou.com
Wed Dec 10 23:10:00 EST 2003
At 01:57 PM 12/10/2003 -0500, you wrote:
> > mov(stralloc(256), MyString);
> > str.cpy("some text", MyString);
>
>I trust you don't do this until you've made more than a few test runs and
>never had the stralloc() fail. In C, I always test for a NULL return from
>any
>form of alloc() fcn, and print an Alert message.
Not usually... there are just way too many stralloc's and malloc's to be
testing each one like this. With 320 megs of RAM, and most people using
256-512 nowadays on their PCs, WITH a virtual memory service in effect, you
can be absolutely sure the system will find you 64 bytes somewhere to store
a string, or even 8k worth of memory. There's no worries in this
particular area. HLA will abort with an exception error box and will tell
you there is a problem with system memory.
However, this doesn't mean that I don't worry about testing the results
from other calls. Sure, I do.
----------
Roger Taylor
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://five.pairlist.net/pipermail/coco/attachments/20031210/fab11269/attachment-0001.html>
More information about the Coco
mailing list