lkml.org 
[lkml]   [2007]   [Jun]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: SLUB: Return ZERO_SIZE_PTR for kmalloc(0)
On Fri, 1 Jun 2007, John Anthony Kazos Jr. wrote:

> > + * The behavior for zero sized allocs changes. We no longer
> > + * allocate memory but return ZERO_SIZE_PTR.
> > + * WARN so that people can review and fix their code.
>
> I don't see why people have so much opposition to zero-size memory
> allocations. There's all sorts of situations where you want a resizeable
> array that may have zero objects, especially in these days of
> hotpluggability.

In case you have not read the description to the end: This patch does
exactly what you want and legitimizes zero size object use. The warning
will be remove before 2.6.22 is released.

-
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: 2007-06-02 04:19    [W:0.213 / U:0.172 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site