Subject: MALLOC vs. malloc: maybe use __builtin_constant_p?
To: None <thorpej@wasabisystems.com>
From: None <cgd@broadcom.com>
List: tech-kern
Date: 03/31/2003 19:14:33
So, this commit msg made me think...

Having multiple names for approximately the same thing is annoying,
and obviously even though we've got standards on when to use MALLOC()
vs. malloc(), people get it wrong.

Maybe "The Right Thing" is to have a single blessed version, which uses
__builtin_constant_p() to check whether the arg is a constant, and
evaluates into the macro or the fn based on that...


chris

------- Start of forwarded message -------
From: thorpej@netbsd.org ("Jason R Thorpe")
Subject: CVS commit: src/sys/kern
Date: Tue, 1 Apr 2003 01:41:49 +0000 (UTC)
Reply-To: thorpej@netbsd.org
Mime-Version: 1.0
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
To: source-changes@netbsd.org


Module Name:	src
Committed By:	thorpej
Date:		Tue Apr  1 01:41:39 UTC 2003

Modified Files:
	src/sys/kern: kern_verifiedexec.c

Log Message:
* Use PAGE_SIZE rather than NBPG.
* Use malloc()/free(), rather than MALLOC()/FREE(), since the page size
  might not be a compile-time constant.


To generate a diff of this commit:
cvs rdiff -r1.2 -r1.3 src/sys/kern/kern_verifiedexec.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

------- End of forwarded message -------