Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f87fb19
)
Allow a NULL address to be passed to pool_free_old() to indicate that
author
Wayne Davison
<wayned@samba.org>
Wed, 6 Jun 2007 15:38:31 +0000
(15:38 +0000)
committer
Wayne Davison
<wayned@samba.org>
Wed, 6 Jun 2007 15:38:31 +0000
(15:38 +0000)
it should free all old mem and reset to an empty state.
lib/pool_alloc.c
patch
|
blob
|
blame
|
history
diff --git
a/lib/pool_alloc.c
b/lib/pool_alloc.c
index
7d95f19
..
05b182c
100644
(file)
--- a/
lib/pool_alloc.c
+++ b/
lib/pool_alloc.c
@@
-226,9
+226,15
@@
pool_free_old(alloc_pool_t p, void *addr)
struct alloc_pool *pool = (struct alloc_pool *)p;
struct pool_extent *cur, *prev, *next;
- if (!pool
|| !addr
)
+ if (!pool)
return;
+ if (!addr) {
+ if (!pool->extents)
+ return;
+ addr = PTR_ADD(pool->extents->start, pool->extents->free);
+ }
+
for (prev = NULL, cur = pool->extents; cur; prev = cur, cur = cur->next) {
if (addr >= cur->start
&& addr < PTR_ADD(cur->start, pool->size))