apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Branko ─îibej <br...@xbc.nu>
Subject Re: Opaque structures in general (was Re: Opaque apr_pool_t structure)
Date Fri, 06 Jun 2008 12:35:51 GMT
Yann wrote:
> Sorry I didn't explain myself very well.
>
> I don't wan't to play with pointers, of course, a single sizeof won't 
> allow me to do much more then a memcpy().
>
> For example ( innocently :p ) :
>
> struct mystuct {
>     apr_pool_t p;
>     ...
> } myvar;
> apr_pool_t p;
>
> apr_pool_create(&p, NULL);
> memcpy(&myvar.p, p, apr_pool_sizeof());

How is that better than just putting an apr_pool_t* in your struct? So 
it's inheritance by reference instead of by containment, semantically 
it's equivalent (given that this is C).

-- Brane


Mime
View raw message