Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759345AbXFBCQB (ORCPT ); Fri, 1 Jun 2007 22:16:01 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752035AbXFBCPy (ORCPT ); Fri, 1 Jun 2007 22:15:54 -0400 Received: from netops-testserver-4-out.sgi.com ([192.48.171.29]:47031 "EHLO relay.sgi.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751786AbXFBCPy (ORCPT ); Fri, 1 Jun 2007 22:15:54 -0400 Date: Fri, 1 Jun 2007 19:15:53 -0700 (PDT) From: Christoph Lameter X-X-Sender: clameter@schroedinger.engr.sgi.com To: "John Anthony Kazos Jr." cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org, Linus Torvalds , Jeremy Fitzhardinge Subject: Re: SLUB: Return ZERO_SIZE_PTR for kmalloc(0) In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 893 Lines: 20 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/