Should Wine use alloca or not?

Alexandre Julliard julliard at winehq.com
Mon Feb 12 12:22:40 CST 2001


Patrik Stridvall <ps at leissner.se> writes:

> Sure, but the "char buffer[10*PAGE_SIZE]" have the same problem haven't it?
> We are not talking about allocation large amounts of space anyway,
> but being able to allocate a buffer for ANSI <=> UNICODE translation
> on the stack would be useful and most strings are not that large.

If you know that the allocation will be small you don't need alloca(),
you can use a constant-size buffer. And if you don't know the
allocation maximum size you cannot use alloca() either because it may
crash. So it doesn't buy anything and introduces potential portability
problems.

-- 
Alexandre Julliard
julliard at winehq.com



More information about the wine-devel mailing list