-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Statically setup heap management for mbedTLS. #1709
Conversation
uncrustify failed. Please run it manually and resubmit the PR |
1 similar comment
uncrustify failed. Please run it manually and resubmit the PR |
/bot run checks |
uncrustify failed. Please run it manually and resubmit the PR |
@@ -29,6 +29,9 @@ | |||
#ifndef MBEDTLS_CONFIG_H | |||
#define MBEDTLS_CONFIG_H | |||
|
|||
/* Standard include. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally, the only changes we should be making to the mbedTLS configuration file are when we comment and un-comment #define lines in order to deviate from their default feature settings. Anything beyond that adds to the merge complexity that already deal with when mbed adds features and/or changes defaults.
//#define MBEDTLS_PLATFORM_FREE_MACRO free /**< Default free macro to use, can be undefined */ | ||
/* Set the memory allocation functions on FreeRTOS. */ | ||
|
||
#ifndef MBEDTLS_PLATFORM_CALLOC_MACRO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be safer to specify these defines on the compiler/pre-processor command-line for that projects that will use it.
@@ -68,10 +68,10 @@ typedef struct SignatureVerificationState | |||
/*-----------------------------------------------------------*/ | |||
|
|||
/** | |||
* @brief Implements libc calloc semantics using the FreeRTOS heap | |||
* @brief Implementation of calloc for use by the mbedTLS heap management API |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please add a period to the end as an additional improvement?
*/ | ||
static void * prvCalloc( size_t xNmemb, | ||
size_t xSize ) | ||
void * pvMbedTLSCalloc( size_t xNmemb, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For what's it's worth, I have no idea what the variable name "xNmemb" is supposed to represent.
Statically setup heap management for mbedTLS.
Description
This PR is a fix for #1697
Checklist:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.