This commit is contained in:
Sergey Lyubka 2022-06-21 12:07:00 +01:00
parent 4f9cfdf65d
commit 4246e6c768
3 changed files with 4 additions and 4 deletions

View File

@ -192,7 +192,7 @@ struct timeval {
// Re-route calloc/free to the FreeRTOS's functions, don't use stdlib
static inline void *mg_calloc(int cnt, size_t size) {
void *p = pvPortMalloc(cnt * size);
if (p != NULL) memset(p, 0, size);
if (p != NULL) memset(p, 0, size * cnt);
return p;
}
#define calloc(a, b) mg_calloc((a), (b))
@ -262,7 +262,7 @@ static inline void *mg_calloc(int cnt, size_t size) {
// Re-route calloc/free to the FreeRTOS's functions, don't use stdlib
static inline void *mg_calloc(int cnt, size_t size) {
void *p = pvPortMalloc(cnt * size);
if (p != NULL) memset(p, 0, size);
if (p != NULL) memset(p, 0, size * cnt);
return p;
}
#define calloc(a, b) mg_calloc((a), (b))

View File

@ -32,7 +32,7 @@ struct timeval {
// Re-route calloc/free to the FreeRTOS's functions, don't use stdlib
static inline void *mg_calloc(int cnt, size_t size) {
void *p = pvPortMalloc(cnt * size);
if (p != NULL) memset(p, 0, size);
if (p != NULL) memset(p, 0, size * cnt);
return p;
}
#define calloc(a, b) mg_calloc((a), (b))

View File

@ -50,7 +50,7 @@
// Re-route calloc/free to the FreeRTOS's functions, don't use stdlib
static inline void *mg_calloc(int cnt, size_t size) {
void *p = pvPortMalloc(cnt * size);
if (p != NULL) memset(p, 0, size);
if (p != NULL) memset(p, 0, size * cnt);
return p;
}
#define calloc(a, b) mg_calloc((a), (b))