RB_GENERATE macro problem

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

RB_GENERATE macro problem

Jason Evans-2
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

_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "[hidden email]"