public interface AllocationListener
to register an implementation of this listener. Use
EventBinding.dispose() to unregister.
The listener gets called
before the actual allocation and right
after it. The
calls to these methods are always in pairs, unless the programs crashes in between. Nested
allocations are supported, several calls to
onEnter prior every sub-value allocation
can be followed by the appropriate number of
onReturnValue calls after the
sub-values are allocated, in the opposite order.
|Modifier and Type
|Method and Description
Notifies about an intent to allocate or re-allocate a guest language value.
Notifies about an allocated guest language value.
void onEnter(AllocationEvent event)
AllocationListener.onReturnValue(com.oracle.truffle.api.instrumentation.AllocationEvent) after the
event - the event describing the intended allocation
void onReturnValue(AllocationEvent event)
AllocationListener.onEnter(com.oracle.truffle.api.instrumentation.AllocationEvent) call and right after
the allocation is performed. When
onEnter provided a
null value in the event, it was re-allocated and the same value instance is
in this event.
event - the event describing the finished allocation