[antlr-interest] Does pANTLR3_STRING need to be manually deleted?
chain one
chainone at gmail.com
Fri Mar 27 01:55:49 PDT 2009
As what I read in antlr3string.c:
static pANTLR3_STRING
subString8 (pANTLR3_STRING string, ANTLR3_UINT32 startIndex, ANTLR3_UINT32
endIndex)
{
pANTLR3_STRING newStr;
if (endIndex > string->len)
{
endIndex = string->len + 1;
}
newStr = string->factory->newPtr(string->factory, string->chars +
startIndex, endIndex - startIndex);
return newStr;
}
Does it mean every time subString8 is called, one string will be created and
then the ptr of string is returned?
If so, I am wondering if I should delete the strings created by calling
subString8 or other such kinds of string functions after using them.
Just reading the piece of code above, I guess I should manually delete these
strings. Is that right?
Thanks
chainone
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20090327/d55b26ba/attachment.html
More information about the antlr-interest
mailing list