diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2002-01-05 08:03:05 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2002-01-05 08:03:05 +0800 |
commit | 5269a7d1e2fba4e7e076c86f9f35bb2dbb3b62c4 (patch) | |
tree | 656e2ef2d341715540ecf11d91f7e43ed8f8d618 /e-util | |
parent | 5dc56039e85f00bef57bc857ed1277427b6b0b34 (diff) | |
download | gsoc2013-evolution-5269a7d1e2fba4e7e076c86f9f35bb2dbb3b62c4.tar gsoc2013-evolution-5269a7d1e2fba4e7e076c86f9f35bb2dbb3b62c4.tar.gz gsoc2013-evolution-5269a7d1e2fba4e7e076c86f9f35bb2dbb3b62c4.tar.bz2 gsoc2013-evolution-5269a7d1e2fba4e7e076c86f9f35bb2dbb3b62c4.tar.lz gsoc2013-evolution-5269a7d1e2fba4e7e076c86f9f35bb2dbb3b62c4.tar.xz gsoc2013-evolution-5269a7d1e2fba4e7e076c86f9f35bb2dbb3b62c4.tar.zst gsoc2013-evolution-5269a7d1e2fba4e7e076c86f9f35bb2dbb3b62c4.zip |
Prune free'd nodes from our free list otherwise we'll end up re-using
2002-01-04 Jeffrey Stedfast <fejj@ximian.com>
* e-memory.c (e_memchunk_clean): Prune free'd nodes from our free
list otherwise we'll end up re-using free'd memory blocks and
that's not a Good Thing (tm).
svn path=/trunk/; revision=15250
Diffstat (limited to 'e-util')
-rw-r--r-- | e-util/ChangeLog | 6 | ||||
-rw-r--r-- | e-util/e-memory.c | 17 |
2 files changed, 23 insertions, 0 deletions
diff --git a/e-util/ChangeLog b/e-util/ChangeLog index f66cd9af06..5de15f534f 100644 --- a/e-util/ChangeLog +++ b/e-util/ChangeLog @@ -1,3 +1,9 @@ +2002-01-04 Jeffrey Stedfast <fejj@ximian.com> + + * e-memory.c (e_memchunk_clean): Prune free'd nodes from our free + list otherwise we'll end up re-using free'd memory blocks and + that's not a Good Thing (tm). + 2002-01-02 Jeffrey Stedfast <fejj@ximian.com> * md5-utils.h: Reverted. diff --git a/e-util/e-memory.c b/e-util/e-memory.c index 0dc865225d..108a627076 100644 --- a/e-util/e-memory.c +++ b/e-util/e-memory.c @@ -307,6 +307,23 @@ e_memchunk_clean(MemChunk *m) ci = hi; while (ci) { if (ci->count == m->blocksize) { + MemChunkFreeNode *prev = NULL; + + f = m->free; + while (f) { + if (tree_search (ci, (void *) f) == 0) { + /* prune this node from our free-node list */ + if (prev) + prev->next = f->next; + else + m->free = f->next; + } else { + prev = f; + } + + f = f->next; + } + g_ptr_array_remove_fast(m->blocks, ci->base); g_free(ci->base); } |