Re: Memory management changes
- From: Murray Cumming <murrayc murrayc com>
- To: Christophe de Vienne <cdevienne gmail com>
- Cc: libxmlplusplus-list gnome org
- Subject: Re: Memory management changes
- Date: Mon, 08 Nov 2010 22:46:46 +0100
On Mon, 2010-11-08 at 17:04 +0100, Christophe de Vienne wrote:
> Indeed, except that libxml++ was originally written so that the libxml2
> functions could be used if no libxml++ wrapper exists for them.
That will still be possible when you need to get a C instance for the C
++ instance.
But we've never had an API, I think, to get a C++ instance from a C
instance, for instance, if a libxml C function returned something. We've
never even encouraged people to use xmlNode::private and cast to a C++
type. So I don't think we need to think of that as public API.
> At least, if this patch is applied and the behavior is non-consistent
> with the previous one (to be verified), you should warn developpers that
> may relay on it
Yes.
> (I know that in the past I advised people to use libxml2
> functions that were not wrapped).
>
> Regards,
>
> Christophe
>
> Le 08/11/2010 16:57, Alessandro Pignotti a écrit :
> > Hi everyone,
> >
> > well... this looks to me like looking for undefined behavior :-) Internally
> > libxml++ could be using something completely different from libxml2 and so the
> > users should not do this kind of stuff
> >
> > Regards,
> > Alessandro Pignotti
> >
> > On Monday 08 November 2010 16:51:37 Christophe de Vienne wrote:
> >> Hi,
> >>
> >> I see no problem if using only the C++ methods to manipulate the tree,
> >> but what if a xmlNode is returned by the C api and ones want the C++
> >> instance associated with it ?
> >>
> >> My 2 cents (since long !)
> >>
> >> Christophe
> >>
> >> Le 08/11/2010 16:44, Murray Cumming a écrit :
> >>> Alessandro has kindly created a patch to (hopefully) fix problems with
> >>> using libxml++ in muliple threads.
> >>>
> >>> But it's a rather significant change, meaning that we no longer use
> >>> xmlRegisterNodeDefault() to provide a callback where we create the C++
> >>> instance. We would still use xmlNode::private to store the pointer to
> >>> the C++ instance.
> >>>
> >>> This requires us to check and create a C++ instance in several places
> >>> instead of letting it happen automatically. Can anyone think of a
> >>> downside?
> >>>
> >>> https://bugzilla.gnome.org/show_bug.cgi?id=634123#c13
> >>
> >> _______________________________________________
> >> libxmlplusplus-list mailing list
> >> libxmlplusplus-list gnome org
> >> http://mail.gnome.org/mailman/listinfo/libxmlplusplus-list
> >>
> >>
> >> _______________________________________________
> >> libxmlplusplus-list mailing list
> >> libxmlplusplus-list gnome org
> >> http://mail.gnome.org/mailman/listinfo/libxmlplusplus-list
>
> _______________________________________________
> libxmlplusplus-list mailing list
> libxmlplusplus-list gnome org
> http://mail.gnome.org/mailman/listinfo/libxmlplusplus-list
--
murrayc murrayc com
www.murrayc.com
www.openismus.com
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]