You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Stefan Ruppert <ml...@ruppert-it.de> on 2010/03/29 18:54:04 UTC

struct apr_pollfd_t pool member?

Hi all,

today I noticed that the pool member in the apr_pollfd_t structure isn't 
used at all within APR! Why should there an associated memory pool? What 
is the purpose of this field then?

 From include/apr_poll.h:

/** Poll descriptor set. */
struct apr_pollfd_t {
     apr_pool_t *p;              /**< associated pool */
     apr_datatype_e desc_type;   /**< descriptor type */
     apr_int16_t reqevents;      /**< requested events */
     apr_int16_t rtnevents;      /**< returned events */
     apr_descriptor desc;        /**< @see apr_descriptor */
     void *client_data;          /**< allows app to associate context */
};


Regards,
Stefan

Re: struct apr_pollfd_t pool member?

Posted by Jeff Trawick <tr...@gmail.com>.
On Tue, Mar 30, 2010 at 1:02 PM, Neil Conway <nr...@cs.berkeley.edu> wrote:
> Field seems unused to me -- +1 for removing it. Attached is a patch
> against trunk that does this.
>
> Since this struct is exposed to client code, removing the field is
> presumably only an option for APR2.

right, though it would be useful to declare in 1.x/apr_poll.h that the
field is ignored for all apr 1.x; that would avoid any concern for
devs that have to adjust their code for 2.x compatibility (i.e.,
delete lines that set that field) but don't want to break 1.x
compatibility

Re: struct apr_pollfd_t pool member?

Posted by Neil Conway <nr...@cs.berkeley.edu>.
Field seems unused to me -- +1 for removing it. Attached is a patch
against trunk that does this.

Since this struct is exposed to client code, removing the field is
presumably only an option for APR2.

Neil

On Mon, Mar 29, 2010 at 9:54 AM, Stefan Ruppert <ml...@ruppert-it.de> wrote:
> Hi all,
>
> today I noticed that the pool member in the apr_pollfd_t structure isn't
> used at all within APR! Why should there an associated memory pool? What is
> the purpose of this field then?
>
> From include/apr_poll.h:
>
> /** Poll descriptor set. */
> struct apr_pollfd_t {
>    apr_pool_t *p;              /**< associated pool */
>    apr_datatype_e desc_type;   /**< descriptor type */
>    apr_int16_t reqevents;      /**< requested events */
>    apr_int16_t rtnevents;      /**< returned events */
>    apr_descriptor desc;        /**< @see apr_descriptor */
>    void *client_data;          /**< allows app to associate context */
> };
>
>
> Regards,
> Stefan
>