Hacker News new | ask | show | jobs
by cptaffe 3812 days ago
> #define mycalloc(N) calloc(1, N)

I am not a fan of the use of macros here. You should never use macros.

Instead maybe: static inline void *mycalloc(size_t sz) { return calloc(1, sz); }

1 comments

Why would you generally need to wrap calloc inside a macro or function? Just call calloc(1,sz)
Over years of development, this wrapper can save tens of seconds of time!