View Full Version : What is interposition?

02-04-2007, 07:17 AM
Said very simply, "interposition" means "get in the middle."

More precisely, MemoryScape intercepts calls made by your program to heap library functions that allocate and deallocate memory by using the malloc() and free() functions and related functions such as calloc() and realloc().

The following figure shows these interactions.

MemoryScape interposes a program that we call the "Heap Interposition Agent." This agent grabs calls to the malloc library and, depending upon what kind of call it is, performs some action. For example, a call to malloc() means that the agent records the block allocation. If it is a deallocation, it checks the information it has recorded. If it finds the block in its tables, it removes the block from its tables. However, if it can't find the block, it will perform other activities. It might even stop your program's execution.