From f24496074ffccde0c96bdfa1895610fb1b9835a0 Mon Sep 17 00:00:00 2001 From: Dana Robinson <43805+derobins@users.noreply.github.com> Date: Thu, 7 Mar 2024 18:36:44 -0800 Subject: Remove printf debugging in H5HL code (#4086) --- config/cmake/HDFCompilerFlags.cmake | 1 - configure.ac | 4 ++-- src/H5HL.c | 29 ++--------------------------- src/H5HLprivate.h | 10 +--------- 4 files changed, 5 insertions(+), 39 deletions(-) diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake index 7bddad0..4116a67 100644 --- a/config/cmake/HDFCompilerFlags.cmake +++ b/config/cmake/HDFCompilerFlags.cmake @@ -375,7 +375,6 @@ if (HDF5_ENABLE_DEBUG_APIS) H5D_DEBUG H5D_CHUNK_DEBUG H5F_DEBUG - H5HL_DEBUG H5I_DEBUG H5MM_DEBUG H5O_DEBUG diff --git a/configure.ac b/configure.ac index bb75019..26c7681 100644 --- a/configure.ac +++ b/configure.ac @@ -2572,8 +2572,8 @@ AC_SUBST([INTERNAL_DEBUG_OUTPUT]) ## too specialized or have huge performance hits. These ## are not listed in the "all" packages list. ## -## all_packages="AC,B,B2,D,F,FA,FL,FS,HL,I,MM,O,S,T,Z" -all_packages="AC,B2,CX,D,F,HL,I,MM,O,S,T,Z" +## all_packages="AC,B,B2,D,F,FA,FL,FS,I,MM,O,S,T,Z" +all_packages="AC,B2,CX,D,F,I,MM,O,S,T,Z" case "X-$INTERNAL_DEBUG_OUTPUT" in X-yes|X-all) diff --git a/src/H5HL.c b/src/H5HL.c index bdf46d6..680ef0a 100644 --- a/src/H5HL.c +++ b/src/H5HL.c @@ -648,15 +648,8 @@ H5HL_insert(H5F_t *f, H5HL_t *heap, size_t buf_size, const void *buf, size_t *of assert(last_fl->offset == H5HL_ALIGN(last_fl->offset)); assert(last_fl->size == H5HL_ALIGN(last_fl->size)); - if (last_fl->size < H5HL_SIZEOF_FREE(f)) { -#ifdef H5HL_DEBUG - if (H5DEBUG(HL) && last_fl->size) { - fprintf(H5DEBUG(HL), "H5HL: lost %lu bytes at line %d\n", (unsigned long)(last_fl->size), - __LINE__); - } -#endif + if (last_fl->size < H5HL_SIZEOF_FREE(f)) last_fl = H5HL__remove_free(heap, last_fl); - } } else { /* Create a new free list element large enough that we can @@ -675,21 +668,9 @@ H5HL_insert(H5F_t *f, H5HL_t *heap, size_t buf_size, const void *buf, size_t *of if (heap->freelist) heap->freelist->prev = fl; heap->freelist = fl; -#ifdef H5HL_DEBUG - } - else if (H5DEBUG(HL) && need_more > need_size) { - fprintf(H5DEBUG(HL), "H5HL_insert: lost %lu bytes at line %d\n", - (unsigned long)(need_more - need_size), __LINE__); -#endif } } -#ifdef H5HL_DEBUG - if (H5DEBUG(HL)) { - fprintf(H5DEBUG(HL), "H5HL: resize mem buf from %lu to %lu bytes\n", - (unsigned long)(old_dblk_size), (unsigned long)(old_dblk_size + need_more)); - } -#endif if (NULL == (heap->dblk_image = H5FL_BLK_REALLOC(lheap_chunk, heap->dblk_image, heap->dblk_size))) HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, FAIL, "memory allocation failed"); @@ -822,14 +803,8 @@ H5HL_remove(H5F_t *f, H5HL_t *heap, size_t offset, size_t size) * hold the free list data. If not, the freed chunk is forever * lost. */ - if (size < H5HL_SIZEOF_FREE(f)) { -#ifdef H5HL_DEBUG - if (H5DEBUG(HL)) { - fprintf(H5DEBUG(HL), "H5HL: lost %lu bytes\n", (unsigned long)size); - } -#endif + if (size < H5HL_SIZEOF_FREE(f)) HGOTO_DONE(SUCCEED); - } /* Add an entry to the free list */ if (NULL == (fl = H5FL_MALLOC(H5HL_free_t))) diff --git a/src/H5HLprivate.h b/src/H5HLprivate.h index 5d6959d..243d765 100644 --- a/src/H5HLprivate.h +++ b/src/H5HLprivate.h @@ -14,7 +14,7 @@ * * Created: H5HLprivate.h * - * Purpose: Private declarations for the H5HL (local heap) package. + * Purpose: Private declarations for the H5HL (local heap) package * *------------------------------------------------------------------------- */ @@ -26,14 +26,6 @@ #include "H5ACprivate.h" /* Metadata cache */ #include "H5Fprivate.h" /* File access */ -/* - * Feature: Define H5HL_DEBUG on the compiler command line if you want to - * enable diagnostic messages from this layer. - */ -#ifdef NDEBUG -#undef H5HL_DEBUG -#endif - #define H5HL_ALIGN(X) ((((unsigned)X) + 7) & (unsigned)(~0x07)) /* align on 8-byte boundary */ #define H5HL_SIZEOF_FREE(F) \ -- cgit v0.12