OSSP CVS Repository

ossp - Check-in [2851]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 2851
Date: 2002-Nov-19 18:02:17 (local)
2002-Nov-19 17:02:17 (UTC)
User:mlelstv
Branch:
Comment: buffers can move to different assembly lines so that the freemem function can reference a dangling al pointer to reach bfree(). We now reference the bfree() function directly as this is supposed to remain valid even after an assembly line has been freed.

PR: Submitted by: Reviewed by: Approved by: Obtained from:

Tickets:
Inspections:
Files:
ossp-pkg/sio/al.c      1.35 -> 1.36     3 inserted, 3 deleted

ossp-pkg/sio/al.c 1.35 -> 1.36

--- al.c 2002/11/14 09:22:42     1.35
+++ al.c 2002/11/19 17:02:17     1.36
@@ -167,8 +167,8 @@
 static
 void freemem(char *p, size_t n, void *u)
 {
-    al_t *al = (al_t *)u;
-    (al->m.bfree)(p);
+    void (*f)(void *) = (void (*)(void *))u;
+    f(p);
 }
 
 /*
@@ -191,7 +191,7 @@
     }
 
     buf->freemem  = freemem;
-    buf->userdata = (void *)al;
+    buf->userdata = (void *)al->m.bfree;
     buf->size     = n;
     buf->usecount = 0;
 

CVSTrac 2.0.1