Re: Why is the kfree() argument const?

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Christoph Lameter <clameter@...>
Cc: Johannes Weiner <hannes@...>, Linux Kernel Mailing List <linux-kernel@...>, <penberg@...>
Date: Wednesday, January 16, 2008 - 1:34 pm

On Mit, 2008-01-16 at 08:48 -0800, Christoph Lameter wrote:

Technically one should be able to pass a "const $type *" (which may
have been a "non-const $type *" before but at some point in time it
became "const $type *") to kfree().

The (formerly) constant contents as such vanishes IMHO (and it is not
really "modified").
Poisoning and free memory handling is IMHO internal stuff to the free
memory management subsystem and basically unrelated to the "life" of the
pointered contents before it's death with kfree().

	Bernd
-- 
Firmix Software GmbH                   http://www.firmix.at/
mobil: +43 664 4416156                 fax: +43 1 7890849-55
          Embedded Linux Development and Services


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

Messages in current thread:
Why is the kfree() argument const?, Johannes Weiner, (Wed Jan 16, 12:32 pm)
Re: Why is the kfree() argument const?, Linus Torvalds, (Wed Jan 16, 2:39 pm)
Re: Why is the kfree() argument const?, Steven Rostedt, (Wed Jan 16, 6:33 pm)
Re: Why is the kfree() argument const?, Johannes Weiner, (Wed Jan 16, 6:19 pm)
Re: Why is the kfree() argument const?, Linus Torvalds, (Wed Jan 16, 7:16 pm)
Re: Why is the kfree() argument const?, Christoph Lameter, (Wed Jan 16, 6:20 pm)
Re: Why is the kfree() argument const?, Linus Torvalds, (Wed Jan 16, 7:18 pm)
Re: Why is the kfree() argument const?, Johannes Weiner, (Wed Jan 16, 7:13 pm)
Re: Why is the kfree() argument const?, Johannes Weiner, (Wed Jan 16, 6:37 pm)
Re: Why is the kfree() argument const?, Christoph Lameter, (Wed Jan 16, 12:48 pm)
Re: Why is the kfree() argument const?, Pekka J Enberg, (Wed Jan 16, 1:45 pm)
Re: Why is the kfree() argument const?, Bernd Petrovitsch, (Wed Jan 16, 1:34 pm)