sys/net/radix.h: #define Free(p) for user-land

Eric van Gyzen eric_van_gyzen at dell.com
Tue Oct 8 18:48:35 UTC 2013


On 10/08/2013 13:19, Gleb Smirnoff wrote:
> 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.

Gleb,

It's running now.  Thanks for your help.

By the way, how much disk space does a "make universe" need nowadays?

> 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))
>
>



More information about the freebsd-net mailing list