Should Wine use alloca or not?

Patrik Stridvall ps at
Tue Feb 13 03:39:59 CST 2001

> On Monday 12 February 2001 15:33, Patrik Stridvall wrote:
> > > > So perhaps we should debate whether we should use alloca or not.
> It seems this has been decided. 

Yes, see below.

> I haven't examined or used 
> alloca in years, 
> so its possible that my personal objections don't apply in todays 
> implementations ( a quick test shows gcc on i386 _doesn't_ 
> use a function 
> call these days, for example, so thats no longer a valid 
> reason). So rather 
> than saying its evil, I'll tone down to it simply being 
> unesessary, and 
> continue to avoid it for (no doubt dubious) reasons of 'style'.

I would rather say that the problem of using it, is that it,
as Alexandre pointed out, introduces unrecovorable/undetectable
errors if we allocate more than one page memory and if we only
need a maximum of one page we can just allocate that or less if
we know the exact maximum.

The only problem I can see with this approach is that it 
uses an unnessary amount of stack space for recursive
functions, but then I know of no such function in Wine and
even if there is one, it is probably better to rewrite it
as a non-recursive function anyway.

So yes, the issue is decided.

More information about the wine-devel mailing list