On Nov 22 11:34, Corinna Vinschen via Cygwin wrote:
> On Nov 21 11:16, Tony Cook wrote:
> > On Thu, Nov 18, 2021 at 09:08:40PM +0000, Sam Edge via Cygwin wrote:
> > > I use newlib on embedded with threading libs that have predetermined
> > > fixed thread stack sizes. While we tend to have more RAM than in former
> > > times we also have multiple thread stacks. Use of alloca() or variable
> > > length automatic arrays makes me wince especially in code I might not be
> > > able to avoid calling which is often the case with XXXprintf() in
> > > third-party libraries' debug output. I'd usually rather take the
> > > performance hit from using heap instead of having to make all my stacks
> > > bigger.
> > 
> > A simple option would be to use an small auto fixed buffer for most
> > conversions, but use malloc() for %f formats for numbers greater in
> > magnitude than some limit, though it would also need to be adjusted
> > for the precision (ndigits here), since they take extra space.
> > 
> > This would avoid using the optional-to-implement VLA feature too.
> 
> Good idea.  I guess I create a simple fix doing just that.

I created a patch:
https://sourceware.org/git/?p=newlib-cygwin.git;a=commitdiff;h=68faeef4be71

Please test the latest developer snapshot from http://cygwin.com/snapshots/


Thanks,
Corinna

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

Reply via email to