diff options
author | Stefan Metzmacher <metze@samba.org> | 2006-08-28 16:55:51 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:16:51 -0500 |
commit | 5ed074715a7d63b803d5eaff3144a48304201df3 (patch) | |
tree | ef049b347d788f7e061a6106d88fbd4575a72179 /source4/lib/talloc/talloc.h | |
parent | 82d4c5095dab0b5c1011fd9f5b865a7c07715a7a (diff) | |
download | samba-5ed074715a7d63b803d5eaff3144a48304201df3.tar.gz samba-5ed074715a7d63b803d5eaff3144a48304201df3.tar.bz2 samba-5ed074715a7d63b803d5eaff3144a48304201df3.zip |
r17886: add talloc_ptrtype() and talloc_array_ptrtype(),
see the manpage what they do:-)
metze
(This used to be commit bfca83c91e47e9017474809cd7bc8b2e6e20416a)
Diffstat (limited to 'source4/lib/talloc/talloc.h')
-rw-r--r-- | source4/lib/talloc/talloc.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/source4/lib/talloc/talloc.h b/source4/lib/talloc/talloc.h index fec2e8d8d7..40351693fa 100644 --- a/source4/lib/talloc/talloc.h +++ b/source4/lib/talloc/talloc.h @@ -74,6 +74,7 @@ typedef void TALLOC_CTX; /* useful macros for creating type checked pointers */ #define talloc(ctx, type) (type *)talloc_named_const(ctx, sizeof(type), #type) #define talloc_size(ctx, size) talloc_named_const(ctx, size, __location__) +#define talloc_ptrtype(ctx, ptr) (_TALLOC_TYPEOF(ptr))talloc_size(ctx, sizeof(*(ptr))) #define talloc_new(ctx) talloc_named_const(ctx, 0, "talloc_new: " __location__) @@ -83,6 +84,7 @@ typedef void TALLOC_CTX; #define talloc_zero_array(ctx, type, count) (type *)_talloc_zero_array(ctx, sizeof(type), count, #type) #define talloc_array(ctx, type, count) (type *)_talloc_array(ctx, sizeof(type), count, #type) #define talloc_array_size(ctx, size, count) _talloc_array(ctx, size, count, __location__) +#define talloc_array_ptrtype(ctx, ptr, count) (_TALLOC_TYPEOF(ptr))talloc_array_size(ctx, sizeof(*(ptr)), count) #define talloc_realloc(ctx, p, type, count) (type *)_talloc_realloc_array(ctx, p, sizeof(type), count, #type) #define talloc_realloc_size(ctx, ptr, size) _talloc_realloc(ctx, ptr, size, __location__) |