From owner-freebsd-arch@FreeBSD.ORG Wed Feb 8 21:51:24 2012 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D3F01065673 for ; Wed, 8 Feb 2012 21:51:24 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) by mx1.freebsd.org (Postfix) with ESMTP id 06B1B8FC1E for ; Wed, 8 Feb 2012 21:51:23 +0000 (UTC) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.4/8.14.4/ALCHEMY.FRANKEN.DE) with ESMTP id q18LpMQq028781; Wed, 8 Feb 2012 22:51:22 +0100 (CET) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.4/8.14.4/Submit) id q18LpMrw028780; Wed, 8 Feb 2012 22:51:22 +0100 (CET) (envelope-from marius) Date: Wed, 8 Feb 2012 22:51:22 +0100 From: Marius Strobl To: David Chisnall Message-ID: <20120208215122.GA28769@alchemy.franken.de> References: <58175263-109E-4FF0-BB29-E0331C01DCD5@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <58175263-109E-4FF0-BB29-E0331C01DCD5@FreeBSD.org> User-Agent: Mutt/1.4.2.3i Cc: freebsd-arch@freebsd.org Subject: Re: NO_TLS flag for public headers X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 21:51:24 -0000 On Wed, Feb 08, 2012 at 02:14:12PM +0000, David Chisnall wrote: > Hi, > > The xlocale changes in libc mean that a lot of things that were previously global state are now per-thread. This includes some things that were used in ctype.h and are inlined. We're now losing the benefit of inlining them because we now have to call into libc to get the per-thread values. I'd like to use TLS for caching these things, but we currently have no equivalent of the NO_TLS flag for public headers. I'd like to have a __NO_TLS that can be set in cdefs.h for architectures that don't have TLS support. > > Any comments? Objections? Anyone want to propose a better place for it (or, indeed, add it, since I'm not entirely sure which architectures do lack TLS support...) > See lib/libc/stdlib/malloc.c, arm and mips currently are the only supported FreeBSD architectures that have no support for TLS. Marius