changeset 3527:56df153e9f65 HEAD

If we leaked a t_pop() call, tell where it happened
author Timo Sirainen <tss@iki.fi>
date Sun, 14 Aug 2005 21:18:35 +0300
parents 0bcee5d7da39
children e8541dcd0c74
files src/lib/ioloop-epoll.c src/lib/ioloop-poll.c src/lib/ioloop-select.c src/lib/ioloop.c
diffstat 4 files changed, 18 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib/ioloop-epoll.c	Mon Aug 08 12:20:16 2005 +0300
+++ b/src/lib/ioloop-epoll.c	Sun Aug 14 21:18:35 2005 +0300
@@ -241,8 +241,11 @@
 			if (call) {
 				t_id = t_push();
 				io->callback(io->context);
-				if (t_pop() != t_id)
-					i_panic("Leaked a t_pop() call!");
+				if (t_pop() != t_id) {
+					i_panic("Leaked a t_pop() call in "
+						"I/O handler %p",
+						(void *)io->callback);
+				}
 			}
 		}
 		event++;
--- a/src/lib/ioloop-poll.c	Mon Aug 08 12:20:16 2005 +0300
+++ b/src/lib/ioloop-poll.c	Sun Aug 14 21:18:35 2005 +0300
@@ -182,8 +182,11 @@
 			if (call) {
 				t_id = t_push();
 				io->callback(io->context);
-				if (t_pop() != t_id)
-					i_panic("Leaked a t_pop() call!");
+				if (t_pop() != t_id) {
+					i_panic("Leaked a t_pop() call in "
+						"I/O handler %p",
+						(void *)io->callback);
+				}
 			}
 		}
 	}
--- a/src/lib/ioloop-select.c	Mon Aug 08 12:20:16 2005 +0300
+++ b/src/lib/ioloop-select.c	Sun Aug 14 21:18:35 2005 +0300
@@ -127,8 +127,10 @@
 
 			t_id = t_push();
 			io->callback(io->context);
-			if (t_pop() != t_id)
-				i_panic("Leaked a t_pop() call!");
+			if (t_pop() != t_id) {
+				i_panic("Leaked a t_pop() call in "
+					"I/O handler %p", (void *)io->callback);
+			}
 		}
 	}
 }
--- a/src/lib/ioloop.c	Mon Aug 08 12:20:16 2005 +0300
+++ b/src/lib/ioloop.c	Sun Aug 14 21:18:35 2005 +0300
@@ -206,8 +206,10 @@
 
                 t_id = t_push();
 		t->callback(t->context);
-		if (t_pop() != t_id)
-                        i_panic("Leaked a t_pop() call!");
+		if (t_pop() != t_id) {
+			i_panic("Leaked a t_pop() call in timeout handler %p",
+				(void *)t->callback);
+		}
 	}
 }