X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;ds=sidebyside;f=src%2Fnmem.c;h=b76c555d0dea540840128a376be4faaa2749499f;hb=f25338b01de9ab9fb8dcc952b70b7b12b1e71c00;hp=2c7e202a8c903d62740c77074cae35606959b04d;hpb=c168cffc46e3b2b66e66e48f94f8e87b6566702b;p=yaz-moved-to-github.git diff --git a/src/nmem.c b/src/nmem.c index 2c7e202..b76c555 100644 --- a/src/nmem.c +++ b/src/nmem.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2006, 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.26 2006-12-13 15:28:28 adam Exp $ */ /** @@ -182,7 +182,7 @@ static int nmem_active_no = 0; static int nmem_init_flag = 0; /** \brief whether nmem blocks should be reassigned to heap */ -static int nmem_release_in_heap = 0; +static int nmem_release_in_heap = 1; #if NMEM_DEBUG struct nmem_debug_info { @@ -254,6 +254,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 +268,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; }