From owner-cvs-src@FreeBSD.ORG Wed Feb 6 02:59:55 2008 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 C4A6B16A417; Wed, 6 Feb 2008 02:59:54 +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 C782C13C43E; Wed, 6 Feb 2008 02:59:54 +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 m162xsOp050324; Wed, 6 Feb 2008 02:59:54 GMT (envelope-from jasone@repoman.freebsd.org) Received: (from jasone@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m162xsv4050323; Wed, 6 Feb 2008 02:59:54 GMT (envelope-from jasone) Message-Id: <200802060259.m162xsv4050323@repoman.freebsd.org> From: Jason Evans Date: Wed, 6 Feb 2008 02:59:54 +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: Wed, 06 Feb 2008 02:59:55 -0000 jasone 2008-02-06 02:59:54 UTC FreeBSD src repository Modified files: lib/libc/stdlib malloc.3 malloc.c Log: Track dirty unused pages so that they can be purged if they exceed a threshold, according to the 'F' MALLOC_OPTIONS flag. This obsoletes the 'H' flag. Try to realloc() large objects in place. This substantially speeds up incremental large reallocations in the common case. Fix a bug in arena_ralloc() that caused relocation of sub-page objects even if the old and new sizes were in the same size class. Maintain trees of runs and simplify the per-chunk page map. This allows logarithmic-time searching for sufficiently large runs in arena_run_alloc(), whereas the previous algorithm required linear time in the worst case. Break various large functions into smaller sub-functions, and inline only the functions that are in the fast path for small object allocation/deallocation. Remove an unnecessary check in base_pages_alloc_mmap(). Avoid integer division in choose_arena() for the NO_TLS case on single-CPU systems. Revision Changes Path 1.77 +17 -15 src/lib/libc/stdlib/malloc.3 1.162 +960 -668 src/lib/libc/stdlib/malloc.c