Mark memory as accessable before popping it from stack.
authorrfonseca <rfonseca>
Thu, 14 Oct 2010 19:24:00 +0000 (19:24 +0000)
committerrfonseca <rfonseca@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 14 Oct 2010 19:24:00 +0000 (19:24 +0000)
When we push a memory to the trash stack we mark it as unaccessable. So we
should mark it as accessible before returning it to the user.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@53427 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/modules/mp/chained_pool/eina_chained_mempool.c

index a4e143c..859d44b 100644 (file)
@@ -192,8 +192,13 @@ eina_chained_mempool_malloc(void *data, __UNUSED__ unsigned int size)
           p->last = NULL;
      }
    else
-     // Request a free pointer
-     mem = eina_trash_pop(&p->base);
+     {
+#ifndef NVALGRIND
+        VALGRIND_MAKE_MEM_DEFINED(p->base, pool->item_alloc);
+#endif
+        // Request a free pointer
+        mem = eina_trash_pop(&p->base);
+     }
 
    // move to end - it just filled up
    if (!p->base && !p->last)