Apply suggestions from code review

Co-authored-by: Bill Phipps <bill@wolfssl.com>
pull/7438/head
Juliusz Sosinowicz 2024-05-06 14:45:09 +02:00 committed by Juliusz Sosinowicz
parent 77a6481d65
commit 589bdba256
2 changed files with 3 additions and 14 deletions

View File

@ -991,17 +991,10 @@ void* wolfSSL_Malloc(size_t size, void* heap, int type)
break; break;
} }
#ifdef WOLFSSL_DEBUG_STATIC_MEMORY #ifdef WOLFSSL_DEBUG_STATIC_MEMORY
#ifdef WOLFSSL_ZEPHYR
else { else {
fprintf(stderr, "Size: %zu, Empty: %d\n", size, fprintf(stderr, "Size: %lu, Empty: %d\n", (unsigned long) size,
mem->sizeList[i]); mem->sizeList[i]);
} }
#else
else {
fprintf(stderr, "Size: %ld, Empty: %d\n", size,
mem->sizeList[i]);
}
#endif
#endif #endif
} }
} }
@ -1036,13 +1029,8 @@ void* wolfSSL_Malloc(size_t size, void* heap, int type)
else { else {
WOLFSSL_MSG("ERROR ran out of static memory"); WOLFSSL_MSG("ERROR ran out of static memory");
#ifdef WOLFSSL_DEBUG_MEMORY #ifdef WOLFSSL_DEBUG_MEMORY
#ifdef WOLFSSL_ZEPHYR fprintf(stderr, "Looking for %lu bytes at %s:%d\n", (unsigned long) size, func,
fprintf(stderr, "Looking for %zu bytes at %s:%d\n", size, func,
line); line);
#else
fprintf(stderr, "Looking for %lu bytes at %s:%d\n", size, func,
line);
#endif
#endif #endif
} }

View File

@ -129,6 +129,7 @@ extern "C" {
#undef HAVE_FFDHE_2048 #undef HAVE_FFDHE_2048
#define HAVE_FFDHE_2048 #define HAVE_FFDHE_2048
#undef WOLFSSL_NO_MALLOC
#define WOLFSSL_NO_MALLOC #define WOLFSSL_NO_MALLOC
//#define WOLFSSL_DEBUG_STATIC_MEMORY //#define WOLFSSL_DEBUG_STATIC_MEMORY
//#define WOLFSSL_DEBUG_MEMORY_PRINT //#define WOLFSSL_DEBUG_MEMORY_PRINT