dreid 01/07/04 15:11:44
Modified: include apr_sms.h
memory/unix apr_sms.c
Log:
Change the way we do the cleanups slightly. We now have just 2
basic types and when we do a run_cleanups we only remove the
APR_GENERAL_CLEANUP, in the same way as the pools code does.
This keeps us much more in sync but still offers the potential
to improve upon the cleanups.
Revision Changes Path
1.29 +2 -3 apr/include/apr_sms.h
Index: apr_sms.h
===================================================================
RCS file: /home/cvs/apr/include/apr_sms.h,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- apr_sms.h 2001/07/03 13:58:32 1.28
+++ apr_sms.h 2001/07/04 22:11:42 1.29
@@ -79,9 +79,8 @@
**********************************************************************/
/* The various types of cleanup's we can offer */
-#define APR_ALL_CLEANUPS 0x0000
-#define APR_CHILD_CLEANUP 0x0001
-#define APR_PARENT_CLEANUP 0x0002
+#define APR_GENERAL_CLEANUP 0x0001
+#define APR_CHILD_CLEANUP 0x0002
/* Alignment macro's
*
1.39 +6 -4 apr/memory/unix/apr_sms.c
Index: apr_sms.c
===================================================================
RCS file: /home/cvs/apr/memory/unix/apr_sms.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -r1.38 -r1.39
--- apr_sms.c 2001/07/03 15:00:36 1.38
+++ apr_sms.c 2001/07/04 22:11:44 1.39
@@ -397,7 +397,9 @@
static void apr_sms_do_cleanups(struct apr_sms_cleanup *c)
{
while (c) {
- c->cleanup_fn(c->data);
+ if (c->type == APR_GENERAL_CLEANUP) {
+ c->cleanup_fn(c->data);
+ }
c = c->next;
}
}
@@ -725,7 +727,7 @@
cleanup = sms->cleanups;
cleanup_ref = &sms->cleanups;
while (cleanup) {
- if ((type == APR_ALL_CLEANUPS || cleanup->type == type) &&
+ if (cleanup->type == type &&
cleanup->data == data && cleanup->cleanup_fn == cleanup_fn) {
*cleanup_ref = cleanup->next;
@@ -763,7 +765,7 @@
cleanup_ref = &sms->cleanups;
sms = sms->accounting;
while (cleanup) {
- if (type == APR_ALL_CLEANUPS || cleanup->type == type) {
+ if (cleanup->type == type) {
*cleanup_ref = cleanup->next;
if (sms->free_fn)
@@ -814,7 +816,7 @@
cleanup_ref = &sms->cleanups;
sms = sms->accounting;
while (cleanup) {
- if (type == APR_ALL_CLEANUPS || cleanup->type == type) {
+ if (cleanup->type == type) {
*cleanup_ref = cleanup->next;
cleanup->cleanup_fn(cleanup->data);