diff options
author | Andrew Tridgell <tridge@samba.org> | 2004-09-26 01:41:04 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:59:15 -0500 |
commit | 38aa97445769c6f1c54d59731b5a0edef91e41b0 (patch) | |
tree | 0dfc9a9e23fe9259cc74df4f6493b2867e99494c /source4/include | |
parent | b295256ea2f71a4fe3b16e0348b907f6ef73167b (diff) | |
download | samba-38aa97445769c6f1c54d59731b5a0edef91e41b0.tar.gz samba-38aa97445769c6f1c54d59731b5a0edef91e41b0.tar.bz2 samba-38aa97445769c6f1c54d59731b5a0edef91e41b0.zip |
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)
Diffstat (limited to 'source4/include')
-rw-r--r-- | source4/include/talloc.h | 2 |
1 files changed, 1 insertions, 1 deletions
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) |