Re: memset as memzero

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Arjan van de Ven <arjan@...>
Cc: Cyrill Gorcunov <gorcunov@...>, LKML <linux-kernel@...>, Andrew Morton <akpm@...>, Ingo Molnar <mingo@...>
Date: Saturday, September 22, 2007 - 2:53 pm

On Sat, 22 Sep 2007, Arjan van de Ven wrote:

Indeed.

The reason we have "clear_page()" is not because the value we're writing 
is constant - that doesn't really help/change anything at all. We could 
have had a "fill_page()" that sets the value to any random byte, it's just 
that zero is the only value that we really care about.

So the reason we have "clear_page()" is because the *size* and *alignment* 
is constant and known at compile time, and unlike the value you write, 
that actually matters.

So "memzero()" would never really make sense as anything but a syntactic 
wrapper around "memset(x,0,size)". 

			Linus
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
memset as memzero, Cyrill Gorcunov, (Sat Sep 22, 4:33 am)
Re: memset as memzero, Arjan van de Ven, (Sat Sep 22, 3:46 pm)
Re: memset as memzero, Cyrill Gorcunov, (Sat Sep 22, 3:32 pm)
Re: memset as memzero, Bernd Eckenfels, (Sat Sep 22, 3:25 pm)
Re: memset as memzero, Linus Torvalds, (Sat Sep 22, 2:53 pm)
Re: memset as memzero, Dave Jones, (Sun Sep 23, 11:32 am)
Re: memset as memzero, Robert P. J. Day, (Sun Sep 23, 12:33 pm)
Re: memset as memzero, Arnaldo Carvalho de Melo, (Sun Sep 23, 12:46 pm)
Re: memset as memzero, Arnaldo Carvalho de Melo, (Sun Sep 23, 12:07 pm)
Re: memset as memzero, Linus Torvalds, (Sun Sep 23, 1:05 pm)
Re: memset as memzero, Willy Tarreau, (Sun Sep 23, 2:46 pm)
Re: memset as memzero, Robert P. J. Day, (Sat Sep 22, 4:48 am)
Re: memset as memzero, Cyrill Gorcunov, (Sat Sep 22, 5:35 am)
Re: memset as memzero, Robert P. J. Day, (Sat Sep 22, 5:55 am)
Re: memset as memzero, Cyrill Gorcunov, (Sat Sep 22, 6:15 am)