Re: removing bcopy... because it's half broken

From: Linus Torvalds
Date: Sun Jan 09 2005 - 15:20:30 EST




On Sun, 9 Jan 2005, Arjan van de Ven wrote:
>
> Instead of fixing this inconsistency, I decided to remove it entirely,
> explicit memcpy() and memmove() are prefered anyway (welcome to the 1990's)
> and nothing in the kernel is using these functions, so this saves code size
> as well for everyone.

The problem is that at least some gcc versions would historically generate
calls to "bcopy" on alpha for structure assignments. Maybe it doesn't any
more, and no such old gcc versions exist any more, but who knows?

That's also why "bcopy" just acts like a memcpy() in many cases: it's
simply not worth it to do the complex case, because the only valid use was
a compiler that would never validly do overlapping ranges anyway.

Gcc _used_ to have a target-specific "do I use bcopy or memcpy" setting,
and I just don't know if that is still true. I also don't know if it
affected any other platforms than alpha (I would assume that it matched
"target has BSD heritage", and that would likely mean HP-UX too)

Richard? You know both gcc and alpha, what's the word?

Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/