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:


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?


[hidden email] mailing list
To unsubscribe, send any mail to "[hidden email]"