Alan Coopersmith wrote:
> Roland Mainz wrote:
> > Glenn Fowler wrote:
> >> On Mon, 13 Nov 2006 09:39:28 +0100 Roland Mainz wrote:
> >> note that this is a non-ast problem
> >> no ast code uses
> >>
> >>         int foo = some_size;
> >>         some_type bar[foo];
> >
> > Yes, I know... but remember the prototype code I send you...
> > The idea is to use the stack for such temporary allocations since it has
> > significant advantages over memory from the heap, including:
> 
> Isn't that what alloca() is for?   (Ignoring the simple fact that alloca()
> is actually horribly broken since it never tells you if it's failed, just
> lets you corrupt your stack when you ask for too much memory.)

This works on Solaris - but on other platforms the results of |alloca()|
appear to come from a random number generator or something worse. And
IMO it is not "clean" to use such an interface when the language spec
itself has better ways to do it...

----

Bye,
Roland

-- 
  __ .  . __
 (o.\ \/ /.o) [EMAIL PROTECTED]
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL +49 641 7950090
 (;O/ \/ \O;)
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to