next up previous contents index
Next: 19.3.4 memdebug_sweep: Check validity Up: 19.3 Additional Debugging Utilities Previous: 19.3.2 memdebug_check: Look for

19.3.3 memdebug_ptrchk: Check validity of a pointer's fence-posts

 

SYNOPSIS

#include <oskit/memdebug.h>

int memdebug_ptrcheck(void* ptr);

DESCRIPTION

This function runs a host of sanity checks on a given pointer. Of course, these only work if the pointer, ptr is one returned by a memdebug-wrapped allocator. For any errors a bogosity dump is printed.

PARAMETERS

ptr
A pointer to a memory block allocated by some memdebug wrapped allocator.

RETURNS

Returns -1 if the fence posts are trashed so badly that the information in them cannot be trusted. Returns 1 if there was a problem detected but it is not ``fatal''. Returns 0 if everything is A-okay.

RELATED INFORMATION

memdebug_bogosity



University of Utah Flux Research Group