From owner-cvs-src@FreeBSD.ORG Thu Dec 27 23:29:44 2007 Return-Path: Delivered-To: cvs-src@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E834B16A419; Thu, 27 Dec 2007 23:29:44 +0000 (UTC) (envelope-from jasone@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id E6E9C13C459; Thu, 27 Dec 2007 23:29:44 +0000 (UTC) (envelope-from jasone@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id lBRNTiZ3052748; Thu, 27 Dec 2007 23:29:44 GMT (envelope-from jasone@repoman.freebsd.org) Received: (from jasone@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id lBRNTikT052747; Thu, 27 Dec 2007 23:29:44 GMT (envelope-from jasone) Message-Id: <200712272329.lBRNTikT052747@repoman.freebsd.org> From: Jason Evans Date: Thu, 27 Dec 2007 23:29:44 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/lib/libc/stdlib malloc.3 malloc.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Dec 2007 23:29:45 -0000 jasone 2007-12-27 23:29:44 UTC FreeBSD src repository Modified files: lib/libc/stdlib malloc.3 malloc.c Log: Add the 'D' and 'M' run time options, and use them to control whether memory is acquired from the system via sbrk(2) and/or mmap(2). By default, use sbrk(2) only, in order to support traditional use of resource limits. Additionally, when both options are enabled, prefer the data segment to anonymous mappings, in order to coexist better with large file mappings in applications on 32-bit platforms. This change has the potential to increase memory fragmentation due to the linear nature of the data segment, but from a performance perspective this is mitigated by the use of madvise(2). [1] Add the ability to interpret integer prefixes in MALLOC_OPTIONS processing. For example, MALLOC_OPTIONS=lllllllll can now be specified as MALLOC_OPTIONS=9l. Reported by: [1] rwatson Design review: [1] alc, peter, rwatson Revision Changes Path 1.75 +57 -24 src/lib/libc/stdlib/malloc.3 1.155 +436 -292 src/lib/libc/stdlib/malloc.c