Example #1
0
MX_EXPORT int
mx_heap_check( unsigned long heap_flags )
{
	static const char fname[] = "mx_heap_check()";

	boolean_t ok;
	mx_bool_type heap_ok;

	heap_ok = TRUE;

	ok = malloc_zone_check( NULL );

	if ( ok ) {
		if ( heap_flags & MXF_HEAP_CHECK_OK ) {
			mx_info("%s: Heap is OK.", fname);
		}
	} else {
		if ( heap_flags & MXF_HEAP_CHECK_CORRUPTED ) {
			mx_warning("%s: Heap is corrupted.", fname);
		}

		heap_ok = FALSE;
	}

	return heap_ok;
}
Example #2
0
bool FMacMallocZone::ValidateHeap()
{
	check( MemoryZone );
	return malloc_zone_check( MemoryZone ) ;
}