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
About log system changes
[yaz-moved-to-github.git]
/
src
/
odr_mem.c
diff --git
a/src/odr_mem.c
b/src/odr_mem.c
index
a18b372
..
5bd1289
100644
(file)
--- a/
src/odr_mem.c
+++ b/
src/odr_mem.c
@@
-1,8
+1,12
@@
/*
/*
- * Copyright (c) 1995-2003, Index Data
+ * Copyright (c) 1995-2004, Index Data
* See the file LICENSE for details.
*
* See the file LICENSE for details.
*
- * $Id: odr_mem.c,v 1.1 2003-10-27 12:21:33 adam Exp $
+ * $Id: odr_mem.c,v 1.3 2004-10-15 00:19:00 adam Exp $
+ */
+/**
+ * \file odr_mem.c
+ * \brief Implements ODR memory management
*/
#if HAVE_CONFIG_H
#include <config.h>
*/
#if HAVE_CONFIG_H
#include <config.h>
@@
-34,6
+38,8
@@
void *odr_malloc(ODR o, int size)
char *odr_strdup(ODR o, const char *str)
{
char *odr_strdup(ODR o, const char *str)
{
+ if (o && !o->mem)
+ o->mem = nmem_create();
return nmem_strdup(o->mem, str);
}
return nmem_strdup(o->mem, str);
}
@@
-44,6
+50,8
@@
char *odr_strdupn(ODR o, const char *str, size_t n)
int *odr_intdup(ODR o, int v)
{
int *odr_intdup(ODR o, int v)
{
+ if (o && !o->mem)
+ o->mem = nmem_create();
return nmem_intdup(o->mem, v);
}
return nmem_intdup(o->mem, v);
}