Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-dev] Cflow context exposure and hard references

Hi Eric -

You're suggesting that an executing object (target) in the current stack would be garbage collected?

I'm not sure a reference obtained via this, target, or args would ever be garbage collected absent cflow.  (I believe the operand stack is the same even when arguments are unused, but couldn't find anything on point.)  

The programmer can create memory leaks using advice, but I don't think ajc does here.

Wes

> ------------Original Message------------
> From: Eric Bodden <eric@xxxxxxxxx>
> To: "'AspectJ developer discussions'" <aspectj-dev@xxxxxxxxxxx>
> Cc: "Laurie Hendren" <hendren@xxxxxxxxxxxxxxx>, "Oege de Moor" <Oege.de.Moor@xxxxxxxxxxxxxxx>
> Date: Tue, Aug-2-2005 8:48 AM
> Subject: [aspectj-dev] Cflow context exposure and hard references
>
> Hi.
> 
> I have a quick question about context exposed by cflow pointcuts.
> 
> Take e.g. the following definition:
> 
> pointcut pc(B b): call(* A.foo()) && cflow(execution(* B.bar()) &&
> target(b));
> 
> Here pc exposes b from the control flow. This means that internally b 
> must
> push a reference to b on the cflow stack. My question is: I this a hard
> reference or not?
> 
> In the case that it is hard, this means that b is not being garbage
> collected. This means there can be chances that it usually *were* 
> garbage
> collected but now it is not, because the stack is still referencing the
> object. This again means that the advice could access an object which 
> is
> actually dead in all other aspects (including the core concern).
> 
> In the case that it is weak/soft this means that it is not prevented 
> from
> being garbage collected, however this could mean that at the moment you 
> want
> to execute, an advie attached to pc, it could be the case that b is 
> gone
> (which should maybe prevent the advice from being executed in the first
> place).
> 
> So what are the current semantics?
> 
> Cheers,
> Eric
> 
> --
> Eric Bodden
> RWTH Aachen University
> ICQ UIN: 12656220, Skype: ericbodden, PGP: BB465582
> Website: http://www.bodden.de
> 
> 
> _______________________________________________
> aspectj-dev mailing list
> aspectj-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-dev
> 



Back to the top