@@ -63,26 +63,45 @@ export declare class Rtrace {
63
63
/** Checks if there are any leaks and emits them via `oninfo`. Returns the number of live blocks. */
64
64
check ( ) : number ;
65
65
66
- /** A function that is called when an allocation occurs. */
66
+ /** Obtains information about a block. */
67
+ getBlockInfo ( ptr : number ) : BlockInfo ;
68
+
69
+ // Instrumentation
70
+
71
+ /** Called upon runtime initialization. */
72
+ oninit ( heapBase : number ) : void ;
73
+
74
+ /** Called when a new block is allocated. */
67
75
onalloc ( ptr : number ) : void ;
68
76
69
- /** A function that is called when a heap allocation resize occurs . */
77
+ /** Called when an existing block is resized . */
70
78
onresize ( ptr : number , oldSize : number ) : void ;
71
79
72
- /** A function that is called when an object is moved on the heap . */
80
+ /** Called when an existing block is moved to a new allocation . */
73
81
onmove ( oldPtr : number , newPtr : number ) : void ;
74
82
75
- /** A function that is called when a heap allocation is freed. */
76
- onfree ( ptr : number ) : void ;
77
-
78
- /** A function that is called when an object is visited by the GC. Should return `true`, unless there's an error. */
83
+ /** Called when an object is visited by the GC. Returns `true` unless there is an error and the block should be skipped. */
79
84
onvisit ( ptr : number ) : boolean ;
80
85
81
- /** A function that is called after a collection phase. */
86
+ /** Called when an existing block is freed.*/
87
+ onfree ( ptr : number ) : void ;
88
+
89
+ /** Called when a collection phase concludes. */
82
90
oncollect ( total : number ) : void ;
83
91
84
- /** Obtains information about a block. */
85
- getBlockInfo ( ptr : number ) : BlockInfo ;
92
+ /** Called when a collection phase interrupts the program. */
93
+ oninterrupt ( total : number ) : void ;
94
+
95
+ /** Called when a collection phase yields from an interrupt. */
96
+ onyield ( total : number ) : void ;
97
+
98
+ /** Called when a value is stored to memory. */
99
+ onstore ( ptr : number , offset : number , bytes : number , isRT : boolean ) : void ;
100
+
101
+ /** Called when a value is loaded from memory. */
102
+ onload ( ptr : number , offset : number , bytes : number , isRT : boolean ) : void ;
103
+
104
+ // Reporting
86
105
87
106
/** Error message callback. */
88
107
onerror : ErrorCallback ;
0 commit comments