lkml.org 
[lkml]   [2006]   [Jun]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2.6.17-rc6 1/9] Base support for kmemleak
On 13/06/06, Pekka Enberg <penberg@cs.helsinki.fi> wrote:
> On 6/11/06, Catalin Marinas <catalin.marinas@gmail.com> wrote:
> > --- /dev/null
> > +++ b/include/linux/memleak.h
> > @@ -0,0 +1,83 @@
> > +extern void memleak_scan_area(const void *ptr, unsigned long offset, size_t length);
> > +extern void memleak_insert_aliases(struct memleak_offset *ml_off_start,
> > + struct memleak_offset *ml_off_end);
> > +
> > +#define memleak_erase(ptr) do { (ptr) = NULL; } while (0)
>
> Use static inline functions instead of macros, please.

That was the simplest way in some cases when kmemleak was not
dependent on DEBUG_SLAB obj_size() in mm/slab.c was not always
defined. It works correctly with inlining now so I'll change them.

> > +#define memleak_container(type, member)

This cannot be an inline function as it takes a type as argument.

> > +static int __initdata preinit_pos = 0;
>
> Unnecessary initialization to zero.
>
> > +static struct memleak_pointer *last_pointer = NULL;
>
> Same here for NULL.

True, it is unnecessary. That's just my style of marking them as initialised.

> > +static int insert_alias(unsigned long size, unsigned long offset)
> > +{
> > + int ret = 0;
>
> Unnecessary initialization to zero.

That's needed because there is an exit path which doesn't set this variable.

I am OK with the other comments. Thanks.

--
Catalin
-
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/

\
 
 \ /
  Last update: 2006-06-13 14:50    [W:0.070 / U:13.336 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site