I don't think there is a big issue with memory management as this method is
supposed to be called from gdb only, for debugging purposes. There are more
sophisticated alternatives for the runtime system.
On 2011/07/29 09:31:46, Sven wrote:
http://codereview.chromium.org/7523052/diff/1/src/objects-printer.cc
File src/objects-printer.cc (right):
http://codereview.chromium.org/7523052/diff/1/src/objects-printer.cc#newcode564
src/objects-printer.cc:564: static char* buffer = NULL;
Drive-by commment: This looks scary... The real problem is that we mix 2
things
here (like in lots of other places): Memory management and the conversion
itself. This leads to obscure ownerships and lifetimes, like the "static"
above.
IMHO it would be cleaner and simpler to transfer the ownership of the
result
to
the caller.
Long-term solution: Switch to C++-style << and >>, one rarely needs the
whole
converted result/input all at once.
http://codereview.chromium.org/7523052/
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev