From owner-freebsd-net@FreeBSD.ORG Mon Oct 7 15:50:22 2013 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 487512E2 for ; Mon, 7 Oct 2013 15:50:22 +0000 (UTC) (envelope-from Eric_Van_Gyzen@dell.com) Received: from aussmtpmrkps320.us.dell.com (aussmtpmrkps320.us.dell.com [143.166.224.254]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0AEAC2CB2 for ; Mon, 7 Oct 2013 15:50:21 +0000 (UTC) X-Loopcount0: from 64.238.244.148 X-IronPort-AV: E=Sophos;i="4.90,1051,1371099600"; d="scan'208,217";a="54573797" Message-ID: <5252D7F7.3030709@dell.com> Date: Mon, 7 Oct 2013 10:49:11 -0500 From: Eric van Gyzen Organization: Dell, Inc. User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130702 Thunderbird/17.0.7 MIME-Version: 1.0 To: freebsd-net@freebsd.org Subject: sys/net/radix.h: #define Free(p) for user-land Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: Eric van Gyzen X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Oct 2013 15:50:22 -0000 The user-land definition of the Free() macro in sys/net/radix.h is rather inconvenient. I work on a large C++ code-base, where several classes define Free() functions. This header file gets indirectly included in a few modules (via nested #includes), so we have to #undef Free to work around this macro definition. Ideally, radix.h would define a more unique name, such as R_Free(). If I were using a C code-base, you could say the same about my code, but it's C++, and Free() is already well qualified by classes and/or namespaces. Is this Free() macro considered a well-defined, widely known, and therefore mandatory part of the API, or could it be renamed to something more unique? Alternatively, could it be changed to an inline function definition, so as not to conflict with declarations in other namespaces? If any of these is possible, I'll gladly provide the blindingly trivial patch, although I don't have a commit bit. Finding in-tree consumers of this macro is difficult, due to its generic name. Its counterparts--R_Malloc and R_Zalloc--only appear in sys/net/{radix,route,rtsock}.c (on head). The recent ipfilter update removed the only [potential] in-tree user-land consumer. Eric -- *Eric van Gyzen* Senior Software Development Engineer *Dell* | Compellent *office* +1 952 562 3197 Cube J-732, 7615 Smetana Lane Eden Prairie, MN 55344 eric_van_gyzen@dell.com