From owner-freebsd-arch@FreeBSD.ORG Tue Jan 17 18:18:45 2006 Return-Path: X-Original-To: freebsd-arch@freebsd.org Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 38C3616A41F for ; Tue, 17 Jan 2006 18:18:45 +0000 (GMT) (envelope-from jasone@FreeBSD.org) Received: from lh.synack.net (lh.synack.net [204.152.188.37]) by mx1.FreeBSD.org (Postfix) with ESMTP id E01F943D46 for ; Tue, 17 Jan 2006 18:18:44 +0000 (GMT) (envelope-from jasone@FreeBSD.org) Received: by lh.synack.net (Postfix, from userid 100) id C629C5E48AA; Tue, 17 Jan 2006 10:18:44 -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 3C4515E48AA for ; Tue, 17 Jan 2006 10:18:44 -0800 (PST) Mime-Version: 1.0 (Apple Message framework v746.2) Content-Transfer-Encoding: 7bit Message-Id: <185CB7FA-438D-4D01-B673-2081A6B462CD@FreeBSD.org> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed To: freebsd-arch@freebsd.org From: Jason Evans Date: Tue, 17 Jan 2006 10:18:41 -0800 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 Subject: RB_GENERATE macro problem 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: Tue, 17 Jan 2006 18:18:45 -0000 Andrey Chernov pointed out that jemalloc has several public symbols that should be static. Among the offending symbols are those generated by the RB_GENERATE macro in sys/tree.h. RB_GENERATE provides no mechanism for making the generated functions static, so I'd like to create new interfaces: RB_PROTOTYPE_STATIC and RB_GENERATE_STATIC. This does not introduce any incompatibilities, as far as I know. There is a complete patch at: http://people.freebsd.org/~jasone/patches/RB_static.diff In short, this patch does the following: -------- #define RB_GENERATE(name, type, field, cmp) \ RB_GENERATE_INTERNAL(name, type, field, cmp,) #define RB_GENERATE_STATIC(name, type, field, cmp) \ RB_GENERATE_INTERNAL(name, type, field, cmp, static) #define RB_GENERATE_INTERNAL(name, type, field, cmp, attr) \ attr void \ name##_RB_INSERT_COLOR(struct name *head, struct type *elm) \ [...] -------- Does anyone have any reservations about this change, or suggestions for a better method? Thanks, Jason