Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756254AbXHBOJL (ORCPT ); Thu, 2 Aug 2007 10:09:11 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755674AbXHBOIx (ORCPT ); Thu, 2 Aug 2007 10:08:53 -0400 Received: from sovereign.computergmbh.de ([85.214.69.204]:40918 "EHLO sovereign.computergmbh.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755583AbXHBOIw (ORCPT ); Thu, 2 Aug 2007 10:08:52 -0400 Date: Thu, 2 Aug 2007 16:08:51 +0200 (CEST) From: Jan Engelhardt To: Bernd Petrovitsch cc: Peter Zijlstra , Alexey Dobriyan , Miklos Szeredi , akpm@linux-foundation.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, torvalds@linux-foundation.org Subject: Re: [PATCH] type safe allocator In-Reply-To: <1186063605.8085.82.camel@tara.firmix.at> Message-ID: References: <1186062476.12034.115.camel@twins> <1186063605.8085.82.camel@tara.firmix.at> 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: 794 Lines: 25 On Aug 2 2007 16:06, Bernd Petrovitsch wrote: >> thrice in some cases like alloc_struct(struct task_struct, GFP_KERNEL) > >Save the explicit "struct" and put it into the macro (and force people >to not use typedefs). > >#define alloc_struct(type, flags) ((type *)kmalloc(sizeof(struct type), (flags))) #define alloc_struct(type, flags) ((struct type *)kmalloc(sizeof(struct type), (flags))) >Obious drawback: We may need alloc_union(). >SCNR. And we still don't have something to allocate a bunch of ints. [kmalloc(sizeof(int)*5,GFP)] Jan -- - 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/