From: "John M. Aldrich" Newsgroups: comp.os.msdos.djgpp Subject: Re: Assembly returns... Date: Sat, 16 May 1998 09:39:03 -0400 Organization: Two pounds of chaos and a pinch of salt. Lines: 20 Message-ID: <355D96F7.7624@cs.com> References: NNTP-Posting-Host: ppp104.cs.net Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Paul Derbyshire wrote: > > I suppose objects bigger than 32 bits are implicitly passed by reference using > a pointer in eax, and the temporary is deleted only after receipt of the value > in the caller? I think that's correct. However, if memory serves, such structs are not returned by reference but by value; a separate copy is placed on the stack and its address is returned in eax. If this is correct, then your huge class might cause a stack overflow if you tried to return it by value. The best way to find out is probably to compile such code with the -S flag and examine the resulting assembly. -- --------------------------------------------------------------------- | John M. Aldrich |"Men rarely (if ever) manage to dream | | aka Fighteer I |up a god superior to themselves. Most | | mailto:fighteer AT cs DOT com |gods have the manners and morals of a | | http://www.cs.com/fighteer |spoiled child." - Lazarus Long | ---------------------------------------------------------------------