From 38aa97445769c6f1c54d59731b5a0edef91e41b0 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 26 Sep 2004 01:41:04 +0000 Subject: r2641: talloc_p() now produces a named talloc pointer, with the name auto-derived from the type you are allocating. This is done with basically zero overhead by relying on the stringify operator in cpp producing string constants. the result is that --leak-check nicely names all pointers that come from talloc_p() (This used to be commit bd86ebe2972af4d424df20db1e422919aa6203d0) --- source4/include/talloc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/include') diff --git a/source4/include/talloc.h b/source4/include/talloc.h index dec004b7ef..5af7fd1da0 100644 --- a/source4/include/talloc.h +++ b/source4/include/talloc.h @@ -25,7 +25,7 @@ typedef void TALLOC_CTX; /* useful macros for creating type checked pointers */ -#define talloc_p(ctx, type) (type *)talloc(ctx, sizeof(type)) +#define talloc_p(ctx, type) (type *)talloc_named_const(ctx, sizeof(type), #type) #define talloc_array_p(ctx, type, count) (type *)talloc_array(ctx, sizeof(type), count) #define talloc_realloc_p(p, type, count) (type *)talloc_realloc_array(p, sizeof(type), count) -- cgit