Mail Archives: djgpp-workers/2003/04/27/14:33:31
Richard Dawe wrote:
>
... snip ...
>
> Returning a struct value isn't an idiom that's used much in C
> AFAIK. When I encountered it for the first time with inet_aton
> (or whatever it was), I was surprised. I haven't seen much use
> of returning a struct between 5 and 8 bytes. What commonly-used
> functions do that? div, ldiv, ...?
>
> So I wouldn't be surprised if no-one (other than Eric & Ben)
> has noticed.
I originally designed the _sysinfo interface for nmalloc to fit
into registers. It grew. WRT div/ldiv, I am morally certain that
their original purpose was to avoid two executions of the divide
instruction, which implies that they should really be provided as
macros that create assembly language. As now implemented they
have grown to add the overhead of a call, and are fairly useless
unless one operand is volatile.
--
Chuck F (cbfalconer AT yahoo DOT com) (cbfalconer AT worldnet DOT att DOT net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net> USE worldnet address!
- Raw text -