Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 8 Oct 2013 22:19:56 +0400
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        Eric van Gyzen <eric_van_gyzen@dell.com>
Cc:        freebsd-net@freebsd.org, Eric van Gyzen <eric@vangyzen.net>
Subject:   Re: sys/net/radix.h: #define Free(p) for user-land
Message-ID:  <20131008181956.GD22563@glebius.int.ru>
In-Reply-To: <5254495E.3050206@dell.com>
References:  <5252D7F7.3030709@dell.com> <20131008141504.GA22563@FreeBSD.org> <52541ABF.70101@dell.com> <5254495E.3050206@dell.com>

next in thread | previous in thread | raw e-mail | index | archive | help
  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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20131008181956.GD22563>