I am developing a dll library used by XP embedded, XP and Windows 2000
applications. How big of a local buffer is ok? None of these functions
are recursive but some of my functions will internally call some other
function meaning stack required in the system can be two or three times
more than required for one function. I am thinking of stack problems if
I define a big local buffer (buffer of 50K ) in functions. I am sure I
wont need more than 50 K for the function because of other constraints.
Should I allocate memory dynamically and free it before leaving the
function. My arguement is defining local buffer is kind of dynamic
memory because stack is released after the function call. Is it a good
practice to define big buffers on stack. At what buffer size should I
stop allocating local buffer and allocate a dynamic buffer.