[lkml]   [2007]   [Aug]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: kfree(0) - ok?
    On 8/18/07, Thomas Gleixner <> wrote:
    > If yes, who invented this 1980s reminiscence, where you got valid
    > pointers for malloc(0) ?

    Well, kmalloc(0) has always been legal and traditionally returned a
    pointer to a smallest non-zero sized object. We did try to make
    kmalloc(0) illegal for a while but ended up fixing up a bunch of
    call-sites for little or no gain. I did propose that kmalloc(0) should
    return NULL but Linus and others pointed out that we can do better and
    not mix up out-of-memory and zero-sized allocations.
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2007-08-18 10:15    [W:0.020 / U:37.800 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site