From owner-freebsd-net@FreeBSD.ORG Tue Oct 8 18:20:09 2013 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 56C31FCA for ; Tue, 8 Oct 2013 18:20:09 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D3C1C2657 for ; Tue, 8 Oct 2013 18:20:08 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.7/8.14.7) with ESMTP id r98IJvjs024238; Tue, 8 Oct 2013 22:19:57 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.7/8.14.7/Submit) id r98IJuaY024237; Tue, 8 Oct 2013 22:19:56 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 8 Oct 2013 22:19:56 +0400 From: Gleb Smirnoff To: Eric van Gyzen Subject: Re: sys/net/radix.h: #define Free(p) for user-land Message-ID: <20131008181956.GD22563@glebius.int.ru> References: <5252D7F7.3030709@dell.com> <20131008141504.GA22563@FreeBSD.org> <52541ABF.70101@dell.com> <5254495E.3050206@dell.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5254495E.3050206@dell.com> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-net@freebsd.org, 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: Tue, 08 Oct 2013 18:20:09 -0000 Eric, On Tue, Oct 08, 2013 at 01:05:18PM -0500, Eric van Gyzen wrote: E> > So true. :) Before I bothered, I just wanted to ask if a change was E> > impractical due to API commitments with several known out-of-tree E> > consumers. Hearing no such replies, I'll test a patch. E> E> I simply renamed Free to R_Free, and buildworld succeeded. I built head E> r256133 on amd64 with no make.conf or src.conf. E> E> So, there are [probably] no in-tree consumers. The question then E> becomes, do we need these user-land definitions at all? I suppose we'd better have. The radix code was designed so that it could be tested in userland. Probably it isn't compilable nowadays, but R_Free() won't hurt anyone. I'd appreciate if you run universe build for this change. We are in release cycle now and any build breakage can hurt release process. If universe succeeds, we can check it in. E> diff --git a/sys/net/radix.h b/sys/net/radix.h E> index 5bacaa3..1c8d654 100644 E> --- a/sys/net/radix.h E> +++ b/sys/net/radix.h E> @@ -141,7 +141,7 @@ struct radix_node_head { E> #ifndef _KERNEL E> #define R_Malloc(p, t, n) (p = (t) malloc((unsigned int)(n))) E> #define R_Zalloc(p, t, n) (p = (t) calloc(1,(unsigned int)(n))) E> -#define Free(p) free((char *)p); E> +#define R_Free(p) free((char *)p); E> #else E> #define R_Malloc(p, t, n) (p = (t) malloc((unsigned long)(n), M_RTABLE, M_NOWAIT)) E> #define R_Zalloc(p, t, n) (p = (t) malloc((unsigned long)(n), M_RTABLE, M_NOWAIT | M_ZERO)) -- Totus tuus, Glebius.