cvs commit: src/sys/netgraph ng_device.c ng_device.h src/sys/modules/netgraph/device Makefile

Maxime Henrion mux at freebsd.org
Mon Oct 18 14:56:22 PDT 2004


Gleb Smirnoff wrote:
> glebius     2004-10-18 20:13:57 UTC
> 
>   FreeBSD src repository
> 
>   Modified files:
>     sys/netgraph         ng_device.c ng_device.h 
>     sys/modules/netgraph/device Makefile 
>   Log:
[...]
>      - Use MALLOC/FREE, instead of malloc/free.


This is backwards.  The MALLOC() and FREE() macros are deprecated, and
shouldn't be used in new code.  These macros were used because they
allowed an optimization when the size of the request is constant; some
computation was done at build-time rather than at run-time (if I
remember correctly, the computation is for getting the correct
power-of-2 free-list).  Anyways, this was with the McKusick-Karels
memory allocator, and these macros are not appropriate anymore, they
just obfuscate the code a bit.  I thought you'd like to know :-).

Thanks for the great work on ng_device!

Cheers,
Maxime


More information about the cvs-src mailing list