[Expat-discuss] integrating XML_Memory_Handling_Suite with apr_pool_t

Jean-Baptiste Nivoit jbnivoit at gmail.com
Tue Nov 14 00:32:34 CET 2006


Hi,

i have a question: why are the functions in the 
XML_Memory_Handling_Suite not taking an additionnal "userdata" argument 
that could be used to pass, for instance, an apr_pool_t pointer?
I am citing the example of using the apache allocator for instance when 
i know in advance that the scope of allocations done by a XML_Parser i 
create will be within the scope of an HTTP request.
Another example would be a multithreaded program where each thread uses 
its own parser and requires the use of its own private allocator, then 
i'd pass the pointer to the allocator object around in the memory suite 
and at alloc/free sites within expat.
As is, the XML_Memory_Handling_Suite would make me maintain per-thread 
copies of the thread-local apr_pool_t* currently in use in each thread: 
i'd rather pass explicitly which pool is being used rather than having 
to store in thread-local memory.

	 jb.


More information about the Expat-discuss mailing list