From owner-cvs-src-old@FreeBSD.ORG Sat Jan 31 18:32:09 2009 Return-Path: Delivered-To: cvs-src-old@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B3E2F106570D for ; Sat, 31 Jan 2009 18:32:09 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 07CC18FC0A for ; Sat, 31 Jan 2009 18:32:09 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n0VIW8ZM016567 for ; Sat, 31 Jan 2009 18:32:08 GMT (envelope-from das@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n0VIW8Ma016564 for cvs-src-old@freebsd.org; Sat, 31 Jan 2009 18:32:08 GMT (envelope-from das@repoman.freebsd.org) Message-Id: <200901311832.n0VIW8Ma016564@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to das@repoman.freebsd.org using -f From: David Schultz Date: Sat, 31 Jan 2009 18:27:02 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/include stdlib.h string.h wchar.h src/sys/sys cdefs.h malloc.h X-BeenThere: cvs-src-old@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Jan 2009 18:32:10 -0000 das 2009-01-31 18:27:02 UTC FreeBSD src repository Modified files: include stdlib.h string.h wchar.h sys/sys cdefs.h malloc.h Log: SVN rev 187961 on 2009-01-31 18:27:02Z by das Add a function attribute called `__malloc_like', which informs gcc that the annotated function returns a pointer that doesn't alias any extant pointer. This results in a 50%+ speedup in microbenchmarks such as the following: char *cp = malloc(1), *buf = malloc(BUF); for (i = 0; i < BUF; i++) buf[i] = *cp; In real programs, your mileage will vary. Note that gcc already performs this optimization automatically for any function called `malloc', `calloc', `strdup', or `strndup' unless -fno-builtins is used. Revision Changes Path 1.68 +2 -2 src/include/stdlib.h 1.28 +2 -2 src/include/string.h 1.47 +1 -1 src/include/wchar.h 1.97 +2 -0 src/sys/sys/cdefs.h 1.88 +2 -2 src/sys/sys/malloc.h