tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: sys/malloc.h wrote:
>I'm working on an import of a giant pile of code, and ran into the
>following build error:
>drm_gem.c:987:23: error: macro "free" requires 2 arguments, but only 1 given
>   obj->funcs->free(obj);
>                       ^
>This was confusing for a bit, but apparently is due to sys/malloc.h:
>#define	free(addr, type)		kern_free(addr)
>This feels like a recipe for subtle bugs.
>What's our plan for this code?

I thought that we were supposed to eventually replace usage of
malloc/free/realloc in kernel code with the kern_*() equivalents.

What breaks if the three macros are commented out ?

Home | Main Index | Thread Index | Old Index