/* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2010 Index Data
+ * Copyright (C) 1995-2013 Index Data
* See the file LICENSE for details.
*/
static int log_level_initialized = 0;
static void free_block(struct nmem_block *p)
-{
+{
xfree(p->buf);
xfree(p);
if (log_level)
if (log_level)
yaz_log(log_level, "nmem get_block alloc new block size=%ld",
(long) get);
-
+
r = (struct nmem_block *) xmalloc(sizeof(*r));
r->buf = (char *)xmalloc(r->size = get);
r->top = 0;
void nmem_reset(NMEM n)
{
struct nmem_block *t;
-
+
yaz_log(log_level, "nmem_reset p=%p", n);
if (!n)
return;
log_level = yaz_log_module_level("nmem");
log_level_initialized = 1;
}
-
+
r = (struct nmem_control *)xmalloc(sizeof(*r));
r->blocks = 0;
{
if (!n)
return;
-
+
nmem_reset(n);
xfree(n);
}