#include extern void my_fast_free(void *); extern void my_checking_free(void *); static inline void my_kfree( void *ptr ) { #ifdef CASE_A register int is_null = 0; if (ptr == NULL) is_null = 1; if (__builtin_constant_p(is_null)) { #else /* CASE_B */ if (__builtin_constant_p(ptr==NULL)) { #endif if (ptr != NULL) my_fast_free(ptr); } else { my_slow_free(ptr); } } void test( int *bla ) { char *hello = NULL; my_kfree(hello); my_kfree(bla); *bla = 1; my_kfree(bla); }