PERFORCE change 33871 for review

Robert Watson rwatson at FreeBSD.org
Mon Jun 30 03:30:17 GMT 2003


http://perforce.freebsd.org/chv.cgi?CH=33871

Change 33871 by rwatson at rwatson_powerbook on 2003/06/29 20:29:18

	Implement M_ZERO for Darwin.  Makes for much smaller diffs against the
	FreeBSD version of kern_mac.c.

Affected files ...

.. //depot/projects/trustedbsd/sedarwin/apsl/xnu/bsd/kern/kern_malloc.c#2 edit
.. //depot/projects/trustedbsd/sedarwin/apsl/xnu/bsd/sys/malloc.h#2 edit

Differences ...

==== //depot/projects/trustedbsd/sedarwin/apsl/xnu/bsd/kern/kern_malloc.c#2 (text+ko) ====

@@ -304,6 +304,13 @@
 
 	mem->hdr.mlen = memsize;
 
+	/*
+	 * XXX: If Mach supported background page zeroing, we'd want to be
+	 * using that here somehow.
+	 */
+	if (flags & M_ZERO)
+		bzero(mem->hdr.dat, mem->hdr.mlen);
+
 	return  (mem->hdr.dat);
 }
 

==== //depot/projects/trustedbsd/sedarwin/apsl/xnu/bsd/sys/malloc.h#2 (text+ko) ====

@@ -68,6 +68,7 @@
  */
 #define	M_WAITOK	0x0000
 #define	M_NOWAIT	0x0001
+#define M_ZERO		0x0100	/* bzero the allocation */
 
 /*
  * Types of memory to be allocated (not all are used by us)
To Unsubscribe: send mail to majordomo at trustedbsd.org
with "unsubscribe trustedbsd-cvs" in the body of the message



More information about the trustedbsd-cvs mailing list