Much better and readable, with less code and the same result. Moreover this
makes some parsers not to kill themselves.
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/eina@50069
7cbeb6ba-43b4-40fd-8cce-
4c39aea84d33
Pool *
_evas_mp_pool_new(Evas_Mempool *pool)
-#ifdef NOPOOL
{
+#ifdef NOPOOL
static Pool thepool;
return &thepool;
-}
#else
-{
Pool *p;
void **ptr;
int item_alloc, i;
}
*ptr = NULL;
return p;
-}
#endif
+}
void
_evas_mp_pool_free(Pool *p)
-#ifdef NOPOOL
-{
-}
-#else
{
+#if !defined(NOPOOL)
free(p);
-}
#endif
+}
void *
evas_mempool_malloc(Evas_Mempool *pool, int size)
-#ifdef NOPOOL
{
+#ifdef NOPOOL
return malloc(size);
-}
#else
-{
Pool *p;
void *mem;
p->usage++;
pool->usage++;
return mem;
-}
#endif
+}
void
evas_mempool_free(Evas_Mempool *pool, void *ptr)
-#ifdef NOPOOL
{
+#ifdef NOPOOL
free(ptr);
-}
#else
-{
Pool *p;
void *pmem;
int item_alloc, psize;
break;
}
}
-}
#endif
+}
+
void *
evas_mempool_calloc(Evas_Mempool *pool, int size)
-#ifdef NOPOOL
{
+#ifdef NOPOOL
return calloc(1, size);
-}
#else
-{
void *mem;
mem = evas_mempool_malloc(pool, size);
memset(mem, 0, size);
return mem;
-}
#endif
+}
+