From owner-freebsd-threads@FreeBSD.ORG Sat May 31 10:36:54 2008 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C0FF9106564A; Sat, 31 May 2008 10:36:54 +0000 (UTC) (envelope-from deischen@freebsd.org) Received: from mail.netplex.net (mail.netplex.net [204.213.176.10]) by mx1.freebsd.org (Postfix) with ESMTP id 7CE558FC18; Sat, 31 May 2008 10:36:54 +0000 (UTC) (envelope-from deischen@freebsd.org) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) by mail.netplex.net (8.14.3/8.14.3/NETPLEX) with ESMTP id m4VAaqqC011220; Sat, 31 May 2008 06:36:53 -0400 (EDT) X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.netplex.net) X-Greylist: Message whitelisted by DRAC access database, not delayed by milter-greylist-4.0 (mail.netplex.net [204.213.176.10]); Sat, 31 May 2008 06:36:53 -0400 (EDT) Date: Sat, 31 May 2008 06:36:52 -0400 (EDT) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net To: David Xu In-Reply-To: <48408D5E.2010609@freebsd.org> Message-ID: References: <483FA1C0.2010506@freebsd.org> <200805301748.29689.jhb@freebsd.org> <48408D5E.2010609@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-threads@freebsd.org Subject: Re: pthread_cleanup_push as a macro X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Daniel Eischen List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 May 2008 10:36:54 -0000 On Sat, 31 May 2008, David Xu wrote: > Daniel Eischen wrote: >> On Fri, 30 May 2008, John Baldwin wrote: >> >>> On Friday 30 May 2008 02:42:08 am David Xu wrote: >>>> I would like to make pthread_cleanup_push and pthread_cleanup_pop as a >>>> pair of macros, the current implementation has to malloc() and free() a >>>> pthread_cleanup memory block everytime, this is slow, the new one >>>> simply uses stack space, note that other OSes have already done it in >>>> this way. The patch keeps old functions and should not have binary >>>> compatible problem. >>>> >>>> http://people.freebsd.org/~davidxu/patch/pthread_cleanup_push.patch >>> >>> Please do! >> >> I agree - Solaris does this too. I am unsure why you really need >> a strong_reference - I would prefer something that doesn't require >> it. >> > > This becauses original _pthread_cleanup_push and _pthread_cleanup_pop are > functions but not weak aliases, it is to keep compatibility. Yes, but _pthread_cleanup_push and _pthread_cleanup_pop are still functions, you are just adding _imp. Are you afraid of _imp being overridden (if it was a weak alias)? I think another tool you could use is __sym_default(__pthread_cleanup_pop_imp, _pthread_cleanup_pop, FBSD_1.1) -- DE