Re: Swapping thing

From: Ioannis Vranos (ivr_at_guesswh.at.grad.com)
Date: 06/28/04


Date: Mon, 28 Jun 2004 22:36:56 +0300

Howard wrote:

> "Ioannis Vranos" <ivr@guesswh.at.grad.com> wrote in message
> news:cbprc1$6tu$3@ulysses.noc.ntua.gr...
>
>
>>You are right about that, however in reality a decent swap
>>implementation would check if the passed arguments have the same value
>>so as to avoid unneeded operations.
>>
>
>
> And the need for that check is exactly one of the arguments for why this
> choice of implementation was no better than using a temporary variable in
> the first place. If you can afford the space for the code to check this
> condition, then you can surely afford the space for the temporary integer
> variable instead.

I think the non-temporary requirement is not for space concerns but to
find out how c00l we are. :-) Even under severe space concerns there is
always space for a *temporary* variable. If there are space concerns to
the extreme, then we should write numbers in its memory directly. :-)

Regards,

Ioannis Vranos



Relevant Pages

  • Re: Swapping thing
    ... Howard wrote: ... however in reality a decent swap ... If you can afford the space for the code to check this ...
    (comp.lang.cpp)
  • Re: Swapping thing
    ... Howard wrote: ... >> You are right about that, however in reality a decent swap ... If you can afford the space for the code to check this ...
    (comp.lang.cpp)
  • Re: Swapping thing
    ... Howard wrote: ... >> You are right about that, however in reality a decent swap ... If you can afford the space for the code to check this ...
    (comp.lang.c)
  • Re: Wilmington News Journal: Stern aide details his Del. drug connection
    ... just didn't want to give a scoop to the newspaper when he had his own ... Lab Rot and Shitfoot, once again, making ... wants to hear what Howard has to say can just listen to the show. ... "As for the $13 a month, well I also get tons of commercial free music and if you can't afford that I really feel sorry for you." ...
    (alt.fan.howard-stern)
  • Re: Confused
    ... > tell him to get the cash up front, I doubt any of you will be able to ... > afford the return journey... ... > in reality though we are all looking at several nights accomodations in ...
    (uk.local.southwest)