Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932853AbXFEO73 (ORCPT ); Tue, 5 Jun 2007 10:59:29 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932290AbXFEO7V (ORCPT ); Tue, 5 Jun 2007 10:59:21 -0400 Received: from smtpq1.tilbu1.nb.home.nl ([213.51.146.200]:35804 "EHLO smtpq1.tilbu1.nb.home.nl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932227AbXFEO7U (ORCPT ); Tue, 5 Jun 2007 10:59:20 -0400 Message-ID: <46657988.6060901@gmail.com> Date: Tue, 05 Jun 2007 16:56:08 +0200 From: Rene Herman User-Agent: Thunderbird 1.5.0.12 (X11/20070509) MIME-Version: 1.0 To: Jeremy Fitzhardinge CC: "John Anthony Kazos Jr." , Christoph Lameter , Andrew Morton , Pekka Enberg , Linus Torvalds , linux-kernel@vger.kernel.org Subject: Re: SLUB: Return ZERO_SIZE_PTR for kmalloc(0) References: <84144f020706041213x1d241794u98e9b3ca29865033@mail.gmail.com> <46646747.2080803@cs.helsinki.fi> <20070604155355.bf29a3a8.akpm@linux-foundation.org> <466523E0.3050605@gmail.com> <46655CEC.7070900@gmail.com> <466575EE.70901@goop.org> In-Reply-To: <466575EE.70901@goop.org> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-AtHome-MailScanner-Information: Please contact support@home.nl for more information X-AtHome-MailScanner: Found to be clean Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1230 Lines: 28 On 06/05/2007 04:40 PM, Jeremy Fitzhardinge wrote: > Rene Herman wrote: >> No, what we have is a sizeof(pointer) sized pointer pointing to an >> object of size zero. ZERO_SIZE_PTR is butt-ugly. With a really ugly butt. > > It doesn't matter. It will never, ever, be used by anything except the > kmalloc internals. No client code should ever use the constant for > anything. Yes, I'm aware of this (I should snip less) but I still feel it's not a good name. When I read say "a 64-bit pointer" I immediately take that to mean a pointer of size 64-bit, not a pointer to 64-bits and only it not making any sense would stop me from interpreting "ZERO_SIZE_PTR" similarly. Yes, it's internal but given that this is open-source which, optimistically, is read many more times than it's written one should still strive for code that reads nice as far as I'm concerned. It's obviously also not hugely important but it's just that ZERO_SIZE_PTR makes my neck hair stand up. Rene. - 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/