| OCR Text |
Show During execution, routine ismalloc detects if a new block of memory is allocated. The information on the location and the size of the block can be obtained from the event and from the executor's state. This information is inserted in the filter table. Routine isfree detects if a block of memory is released. The information on this block is removed from the filter table. Routine is store detects if the instruction changes the main memory. In that case, the memory reference is checked by routine intable. Routine intable returns TRUE, if the memory reference is a change to a pointer. If the address accessed and the value written are both found in the filter table, then this is the change in a pointer value. This is a conservative decision. It guarantees to detect all pointers, but some references that initfilter() { "initialize table"; "get addresses of static pointers"; } ‘ eventfilter() { /* is a new block being allocated? */ if (ismalloc(event)) { "store the address and the size of allocated block"; return(1); } /* is a block being released? */ if (isfree(event)) { "remove the address of the block"; return(2); } /* is a pointer being changed? */ if (isstore(event) && intable(event)) { return(3); } } Figure 4.11. A Filter for Data Flow |