]> source.dussan.org Git - rspamd.git/commitdiff
Add routine to free PtrArray from mempool destructors.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 12 Mar 2015 14:19:42 +0000 (14:19 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 12 Mar 2015 14:19:42 +0000 (14:19 +0000)
src/libutil/util.c
src/libutil/util.h

index 4a125c5602aade8d322781b0535906927e5f0335..9967a18ef746d2d8470d2919f2d17d61cd92910e 100644 (file)
@@ -2260,3 +2260,12 @@ randombytes (guchar *buf, guint64 len)
 {
        ottery_rand_bytes (buf, (size_t)len);
 }
+
+
+void
+rspamd_ptr_array_free_hard (gpointer p)
+{
+       GPtrArray *ar = (GPtrArray *)p;
+
+       g_ptr_array_free (ar, TRUE);
+}
index 8e3fe090f38514e89f091359f09dedc24d09ea0b..b0825bfbf0832a2fcac552ef9aebcefaa2b4764b 100644 (file)
@@ -441,4 +441,10 @@ guchar* rspamd_decode_base32 (const gchar *in, gsize inlen, gsize *outlen);
  */
 gdouble rspamd_get_ticks (void);
 
+/**
+ * Special utility to help array freeing in rspamd_mempool
+ * @param p
+ */
+void rspamd_ptr_array_free_hard (gpointer p);
+
 #endif