projects
/
yaz-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Not buffering the log file, unless LOG_FLUSH is set. Reopening if necessary
[yaz-moved-to-github.git]
/
src
/
nmem.c
diff --git
a/src/nmem.c
b/src/nmem.c
index
2526dbb
..
9738a6f
100644
(file)
--- a/
src/nmem.c
+++ b/
src/nmem.c
@@
-1,12
+1,14
@@
/*
/*
- * Copyright (c) 1995-2003, Index Data.
+ * Copyright (c) 1995-2004, Index Data.
* See the file LICENSE for details.
* See the file LICENSE for details.
- * Sebastian Hammer, Adam Dickmeiss
*
*
- * $Id: nmem.c,v 1.1 2003-10-27 12:21:32 adam Exp $
+ * $Id: nmem.c,v 1.4 2004-10-15 00:19:00 adam Exp $
*/
*/
-/*
+/**
+ * \file nmem.c
+ * \brief Implements Nibble Memory
+ *
* This is a simple and fairly wasteful little module for nibble memory
* allocation. Evemtually we'll put in something better.
*/
* This is a simple and fairly wasteful little module for nibble memory
* allocation. Evemtually we'll put in something better.
*/
@@
-138,6
+140,7
@@
struct nmem_debug_info *nmem_debug_list = 0;
static void free_block(nmem_block *p)
{
static void free_block(nmem_block *p)
{
+ memset(p->buf, 'Y', p->size);
p->next = freelist;
freelist = p;
#if NMEM_DEBUG
p->next = freelist;
freelist = p;
#if NMEM_DEBUG
@@
-148,12
+151,17
@@
static void free_block(nmem_block *p)
#if NMEM_DEBUG
void nmem_print_list (void)
{
#if NMEM_DEBUG
void nmem_print_list (void)
{
+ nmem_print_list_l(LOG_DEBUG);
+}
+
+void nmem_print_list_l (int level)
+{
struct nmem_debug_info *p;
struct nmem_debug_info *p;
- yaz_log (LOG_DEBUG, "nmem print list");
+ yaz_log (level, "nmem print list");
NMEM_ENTER;
for (p = nmem_debug_list; p; p = p->next)
NMEM_ENTER;
for (p = nmem_debug_list; p; p = p->next)
- yaz_log (LOG_DEBUG, " %s:%d p=%p size=%d", p->file, p->line, p->p,
+ yaz_log (level, " %s:%d p=%p size=%d", p->file, p->line, p->p,
nmem_total(p->p));
NMEM_LEAVE;
}
nmem_total(p->p));
NMEM_LEAVE;
}