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
yaz-iconv: fix typos
[yaz-moved-to-github.git]
/
src
/
nmem.c
diff --git
a/src/nmem.c
b/src/nmem.c
index
a68ab6d
..
5aaa6c1
100644
(file)
--- a/
src/nmem.c
+++ b/
src/nmem.c
@@
-1,5
+1,5
@@
/* This file is part of the YAZ toolkit.
/* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2010 Index Data
+ * Copyright (C) Index Data
* See the file LICENSE for details.
*/
* See the file LICENSE for details.
*/
@@
-62,7
+62,7
@@
static int log_level = 0;
static int log_level_initialized = 0;
static void free_block(struct nmem_block *p)
static int log_level_initialized = 0;
static void free_block(struct nmem_block *p)
-{
+{
xfree(p->buf);
xfree(p);
if (log_level)
xfree(p->buf);
xfree(p);
if (log_level)
@@
-85,7
+85,7
@@
static struct nmem_block *get_block(size_t size)
if (log_level)
yaz_log(log_level, "nmem get_block alloc new block size=%ld",
(long) get);
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;
r = (struct nmem_block *) xmalloc(sizeof(*r));
r->buf = (char *)xmalloc(r->size = get);
r->top = 0;
@@
-95,7
+95,7
@@
static struct nmem_block *get_block(size_t size)
void nmem_reset(NMEM n)
{
struct nmem_block *t;
void nmem_reset(NMEM n)
{
struct nmem_block *t;
-
+
yaz_log(log_level, "nmem_reset p=%p", n);
if (!n)
return;
yaz_log(log_level, "nmem_reset p=%p", n);
if (!n)
return;
@@
-145,7
+145,7
@@
NMEM nmem_create(void)
log_level = yaz_log_module_level("nmem");
log_level_initialized = 1;
}
log_level = yaz_log_module_level("nmem");
log_level_initialized = 1;
}
-
+
r = (struct nmem_control *)xmalloc(sizeof(*r));
r->blocks = 0;
r = (struct nmem_control *)xmalloc(sizeof(*r));
r->blocks = 0;
@@
-159,7
+159,7
@@
void nmem_destroy(NMEM n)
{
if (!n)
return;
{
if (!n)
return;
-
+
nmem_reset(n);
xfree(n);
}
nmem_reset(n);
xfree(n);
}