Re: [PATCH] type safe allocator

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Peter Zijlstra <peterz@...>
Cc: Alexey Dobriyan <adobriyan@...>, Miklos Szeredi <miklos@...>, <akpm@...>, <linux-kernel@...>, <linux-mm@...>, <torvalds@...>
Date: Thursday, August 2, 2007 - 10:06 am

On Thu, 2007-08-02 at 15:47 +0200, Peter Zijlstra wrote:

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)))

Obious drawback: We may need alloc_union().

SCNR ...
	Bernd
-- 
Firmix Software GmbH                   http://www.firmix.at/
mobil: +43 664 4416156                 fax: +43 1 7890849-55
          Embedded Linux Development and Services


-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] type safe allocator, Miklos Szeredi, (Thu Aug 2, 7:31 am)
Re: [PATCH] type safe allocator, Andrew Morton, (Thu Aug 2, 2:36 pm)
Re: [PATCH] type safe allocator, Miklos Szeredi, (Thu Aug 2, 2:48 pm)
Re: [PATCH] type safe allocator, Alexey Dobriyan, (Thu Aug 2, 8:04 am)
Re: [PATCH] type safe allocator, Peter Zijlstra, (Thu Aug 2, 9:47 am)
Re: [PATCH] type safe allocator, Bernd Petrovitsch, (Thu Aug 2, 10:06 am)
Re: [PATCH] type safe allocator, Jan Engelhardt, (Thu Aug 2, 10:08 am)
Re: [PATCH] type safe allocator, Jan Engelhardt, (Thu Aug 2, 8:24 am)
Re: [PATCH] type safe allocator, Miklos Szeredi, (Thu Aug 2, 9:06 am)
Re: [PATCH] type safe allocator, Jan Engelhardt, (Thu Aug 2, 9:35 am)
Re: [PATCH] type safe allocator, Miklos Szeredi, (Thu Aug 2, 9:49 am)