lkml.org 
[lkml]   [2005]   [Jun]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: kmalloc without GFP_xxx?
    On Wed, Jun 29 2005, Denis Vlasenko wrote:
    > So why can't we have kmalloc_auto(size) which does GFP_KERNEL alloc
    > if called from non-atomic context and GFP_ATOMIC one otherwise?

    Because it's a lot better in generel if we force people to think about
    what they are doing wrt memory allocations. You should know if you are
    able to block or not, a lot of functions exported require you to have
    this knowledge anyways. Adding these auto-detection type functions
    encourages bad programming, imho.

    --
    Jens Axboe

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2005-06-29 13:19    [W:0.022 / U:0.984 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site