* Copyright (C) 1995-2006, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: nmem.c,v 1.25 2006-08-11 13:10:27 adam Exp $
+ * $Id: nmem.c,v 1.26 2006-12-13 15:28:28 adam Exp $
*/
/**
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 {
* Copyright (C) 1995-2005, Index Data ApS
* All rights reserved.
*
- * $Id: xmalloc.c,v 1.7 2006-04-21 10:28:07 adam Exp $
+ * $Id: xmalloc.c,v 1.8 2006-12-13 15:28:28 adam Exp $
*/
/**
* \file xmalloc.c
xmalloc_trav_d(file, line);
}
+void xmalloc_fatal(void)
+{
+ exit(1);
+}
+
void *xrealloc_f (void *o, size_t size, const char *file, int line)
{
void *p = xrealloc_d (o, size, file, line);
{
yaz_log (YLOG_FATAL|YLOG_ERRNO, "Out of memory, realloc (%ld bytes)",
(long) size);
- exit(1);
+ xmalloc_fatal();
}
return p;
}
{
yaz_log (YLOG_FATAL, "Out of memory - malloc (%ld bytes)",
(long) size);
- exit (1);
+ xmalloc_fatal();
}
return p;
}
{
yaz_log (YLOG_FATAL, "Out of memory - calloc (%ld, %ld)",
(long) nmemb, (long) size);
- exit (1);
+ xmalloc_fatal();
}
return p;
}