2008/12/20 Felip Manyé i Ballester <[email protected]>:
> Thanks a lot for your answer Martin, when I call xmlMemSetup(), xmlMemUsed()
> works with Debian and Ubuntu packages ! I had not understood its use before.
>
> I still don't know why my binary links with the system-wide dynamic library
> and not the one I compiled, even though I explicitly invoke the good
> xml2-config in my makefile (see previous message). Has anybody got an idea ?

Probably because your dynamic linker looked in /usr/lib first. If
you're on a Linux system, use the LD_LIBRARY_PATH environment variable
to specify the path to the libraries, or use the -rpath linker option
(not recommended).

Anyway, this is not a libxml2 question, but a question about how
dynamic linking works, which you can read up on Wikipedia and in the
manual for your compiler/OS.

Regards,
Elvis

>
> Regards,
>
> Felip.
>
>
> En/na Martin (gzlist) ha escrit:
>
> On 18/12/2008, [email protected] <[email protected]> wrote:
>
>
> Hello,
>
> I've been trying to evaluate the amount of memory allocated using
> xmlMemUsed. A similar question was asked in 2004:
> http://mail.gnome.org/archives/xml/2004-March/msg00232.html,
> and Daniel replied that mem debug had to be activated. That's why I
> recompiled libxml2 (version 2.6.30, on Ubuntu 8.04) with the option
> --with-mem-debug.
>
>
> On my Debian box at least, the system libxml2 is already compiled with
> that option, you just need to activate the debug malloc stuff by
> calling:
>
>     xmlMemSetup(xmlMemFree, xmlMemMalloc, xmlMemRealloc, xmlMemoryStrdup);
>
> prior to doing any of this:
>
>
>
>  doc = xmlParseFile(argv[2]);
>   if (doc == NULL)
>   {
>       printf ("%s could not be parsed\n", argv[2]);
>       exit (1);
>   }
>   printf("Used memory: %d\n", xmlMemUsed());
>   xmlDocDump(stdout, doc);
>
>
> Perhaps I misunderstand, or Ubuntu fiddled with the package.
>
> Martin
>
>
>
> _______________________________________________
> xml mailing list, project page  http://xmlsoft.org/
> [email protected]
> http://mail.gnome.org/mailman/listinfo/xml
>
>
_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
[email protected]
http://mail.gnome.org/mailman/listinfo/xml

Reply via email to