New OID database - with public definitions in oid_db.h. Removed old OID
[yaz-moved-to-github.git] / src / nmem.c
index 2c7e202..ce08d99 100644 (file)
@@ -1,8 +1,8 @@
 /*
- * Copyright (C) 1995-2006, Index Data ApS
+ * Copyright (C) 1995-2007, Index Data ApS
  * See the file LICENSE for details.
  *
- * $Id: nmem.c,v 1.24 2006-08-11 12:50:23 adam Exp $
+ * $Id: nmem.c,v 1.29 2007-04-12 13:52:57 adam Exp $
  */
 
 /**
@@ -27,7 +27,6 @@
 #include <yaz/xmalloc.h>
 #include <yaz/nmem.h>
 #include <yaz/log.h>
-#include <yaz/oid.h>
 
 #ifdef WIN32
 #include <windows.h>
@@ -254,6 +253,7 @@ static struct nmem_block *get_block(size_t size)
             l->next = r->next;
         else
             freelist = r->next;
+        nmem_memory_free -= r->size;
     }
     else
     {
@@ -267,8 +267,8 @@ static struct nmem_block *get_block(size_t size)
 
         r = (struct nmem_block *) xmalloc(sizeof(*r));
         r->buf = (char *)xmalloc(r->size = get);
-        nmem_memory_in_use += r->size;
     }
+    nmem_memory_in_use += r->size;
     r->top = 0;
     return r;
 }
@@ -498,7 +498,6 @@ void nmem_exit (void)
 {
     if (--nmem_init_flag == 0)
     {
-        oid_exit();
         while (freelist)
         {
             struct nmem_block *fl = freelist;