Skip to content

Commit 589bdba

Browse files
Apply suggestions from code review
Co-authored-by: Bill Phipps <bill@wolfssl.com>
1 parent 77a6481 commit 589bdba

2 files changed

Lines changed: 3 additions & 14 deletions

File tree

wolfcrypt/src/memory.c

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -991,17 +991,10 @@ void* wolfSSL_Malloc(size_t size, void* heap, int type)
991991
break;
992992
}
993993
#ifdef WOLFSSL_DEBUG_STATIC_MEMORY
994-
#ifdef WOLFSSL_ZEPHYR
995994
else {
996-
fprintf(stderr, "Size: %zu, Empty: %d\n", size,
995+
fprintf(stderr, "Size: %lu, Empty: %d\n", (unsigned long) size,
997996
mem->sizeList[i]);
998997
}
999-
#else
1000-
else {
1001-
fprintf(stderr, "Size: %ld, Empty: %d\n", size,
1002-
mem->sizeList[i]);
1003-
}
1004-
#endif
1005998
#endif
1006999
}
10071000
}
@@ -1036,13 +1029,8 @@ void* wolfSSL_Malloc(size_t size, void* heap, int type)
10361029
else {
10371030
WOLFSSL_MSG("ERROR ran out of static memory");
10381031
#ifdef WOLFSSL_DEBUG_MEMORY
1039-
#ifdef WOLFSSL_ZEPHYR
1040-
fprintf(stderr, "Looking for %zu bytes at %s:%d\n", size, func,
1041-
line);
1042-
#else
1043-
fprintf(stderr, "Looking for %lu bytes at %s:%d\n", size, func,
1032+
fprintf(stderr, "Looking for %lu bytes at %s:%d\n", (unsigned long) size, func,
10441033
line);
1045-
#endif
10461034
#endif
10471035
}
10481036

zephyr/user_settings-no-malloc.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ extern "C" {
129129
#undef HAVE_FFDHE_2048
130130
#define HAVE_FFDHE_2048
131131

132+
#undef WOLFSSL_NO_MALLOC
132133
#define WOLFSSL_NO_MALLOC
133134
//#define WOLFSSL_DEBUG_STATIC_MEMORY
134135
//#define WOLFSSL_DEBUG_MEMORY_PRINT

0 commit comments

Comments
 (0)