From owner-freebsd-current@FreeBSD.ORG Thu Dec 1 07:21:32 2005 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D013E16A41F for ; Thu, 1 Dec 2005 07:21:32 +0000 (GMT) (envelope-from jasone@canonware.com) Received: from lh.synack.net (lh.synack.net [204.152.188.37]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7A5F543D5D for ; Thu, 1 Dec 2005 07:21:32 +0000 (GMT) (envelope-from jasone@canonware.com) Received: by lh.synack.net (Postfix, from userid 100) id 03FA35E48F5; Wed, 30 Nov 2005 23:21:32 -0800 (PST) Received: from [192.168.168.203] (moscow-cuda-gen2-68-64-60-20.losaca.adelphia.net [68.64.60.20]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by lh.synack.net (Postfix) with ESMTP id 5E1845E48B7; Wed, 30 Nov 2005 23:21:29 -0800 (PST) In-Reply-To: <9b1858120511290252w1e6d3458m@mail.gmail.com> References: <9b1858120511290252w1e6d3458m@mail.gmail.com> Mime-Version: 1.0 (Apple Message framework v746.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: Jason Evans Date: Wed, 30 Nov 2005 23:20:43 -0800 To: Hiten Pandya X-Mailer: Apple Mail (2.746.2) X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on lh.synack.net X-Spam-Level: * X-Spam-Status: No, score=1.8 required=5.0 tests=RCVD_IN_NJABL_DUL, RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: current@freebsd.org Subject: Re: New libc malloc patch X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2005 07:21:32 -0000 On Nov 29, 2005, at 2:52 AM, Hiten Pandya wrote: > I see that you have included an implementation of red-black tree CPP > macros, but wouldn't it be better if you were to use the ones in > ? I have only had a precursory look, but I would have > thought that would be the way to go. There's an updated patch available: http://www.canonware.com/~jasone/jemalloc/jemalloc_20051201a.diff This patch includes the following changes: *) Use sys/tree.h rather than a separate red-black tree implementation. *) Use the __isthreaded symbol to avoid locking for single-threaded programs, and to simplify malloc initialization. The extra branches that are required to check __isthreaded should be more than offset by the removal of an atomic compare/swap operation. *) Fix an obscure bug (very difficult to trigger without changing some compile-time constants). Jason