From owner-freebsd-threads@FreeBSD.ORG Fri May 30 06:40:36 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 B400F1065672 for ; Fri, 30 May 2008 06:40:36 +0000 (UTC) (envelope-from davidxu@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 7DF0A8FC1C for ; Fri, 30 May 2008 06:40:36 +0000 (UTC) (envelope-from davidxu@freebsd.org) Received: from apple.my.domain (root@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m4U6eXU6099548 for ; Fri, 30 May 2008 06:40:35 GMT (envelope-from davidxu@freebsd.org) Message-ID: <483FA1C0.2010506@freebsd.org> Date: Fri, 30 May 2008 14:42:08 +0800 From: David Xu User-Agent: Thunderbird 2.0.0.9 (X11/20071211) MIME-Version: 1.0 To: freebsd-threads@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: pthread_cleanup_push as a macro X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2008 06:40:36 -0000 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 David Xu