Index: /trunk/src/kmk/alloccache.c
===================================================================
--- /trunk/src/kmk/alloccache.c	(revision 2632)
+++ /trunk/src/kmk/alloccache.c	(revision 2633)
@@ -54,6 +54,7 @@
 alloccache_free (struct alloccache *cache, void *item)
 {
+#ifndef CONFIG_WITH_ALLOCCACHE_DEBUG
   struct alloccache_free_ent *f = (struct alloccache_free_ent *)item;
-#if 0 /*ndef NDEBUG*/
+# if 0 /*ndef NDEBUG*/
   struct alloccache_free_ent *c;
   unsigned int i = 0;
@@ -61,9 +62,12 @@
     MY_ASSERT_MSG (c != f && i < 0x10000000,
                    ("i=%u total_count=%u\n", i, cache->total_count));
-#endif
+# endif
 
   f->next = cache->free_head;
   cache->free_head = f;
   MAKE_STATS(cache->free_count++;);
+#else
+  free(item);
+#endif
 }
 
@@ -79,4 +83,5 @@
 alloccache_alloc_grow (struct alloccache *cache)
 {
+#ifndef CONFIG_WITH_ALLOCCACHE_DEBUG
   void *item;
   unsigned int items = (64*1024 - 32) / cache->size;
@@ -85,8 +90,8 @@
   cache->total_count+= items;
 
-#ifndef NDEBUG /* skip the first item so the heap can detect free(). */
+# ifndef NDEBUG /* skip the first item so the heap can detect free(). */
   cache->total_count--;
   cache->free_start += cache->size;
-#endif
+# endif
 
   item = cache->free_start;
@@ -94,4 +99,7 @@
   /* caller counts */
   return (struct alloccache_free_ent *)item;
+#else
+  return (struct alloccache_free_ent *)xmalloc(cache->size);
+#endif
 }
 
Index: /trunk/src/kmk/make.h
===================================================================
--- /trunk/src/kmk/make.h	(revision 2632)
+++ /trunk/src/kmk/make.h	(revision 2633)
@@ -639,5 +639,7 @@
 alloccache_alloc (struct alloccache *cache)
 {
-  struct alloccache_free_ent *f = cache->free_head;
+  struct alloccache_free_ent *f;
+# ifndef CONFIG_WITH_ALLOCCACHE_DEBUG
+  f = cache->free_head;
   if (f)
     cache->free_head = f->next;
@@ -648,4 +650,5 @@
     }
   else
+# endif
     f = alloccache_alloc_grow (cache);
   MAKE_STATS(cache->alloc_count++;);
