The type of checking which is performed in this case includes detection of dangling pointers, double freeing and overwriting memory through string operations. This is still very powerful checking, but is much faster. Now let's see how a simple interface can be written. Suppose that you would like to build an interface for your own version of memcpy. Interfaces call the functions for which they are named, but before they call the library function, they check the parameters passed to it.
Interfaces can also check if the parameters passed to the function are in the right ranges.
In our case we check if n is a non-negative value. Interfaces can also check the return code from the function. We did not do this here. Once an interface is written, it can be stored in any file together with other interfaces. Once all of them have been written, the interfaces should be compiled.