projects
/
yaz-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
88d0696
)
Function mmem_exit releases memory used by the freelists.
author
Adam Dickmeiss
<adam@indexdata.dk>
Mon, 6 Oct 1997 09:09:52 +0000
(09:09 +0000)
committer
Adam Dickmeiss
<adam@indexdata.dk>
Mon, 6 Oct 1997 09:09:52 +0000
(09:09 +0000)
util/nmem.c
patch
|
blob
|
history
diff --git
a/util/nmem.c
b/util/nmem.c
index
9df6347
..
0e4009f
100644
(file)
--- a/
util/nmem.c
+++ b/
util/nmem.c
@@
-4,7
+4,10
@@
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: nmem.c,v $
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: nmem.c,v $
- * Revision 1.4 1997-09-29 07:12:50 adam
+ * Revision 1.5 1997-10-06 09:09:52 adam
+ * Function mmem_exit releases memory used by the freelists.
+ *
+ * Revision 1.4 1997/09/29 07:12:50 adam
* NMEM thread safe. NMEM must be initialized before use (sigh) -
* routine nmem_init/nmem_exit implemented.
*
* NMEM thread safe. NMEM must be initialized before use (sigh) -
* routine nmem_init/nmem_exit implemented.
*
@@
-163,6
+166,19
@@
void nmem_init (void)
void nmem_exit (void)
{
void nmem_exit (void)
{
+ while (freelist)
+ {
+ struct nmem_block *fl = freelist;
+ freelist = freelist->next;
+ xfree (fl->buf);
+ xfree (fl);
+ }
+ while (cfreelist)
+ {
+ struct nmem_control *cfl = cfreelist;
+ cfreelist = cfreelist->next;
+ xfree (cfl);
+ }
#ifdef WINDOWS
DeleteCriticalSection(&critical_section);
#endif
#ifdef WINDOWS
DeleteCriticalSection(&critical_section);
#endif