PERFORCE change 85945 for review

Todd Miller millert at FreeBSD.org
Thu Oct 27 19:39:31 GMT 2005


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

Change 85945 by millert at millert_ibook on 2005/10/27 19:38:52

	In sebsd_malloc only bzero allocated region if M_ZERO set in flags

Affected files ...

.. //depot/projects/trustedbsd/sedarwin7/src/sedarwin/sedarwin/sebsd.c#15 edit

Differences ...

==== //depot/projects/trustedbsd/sedarwin7/src/sedarwin/sedarwin/sebsd.c#15 (text+ko) ====

@@ -79,14 +79,15 @@
 void *
 sebsd_malloc(size_t size, int flags)
 {
-	size_t *vs;
+	size_t *vs, nsize;
 
-	size += sizeof(size_t);
+	nsize = size + sizeof(size_t);
 	vs = (flags & M_NOWAIT) ?
-	    (size_t *)kalloc_noblock(size) : (size_t *)kalloc(size);
+	    (size_t *)kalloc_noblock(nsize) : (size_t *)kalloc(nsize);
 	if (vs != NULL) {
-		bzero(vs, size);
-		*vs++ = size;
+		*vs++ = nsize;
+		if (flags & M_ZERO)
+			bzero(vs, size);
 	}
 	return (vs);
 }
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