library/src/mmap/BP-MMapSlabAllocator.cc
// Displays mmap slab defrag information produced by BP_SlabAllocDefragAndUpdateFragIdx().  Primarily used for
// debugging but can be used to arbitrarily visualize fragmentation data.
Displays mmap slab defrag information produced by BP_SlabAllocDefragAndUpdateFragIdx().  Primarily used for
debugging but can be used to arbitrarily visualize fragmentation data.
Displays mmap slab defrag information produced by BP_SlabAllocDefragAndUpdateFragIdx () . Primarily used for debugging but can be used to arbitrarily visualize fragmentation data .
BP_ERROR_T BP_SlabAllocatorDisplayFragInfo(P_BP_MMAP_SLAB_DEFRAG_INFO defrag_info)
{
	if(!defrag_info)
		return ERR_FAILURE;
	size_t n = 0;
	for
	(
		;
		defrag_info[n].group_alloc_top_ptr;
		n++
	)
	{
		printf("\n [+] Defrag Group Info: %p", &defrag_info[n]);
		if(defrag_info[n].is_first_group_entry == BP_TRUE)
		{
			printf("\n\t is_first_group_entry:           BP_TRUE");
			printf("\n\t if_first_how_many_empty_before: %u", defrag_info[n].if_first_how_many_empty_before);
		}
		printf("\n\t group_alloc_top_ptr:            %p", defrag_info[n].group_alloc_top_ptr);
		printf("\n\t group_alloc_top_ptr_moved:      %p", defrag_info[n].group_alloc_top_ptr_moved);
		printf("\n\t group_alloc_chunks_n:           %u", defrag_info[n].group_alloc_chunks_n);
		printf("\n\t trailing_available_alloc_n:     %u", defrag_info[n].trailing_available_alloc_n);
		printf("\n\t next_group_write_start_ptr:     %p", defrag_info[n].next_group_write_start_ptr);
	}
	printf("\n");
	return ERR_SUCCESS;
}
BP_ERROR_T BP_SlabAllocatorDisplayFragInfo ( P_BP_MMAP_SLAB_DEFRAG_INFO defrag_info ) { if ( ! defrag_info ) return ERR_FAILURE ; size_t n = 0 ; for ( ; defrag_info [ n ] . group_alloc_top_ptr ; n ++ ) { printf ( " \n " , & defrag_info [ n ] ) ; if ( defrag_info [ n ] . is_first_group_entry == BP_TRUE ) { printf ( " \n \t " ) ; printf ( " \n \t " , defrag_info [ n ] . if_first_how_many_empty_before ) ; } printf ( " \n \t " , defrag_info [ n ] . group_alloc_top_ptr ) ; printf ( " \n \t " , defrag_info [ n ] . group_alloc_top_ptr_moved ) ; printf ( " \n \t " , defrag_info [ n ] . group_alloc_chunks_n ) ; printf ( " \n \t " , defrag_info [ n ] . trailing_available_alloc_n ) ; printf ( " \n \t " , defrag_info [ n ] . next_group_write_start_ptr ) ; } printf ( " \n " ) ; return ERR_SUCCESS ; }
Displays mmap slab defrag information produced by BP_SlabAllocDefragAndUpdateFragIdx().
Displays mmap slab defrag information produced by BP_SlabAllocDefragAndUpdateFragIdx () .
// ensure we have a defrag info structure // iterator // display reference // display first information if set // display trailing newline // return indicating success