On 2014/02/27 22:43:49, jochen (OOO from March 1) wrote:
I think we should instead allocate the decoder in the test as well.

For Simulator::current(), we have to rely on Simulator's dtor to cleanup
everything.

Ah, I didn't spot that. I don't like imbalanced allocation APIs* though; is
there no way that we can free the decoder when we free the simulator that
Simulator::current allocates? After having a quick look, I can't actually see
where the simulator is deleted. In ARM and MIPS, there is a TODO(146) which
suggests that it is not deleted.

* To clarify, if the caller allocates an object, then passes a reference or
pointer into another class, I don't expect that class to take ownership of it. This is especially true for the visitor model decoder, where it might also be
attached to a disassembler, for example. If the simulator's destructor runs
before the disassembler's destructor, but both assume that the decoder is still
valid, then bad things will happen.

https://codereview.chromium.org/183203004/

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to