malloc/free/realloc will be renamed in the kernel

Matthew Dillon dillon at apollo.backplane.com
Mon Sep 4 11:42:05 PDT 2006


    I've cleaned up most of the conflicts that would otherwise prevent
    kernel code from being linked against libc.  There are only a few
    remaining and really only one that entails a great deal of work...
    that being the kernel's malloc(), realloc(), and free() procedures.

    These procedures have very different arguments in the kernel then in
    userland, and they are called from about 800 files.

    After careful consideration I have decided to physically rename the
    kernel procedures rather then use #define tricks.   I have decided
    on the following translations:

    malloc -> kmalloc
    free -> kfree
    realloc -> krealloc

    Due to the number of files effected I am going to create shims so both
    names can be used during the transition period, which will allow me to
    piecemeal commit the actual work.  Once the work is done the original
    names will be removed.  I will write a program to run through the
    source code and make most of the changes automatically.  A few syntax
    glitches may occur during this process so bear with me!

    I will gone Wed-Fri so this work may extend into the coming weekend.

					-Matt
					Matthew Dillon 
					<dillon at xxxxxxxxxxxxx>





More information about the Kernel mailing list