OSSP CVS Repository

ossp - Difference in ossp-pkg/sio/al_test.c versions 1.11 and 1.12
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

ossp-pkg/sio/al_test.c 1.11 -> 1.12

--- al_test.c    2002/10/18 11:03:07     1.11
+++ al_test.c    2002/10/18 12:24:53     1.12
@@ -116,7 +116,7 @@
     total = 0;
 
     al_txalloc(al, &tx);
-    al_traverse(al, tx, 0, -1, AL_FORWARD);
+    al_traverse(al, 0, -1, AL_FORWARD, tx);
     while (al_traverse_next(al, tx, &cur) == AL_OK)
         total += al_chunk_len(cur);
     al_traverse_end(al, tx, 1);
@@ -129,6 +129,11 @@
             tag,(void *)al,total,total2);
 }
 
+void reclaim(char *p, size_t n, void *u)
+{
+    printf("*** reclaiming buffer %p size %d ***\n",p,n);
+}
+
 int main(int argc, char *argv[])
 {
     al_rc_t rc;
@@ -141,7 +146,7 @@
     al_create(&al3);
 
     al_append_bytes(al, S("Hello world\n"));
-    al_attach_buffer(al, S(baf));
+    al_attach_buffer(al, S(baf), reclaim, NULL);
 
     for (i=0; i<500; ++i)
         al_append_bytes(al, S("Huhu world\n"));

CVSTrac 2.0.1