Re: [xslt] Replacing the dict used by the transform context

Hi Oleg,

Thanks for the reply.

Oleg A. Paraschenko wrote:
> It is possible to disable the default libxml memory manager, and use
> instead the Python memory manager,


> with garbage collector.

This will not magically give you garbage collection. (Hej, we're actually
*doing* something here to make these things easy to use! ;)

Replacing the memory manager only replaces the functions called for malloc,
free, etc. Diverting them to Python will call PyMem_Malloc and PyMem_Free
instead. No change in behaviour.

> Then, the
> shared dict will not disappear when the document is freed.

It will. Having Python do the memory allocation and deallocation will not
enable reference counting for the dicts (which, BTW, libxml2 already does
based on documents).

We'd still have to do our own reference counting based on each single node
that depends on the dict. That's definitely out of scope.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]