httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roy T. Fielding" <field...@kiwi.ICS.UCI.EDU>
Subject Re: general/736: pointers cast as ints of different size - potential memory problems (fwd)
Date Mon, 16 Jun 1997 22:55:49 GMT
>The note_* functions are not callbacks, they reference callbacks.  For
>example, using my proposed solution, note_cleanups_for_fd becomes:
>void note_cleanups_for_fd (pool *p, ptr_int fd)
>    generic_data gd;
>    GENERIC_INT (gd) = fd;
>    register_cleanup (p, gd, fd_cleanup, fd_cleanup);

But that isn't the way to do it.  You can achieve the exact same thing,
without screwing the interface, with

void note_cleanups_for_fd (pool *p, int fd)
    register_cleanup (p, (generic_data)fd, fd_cleanup, fd_cleanup);

What I don't understand is why you would want to change the type of fd
to ptr_int when we know an fd is always type int.  I think we may be
just miscommunicating.


View raw message