[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b0943d9e0607240628n115deac4x3befe5d39037248f@mail.gmail.com>
Date: Mon, 24 Jul 2006 14:28:03 +0100
From: "Catalin Marinas" <catalin.marinas@...il.com>
To: "Ingo Molnar" <mingo@...e.hu>
Cc: "Pekka Enberg" <penberg@...helsinki.fi>,
linux-kernel@...r.kernel.org,
"Arjan van de Ven" <arjan@...radead.org>
Subject: Re: [PATCH 2.6.17-rc6 7/9] Remove some of the kmemleak false positives
On 24/07/06, Ingo Molnar <mingo@...e.hu> wrote:
> update: there's also a neat gcc extension trick suggested by Arjan:
> __builtin_classify_type(). This converts types into integers!
It's not really reliable as it doesn't distinguish well between types.
All the structures, no matter what they contain, have the same id
(which I think only refers to the fact that it is built-in type,
pointer or structure, without differentiation).
The attached code gives the following results:
typeof(a) = 12, sizeof(a) = 136
typeof(b) = 12, sizeof(b) = 8
typeof(c) = 1, sizeof(c) = 4
typeof(d) = 1, sizeof(d) = 4
typeof(e) = 1, sizeof(e) = 4
typeof(f) = 1, sizeof(f) = 1
typeof(g) = 5, sizeof(g) = 4
typeof(h) = 5, sizeof(h) = 4
--
Catalin
View attachment "builtin_classify_type.c" of type "text/x-csrc" (506 bytes)
Powered by blists - more mailing lists