From owner-freebsd-hackers@FreeBSD.ORG Thu Jan 14 18:54:50 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8ECB0106566B for ; Thu, 14 Jan 2010 18:54:50 +0000 (UTC) (envelope-from delphij@gmail.com) Received: from mail-px0-f183.google.com (mail-px0-f183.google.com [209.85.216.183]) by mx1.freebsd.org (Postfix) with ESMTP id 65B828FC14 for ; Thu, 14 Jan 2010 18:54:50 +0000 (UTC) Received: by pxi13 with SMTP id 13so602259pxi.3 for ; Thu, 14 Jan 2010 10:54:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=jOnGk26vP146VNRfQjBZzF0w58rmXfiiQr5PyywCqmM=; b=HoDbP2WyRsC0F4kp2Sdi1z+cnY/o8fK2rAxfKNxwy6S4160jFq5Y8mWdG93WMcBmpG x7hzSu2acCXxybOOXjvjZdjpCJqXDQOyC9o6b71nzkZhHQCC+P1pW7oz3KCvR1eR/GGp 172lOz0Jwzd2Tz/NoPftS2uVtdZV/dDFyMrMY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=d0Mz9p285Z4pFSfnflLrPGoZ5ga2bMa06pzO+jVsVdlUzh0/fJBFOcsnpA18aqANp9 8KJiOmK/dALUdp7dUFfrx4BVamcFHIUtS79sTMEjUBP6qd+xvV9qfPcmzwuRyRJRPjNI +zhqwNyl170U35fYViMWE0rLR/0VXB2Wj+nqE= MIME-Version: 1.0 Received: by 10.115.26.7 with SMTP id d7mr837922waj.12.1263495283140; Thu, 14 Jan 2010 10:54:43 -0800 (PST) In-Reply-To: <739519.89145.qm@web15707.mail.cnb.yahoo.com> References: <739519.89145.qm@web15707.mail.cnb.yahoo.com> Date: Thu, 14 Jan 2010 10:54:42 -0800 Message-ID: From: Xin LI To: Jiandong Lu Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org Subject: Re: about libstdc++ ,change the defaule allocator X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 18:54:50 -0000 2010/1/13 Jiandong Lu : > hello,everyone. > =C2=A0 =C2=A0 I get the current source code from svn,and successfully bui= ld world. > =C2=A0 =C2=A0 c++'s standard library is from gnu. This library privodes m= any allocators: > bitmap_allocator_base > malloc_allocator_base > mt_allocator_base > new_allocator_base > pool_allocator_base > I want to know how to set a default allocator,and how to change it. > > I have read the Makefile: > /usr/src/gnu/lib/libstdc++/Makefile I have no idea why you will think the allocator is being changed here... The standard and portable way to override the allocator is at the point you instance C++ templates by specifing Allocator parameter. If, however, you want to globally change the default allocator without touching all your source files, the only way is to make modification on c++allocator.h, which is, in my opinion, never permitted by the standard and banned by god. Cheers, --=20 Xin LI http://www.delphij.net