ta: introduce talloc_dup() and use it in some places

It was actually already implemented as ta_dup_ptrtype(), but that seems
like a clunky name. Also we still use the talloc_ names throughout the
source, and I'd rather use an old name instead of a mixing inconsistent
naming conventions.
This commit is contained in:
wm4
2018-01-18 10:08:48 +01:00
committed by Kevin Mitchell
parent 4d87c700e0
commit 6827901230
6 changed files with 12 additions and 12 deletions

View File

@@ -96,7 +96,7 @@ bool ta_vasprintf_append_buffer(char **str, const char *fmt, va_list ap) TA_PRF(
#define ta_steal(ta_parent, ptr) (TA_TYPEOF(ptr))ta_steal_(ta_parent, ptr)
#define ta_dup_ptrtype(ta_parent, ptr) \
#define ta_dup(ta_parent, ptr) \
(TA_TYPEOF(ptr))ta_memdup(ta_parent, ptr, sizeof(*(ptr)))
// Ugly macros that crash on OOM.
@@ -126,7 +126,7 @@ bool ta_vasprintf_append_buffer(char **str, const char *fmt, va_list ap) TA_PRF(
#define ta_xnew_array_size(...) ta_oom_p(ta_new_array_size(__VA_ARGS__))
#define ta_xnew_ptrtype(...) ta_oom_g(ta_new_ptrtype(__VA_ARGS__))
#define ta_xnew_array_ptrtype(...) ta_oom_g(ta_new_array_ptrtype(__VA_ARGS__))
#define ta_xdup_ptrtype(...) ta_oom_g(ta_dup_ptrtype(__VA_ARGS__))
#define ta_xdup(...) ta_oom_g(ta_dup(__VA_ARGS__))
#define ta_xsteal(ta_parent, ptr) (TA_TYPEOF(ptr))ta_xsteal_(ta_parent, ptr)
#define ta_xrealloc(ta_parent, ptr, type, count) \