|
From: Adam J. <aj...@i-...> - 2007-07-18 01:04:34
|
No problem Jonathan, maybe I should have worded it better. But I do agree with you when you stated: >>I would usually set 'large' to 100bytes (personal preference), but if this is a recursuve function, even that much should probably be on the heap instead. Personally, I do the same. Most modern OSes will allocate more stack space on the fly. As I said the example was a trivial one, and I was just trying to make a point, because I see it all the time. A programmer who thinks they can get away with char[10] may then try to get away with char[64000]. I actually saw that in a program that decodes data from a satellite. As you can imagine the software had problems all the time. What was even worse was the this buffer was called recursively, and it was inside of a thread that did not get terminated properly when the user changed channels. The problems did not show up until the software was running for a bit, because the box it was running on had a large amount of memory...... :) -Adam Jones |