+/**
+ * mono_mempool_contains_addr:
+ *
+ * Determines whenever ADDR is inside the memory used by the mempool.
+ */
+gboolean
+mono_mempool_contains_addr (MonoMemPool *pool,
+ gpointer addr)
+{
+ MonoMemPool *p;
+
+ p = pool;
+ while (p) {
+ if (addr > (gpointer)p && addr <= (gpointer)((guint8*)p + p->size))
+ return TRUE;
+ p = p->next;
+ }
+
+ return FALSE;
+}
+
+/**
+ * mono_mempool_strdup:
+ *
+ * Same as strdup, but allocates memory from the mempool.
+ * Returns: a pointer to the newly allocated string data inside the mempool.
+ */
+char*
+mono_mempool_strdup (MonoMemPool *pool,
+ const char *s)
+{
+ int l;
+ char *res;
+
+ if (s == NULL)
+ return NULL;
+
+ l = strlen (s);
+ res = mono_mempool_alloc (pool, l + 1);
+ memcpy (res, s, l + 1);
+
+ return res;
+}
+
+/**
+ * mono_mempool_get_allocated:
+ *
+ * Return the amount of memory allocated for this mempool.
+ */
+guint32
+mono_mempool_get_allocated (MonoMemPool *pool)
+{
+ return pool->d.allocated;
+}