Introduce and use make_unique_xstrdup
[deliverable/binutils-gdb.git] / gdb / common / gdb_unique_ptr.h
index a4be2bb796387678939306235dc2d26afb10fbcf..67a5f265353ffe3b75c960ee141b1220cf8ef351 100644 (file)
@@ -56,4 +56,12 @@ struct noop_deleter
 
 } /* namespace gdb */
 
+/* Dup STR and return a unique_xmalloc_ptr for the result.  */
+
+static inline gdb::unique_xmalloc_ptr<char>
+make_unique_xstrdup (const char *str)
+{
+  return gdb::unique_xmalloc_ptr<char> (xstrdup (str));
+}
+
 #endif /* COMMON_GDB_UNIQUE_PTR_H */
This page took 0.025045 seconds and 4 git commands to generate.