1 2 3 4 5 6 7 8 9 10 11 12
/* Example of extra argument to "malloc" attribute. */ struct foo; extern void foo_release (int, struct foo *); extern struct foo *foo_acquire (void) __attribute__ ((malloc (foo_release, 2))); void test_1 (void) { struct foo *p = foo_acquire (); foo_release (0, p); }