如果我在守则中使用这一宏观方法,那是安全的?
#define my_calloc(x, n) ((x) = (__typeof__ (x))calloc((n), sizeof(__typeof__ (&(x)))))
I 编织品......
In my programm there is a lot of memory allocation point, so I use this. I tried it 5 minutes ago and I get some weird sigabort and sigsev, now I m going home... after I ll try again if I can find something.
一些想法/计划?
EDIT ADDED:
总的来说,我使用以下宏观方法:
double *x;
my_calloc(x, 10);
int **y;
my_calloc(y, 30);