From owner-p4-projects Mon Sep 9 11:58:24 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id BA55937B401; Mon, 9 Sep 2002 11:58:16 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5E6B037B400 for ; Mon, 9 Sep 2002 11:58:16 -0700 (PDT) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1724D43E42 for ; Mon, 9 Sep 2002 11:58:16 -0700 (PDT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from freefall.freebsd.org (perforce@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.4/8.12.4) with ESMTP id g89IwFJU076993 for ; Mon, 9 Sep 2002 11:58:15 -0700 (PDT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by freefall.freebsd.org (8.12.4/8.12.4/Submit) id g89IwFPQ076990 for perforce@freebsd.org; Mon, 9 Sep 2002 11:58:15 -0700 (PDT) Date: Mon, 9 Sep 2002 11:58:15 -0700 (PDT) Message-Id: <200209091858.g89IwFPQ076990@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson Subject: PERFORCE change 17281 for review To: Perforce Change Reviews Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG http://people.freebsd.org/~peter/p4db/chv.cgi?CH=17281 Change 17281 by rwatson@rwatson_tislabs on 2002/09/09 11:57:59 Remove local memory trashing support in malloc -- we added it when it disappeared in the UMA change, but UMA now does this natively so merge it back out. Should marginally improve performance, and is a decent diff reduction. Affected files ... .. //depot/projects/trustedbsd/mac/sys/kern/kern_malloc.c#14 edit Differences ... ==== //depot/projects/trustedbsd/mac/sys/kern/kern_malloc.c#14 (text+ko) ==== @@ -117,13 +117,6 @@ {0, NULL}, }; -/* - * The WEIRD_ADDR is used as known text to copy into free objects so - * that modifications after frees can be detected. - */ -#define WEIRD_ADDR 0xdeadc0de -#define MAX_COPY 64 - u_int vm_kmem_size; /* @@ -202,24 +195,6 @@ } /* - * Copy in known text to make the memory look free. - */ -static __inline void -trash_mem(void *addr, size_t size) -{ -#ifdef INVARIANTS - uint32_t *ip; - - ip = (uint32_t *)addr; - size = size >= MAX_COPY ? MAX_COPY : size & ~sizeof(uint32_t); - while (size != 0) { - *ip++ = WEIRD_ADDR; - size -= sizeof(uint32_t); - } -#endif -} - -/* * free: * * Free a block of memory allocated by malloc. @@ -255,7 +230,6 @@ #ifdef INVARIANTS struct malloc_type **mtp = addr; #endif - trash_mem(addr, size); size = slab->us_zone->uz_size; #ifdef INVARIANTS /* @@ -275,7 +249,6 @@ uma_zfree_arg(slab->us_zone, addr, slab); } else { size = slab->us_size; - trash_mem(addr, size); uma_large_free(slab); } mtx_lock(&ksp->ks_mtx); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message