Status: New
Owner: ----
New issue 456 by funisher: literals memory leak??
http://code.google.com/p/v8/issues/detail?id=456
I'll be honest here: I don't really understand whats going very well.
that said, I wrote a patch to the parser which concats two string literals
during the parse phase:
var lala = "a" + "a";
gets transformed to:
var lala = "aa";
however, there appears to be a memory leak somewhere. I can't figure out
where it is really... It looks to be in the NEW(Literal()) part of things,
because it uses the same code as StringAdd(). This could be a deeper rooted
problem. Please look at the patch and help me figure out what's going
wrong.
Oh, and assuming there isn't a memory leak, it saves runtime string concats
reducing code size and memory operations, which is actually quite common
for code seen such as:
var html = "<div>" +
"<span>" +
"lala" +
"</span>" +
"</div>";
I'm including two patches... one does it using the StringAdd() code, and
the other does it manually...
How do I delete / garbage collect the previous string literal?
peace
Attachments:
concat-literals.diff 4.5 KB
concat-literals-manually.diff 4.9 KB
--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings
--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---