Update copyright dates.
[gcc.git] / gcc / ggc.h
index c22fc37371132953a5c4d6f3995ac78d68e0d0d2..4ab10e3dd2b4304852b32bd81c0a66a4eb6a4966 100644 (file)
--- a/gcc/ggc.h
+++ b/gcc/ggc.h
@@ -1,6 +1,6 @@
 /* Garbage collection for the GNU compiler.
 
-   Copyright (C) 1998-2019 Free Software Foundation, Inc.
+   Copyright (C) 1998-2020 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -242,6 +242,16 @@ ggc_alloc_atomic (size_t s CXX_MEM_STAT_INFO)
     return ggc_internal_alloc (s PASS_MEM_STAT);
 }
 
+/* Call destructor and free the garbage collected memory.  */
+
+template <typename T>
+inline void
+ggc_delete (T *ptr)
+{
+  ptr->~T ();
+  ggc_free (ptr);
+}
+
 /* Allocate a gc-able string, and fill it with LENGTH bytes from CONTENTS.
    If LENGTH is -1, then CONTENTS is assumed to be a
    null-terminated string and the memory sized accordingly.  */