public final class AllocationEvent extends Object
|Modifier and Type||Method and Description|
Returns the language performing the allocation.
Returns a size of the allocated value in bytes.
Returns an old size of the value prior to the allocation, in bytes.
Returns the value which is a subject of allocation.
public LanguageInfo getLanguage()
public long getOldSize()
0when a new value is to be allocated, or the size of the value prior to the re-allocation. When the old size is unknown,
public long getNewSize()
AllocationListener.onEnter(com.oracle.truffle.api.instrumentation.AllocationEvent)an estimated size of the allocated value is provided. When called from
AllocationListener.onReturnValue(com.oracle.truffle.api.instrumentation.AllocationEvent)a corrected size can be provided, which might differ from the one reported in
onEnter. When the allocated size is unknown,
AllocationReporter.SIZE_UNKNOWNis returned. The change in memory consumption caused by the allocation is
when both old size and new size are known. The change can be either positive or negative.
public Object getValue()
AllocationListener.onEnter(com.oracle.truffle.api.instrumentation.AllocationEvent)the returned value is either
nullwhen a new one is to be allocated, or non-
nullwhen the value is to be re-allocated. When called from
AllocationListener.onReturnValue(com.oracle.truffle.api.instrumentation.AllocationEvent)it is always non-
nulland it is either the newly allocated value, or the same instance of the re-allocated value as was provided in the preceding call to