[Soot-list] DeadAssignmentEliminator and assignments x=null

Chris Pickett chris.pickett at mail.mcgill.ca
Tue Sep 11 17:15:25 EDT 2007


In fact, even System.gc() is just a suggestion.

Chris

Andrey_Poliektov at amat.com wrote:
> 
> Hi Eric,
> 
> As far I remember java spec, the result of your "test" is undetermined.
> 
> for w.get() to return null, GC MUST determine that the object is weakly 
> referenced, and this is not guaranteed to happen at any specific time.
> 
> It does not matter how your optimization affects the test the result of 
> which was undetermined to begin with.
> 
> Thank you,
> Andrey
> 
> 
> 
> 	
> 
> 
> *"Eric Bodden" <eric.bodden at mail.mcgill.ca>*
> Sent by: soot-list-bounces at sable.mcgill.ca
> 
> 09/11/2007 01:54 PM
> 
> 	
> To
> 	"Patrick Lam" <plam at sable.mcgill.ca>
> cc
> 	Soot list <soot-list at sable.mcgill.ca>
> Subject
> 	Re: [Soot-list] DeadAssignmentEliminator and assignments x=null
> 
> 
> 	
> 
> 
> 		                     
> 
> 
> 
> 
>  > I don't think it's wrong to mark x=null as essential, but I don't think
>  > it's bad to leave it as it is either. I'll leave it up to you.
> 
> Point is that the current behavior forbids test cases like this:
> 
> Object o = new Object();
> WeakReference w = new WeakReference(o);
> o = null; //eliminated
> System.gc();
> assert w.get()==null; //will fail
> 
> Eric
> 
> -- 
> Eric Bodden
> Sable Research Group
> McGill University, Montréal, Canada
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list


More information about the Soot-list mailing list