netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Fw: net: alignment problem in icmp code
@ 2007-10-21 19:54 Темерханов Сергей
  0 siblings, 0 replies; 2+ messages in thread
From: Темерханов Сергей @ 2007-10-21 19:54 UTC (permalink / raw)
  To: temerkhanov; +Cc: netdev



-------- Пересылаемое сообщение --------
21.10.07, 23:48, David Miller (davem@davemloft.net):

From: Pierre Ossman <drzeus@drzeus.cx>
Date: Sun, 21 Oct 2007 11:34:05 +0200

> Inlining isn't the problem, but the defined semantics of assignment
> versus memcpy(). memcpy() must work on any region of memory, whilst
> assignment must only work on a properly aligned object.

You are missing a crucial point.

The compiler may emit the same exact loads and stores when it inlines
memcpy() if it "knows" the objects are aligned properly.  And it very
much will do this.

If the compiler is calling memcpy() in your build, it's only because
gcc believes the the object is too big to optimally memcpy() inline.
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

-------- Завершение пересылаемого сообщения --------


--
"Краски осени": Новый конкурс на Яндекс.Фотках http://fotki.yandex.ru/contest.xml?id=10

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Fw: net: alignment problem in icmp code
@ 2007-10-21 19:58 Темерханов Сергей
  0 siblings, 0 replies; 2+ messages in thread
From: Темерханов Сергей @ 2007-10-21 19:58 UTC (permalink / raw)
  To: temerkhanov; +Cc: netdev



-------- Пересылаемое сообщение --------
21.10.07, 23:48, David Miller (davem@davemloft.net):

From: Pierre Ossman <drzeus@drzeus.cx>
Date: Sun, 21 Oct 2007 11:34:05 +0200

> Inlining isn't the problem, but the defined semantics of assignment
> versus memcpy(). memcpy() must work on any region of memory, whilst
> assignment must only work on a properly aligned object.

You are missing a crucial point.

The compiler may emit the same exact loads and stores when it inlines
memcpy() if it "knows" the objects are aligned properly.  And it very
much will do this.

If the compiler is calling memcpy() in your build, it's only because
gcc believes the the object is too big to optimally memcpy() inline.
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

-------- Завершение пересылаемого сообщения --------


--
Яндекс.Открытки - Анонсы новых открыток: http://cards.yandex.ru/subscribe.xml

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-10-21 20:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-21 19:58 Fw: net: alignment problem in icmp code Темерханов Сергей
  -- strict thread matches above, loose matches on Subject: below --
2007-10-21 19:54 Темерханов Сергей

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).