diff --git a/configure b/configure index ba05cc2c8..093caca03 100755 --- a/configure +++ b/configure @@ -171,7 +171,6 @@ print_usage() echo " it no longer needs to call malloc() or free(), even" echo " across many separate level-3 operation invocations." echo " " - echo " " echo " --enable-mem-tracing, --disable-mem-tracing" echo " " echo " Enable (disable by default) output to stdout that traces" diff --git a/frame/base/bli_apool.c b/frame/base/bli_apool.c index 542c4275a..4a98a090c 100644 --- a/frame/base/bli_apool.c +++ b/frame/base/bli_apool.c @@ -397,7 +397,7 @@ pool_t* bli_apool_array_elem // Settle on the parameters to use when initializing the pool_t for // the current index within the array_t. const siz_t num_blocks = 1; - const siz_t block_ptrs_len = 10; + const siz_t block_ptrs_len = 25; const siz_t align_size = 16; malloc_ft malloc_fp = BLIS_MALLOC_INTL; free_ft free_fp = BLIS_FREE_INTL; diff --git a/frame/base/bli_malloc.c b/frame/base/bli_malloc.c index 4ce5926a2..b6ee6ebd4 100644 --- a/frame/base/bli_malloc.c +++ b/frame/base/bli_malloc.c @@ -155,8 +155,9 @@ void* bli_fmalloc_align // Call the allocation function. p_orig = f( size ); - // If NULL was returned, something is probably very wrong. - if ( p_orig == NULL ) bli_abort(); + // Check the pointer returned by malloc(). + if ( bli_error_checking_is_enabled() ) + bli_fmalloc_align_post_check( p_orig ); // Advance the pointer by one pointer element. p_byte = p_orig; @@ -254,4 +255,16 @@ void bli_fmalloc_align_check bli_check_error_code( e_val ); } +void bli_fmalloc_align_post_check + ( + void* p + ) +{ + err_t e_val; + + // Check for valid values from malloc(). + + e_val = bli_check_valid_malloc_buf( p ); + bli_check_error_code( e_val ); +} diff --git a/frame/base/bli_malloc.h b/frame/base/bli_malloc.h index baa2de048..7945ebdf5 100644 --- a/frame/base/bli_malloc.h +++ b/frame/base/bli_malloc.h @@ -58,4 +58,5 @@ void* bli_fmalloc_noalign( malloc_ft f, size_t size ); void bli_ffree_noalign( free_ft f, void* p ); void bli_fmalloc_align_check( malloc_ft f, size_t size, size_t align_size ); +void bli_fmalloc_align_post_check( void* p );