[Expat-bugs]
[ expat-Bugs-651754 ] Function to get XML_Memory_Handling_Suite
noreply at sourceforge.net
noreply at sourceforge.net
Wed Dec 11 07:23:25 EST 2002
Bugs item #651754, was opened at 2002-12-10 20:16
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=110127&aid=651754&group_id=10127
Category: None
Group: Feature Request
Status: Open
Resolution: None
Priority: 5
Submitted By: Artyom Bolgar (artyom17)
Assigned to: Nobody/Anonymous (nobody)
Summary: Function to get XML_Memory_Handling_Suite
Initial Comment:
It is not a bug report, it is a feature request. What do
you think of adding the function, that returns the pointer
to XML_Memory_Handling_Suite for passed
XML_Parser? It is necessary for me, I am developing an
extension for Expat and I would like to use the same
allocation/reallocation/free function as the current
XML_Parser uses. Since XML_Parser struct defined
inside .C-file, I can't get an access to
XML_Memory_Handling_Suite struct for the parser.
Please add this function, since it will be very simple.
Sincerely,
Artyom Bolgar.
----------------------------------------------------------------------
>Comment By: Karl Waclawek (kwaclaw)
Date: 2002-12-11 10:23
Message:
Logged In: YES
user_id=290026
Fred:
I know that, but I just pointed out an example
where it would make sense.
I have another reason too that has to do with
writing wrappers/bindings for Expat, but I will
mention it in a reply to your upcoming message
on expat-discuss.
----------------------------------------------------------------------
Comment By: Fred L. Drake, Jr. (fdrake)
Date: 2002-12-11 09:38
Message:
Logged In: YES
user_id=3066
Karl: Artyom didn't say he was setting a handler on an
XML_Parser object someone else passed him, nor did he say he
wasn't. The only specific I see here is that he wants to
use the same resource handlers as the parser; it's not clear
that this is a real requirement. I'll follow up with a
discussion on expat-discuss.
----------------------------------------------------------------------
Comment By: Karl Waclawek (kwaclaw)
Date: 2002-12-11 08:59
Message:
Logged In: YES
user_id=290026
Once you set an element declaration handler you need
to free the content model passed to the handler, so
you will need to know the memory handler in use.
It is just a rare case that the code that sets the handlers
has no control over the code that creates the parser.
But it is not too far fetched, so IMO that feature
request makes some sense, unless I am overlooking
the obvious.
----------------------------------------------------------------------
Comment By: Fred L. Drake, Jr. (fdrake)
Date: 2002-12-11 07:40
Message:
Logged In: YES
user_id=3066
Can you explain why you need the memory handler they've
asked Expat to use? The requirements aren't clear, so more
explanation of the use case should help.
Thanks.
----------------------------------------------------------------------
Comment By: Artyom Bolgar (artyom17)
Date: 2002-12-11 06:32
Message:
Logged In: YES
user_id=657326
Of course, I know about this. But in my case, I use
XML_Parser passed by user (and it is created by him), and I
don't know how it was created, either by
XML_ParserCreate_MM or not. That is why I requested this
function.
----------------------------------------------------------------------
Comment By: Karl Waclawek (kwaclaw)
Date: 2002-12-10 21:24
Message:
Logged In: YES
user_id=290026
Are you creating the parser using XML_ParserCreate?
In that case - without supplying an external memory handler,
Expat just uses the standard C runtime functions
malloc, realloc and free.
If you use XML_ParserCreate_MM however, then *you*
are supplying the memory handler yourself.
In both cases you don't need the requested function.
Is your situation different from what I described?
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=110127&aid=651754&group_id=10127
More information about the Expat-bugs
mailing list