Hi, One short coming of macro has keep entertaining me until i figure out what was wrong, here is a simple scenario :
Macro can lead to hard to debug list bugs. For instance consider the following : LIST_ADD(item, list->prev) 3 instruction of the macro became : (list->prev)->next->prev = item which is equivalent to : list->prev = item Thus list prev field changes and next instruction in the macro (list->prev)->next = item became : item->next = item And you endup with list corruption, other case lead to similar list corruption. Inline function are not affected by this short coming Thus i propose to switch list manipulation from macro to inline function, attached patch does exactly that. If there is no objection in next couple of week i will merge it. (to avoid mass renaming it keeps the macro that just wrap the functions it also add a bunch of new list walking helper) Cheers, Jerome
0001-gallium-list-use-inline-function-to-avoid-macro-shot.patch
Description: Binary data
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev