]> granicus.if.org Git - esp-idf/commitdiff
Adds a Kconfig option for mbedtls' MBEDTLS_PLATFORM_MEMORY define. This makes it...
authorJason von Nieda <jason@vonnieda.org>
Fri, 27 Jul 2018 17:03:01 +0000 (12:03 -0500)
committerAngus Gratton <gus@projectgus.com>
Wed, 1 Aug 2018 01:28:28 +0000 (11:28 +1000)
Merges https://github.com/espressif/esp-idf/pull/2237

components/mbedtls/Kconfig
components/mbedtls/port/include/mbedtls/esp_config.h

index f1016f5c29915b005723056b58bac11280fa977c..89e08beb6e6c552ee703098e63d91da72fbd53c9 100644 (file)
@@ -1,5 +1,21 @@
 menu "mbedTLS"
 
+config MBEDTLS_PLATFORM_MEMORY
+   bool "Enable custom mbedTLS memory allocation layer."
+   default n
+   help
+      If this option is disabled, mbed TLS uses the default system
+      calloc() and free() functions.
+
+      If this option is enabled, the mbed TLS config macro
+      MBEDTLS_PLATFORM_MEMORY will be defined. The function
+      mbedtls_platform_set_calloc_free() must be called at
+      runtime to provide custom calloc() and free() function
+      pointers for use by mbedTLS.
+
+      This option allows fine-grained control over how mbedTLS
+      allocates heap memory.
+
 config MBEDTLS_SSL_MAX_CONTENT_LEN
     int "TLS maximum message content length"
     default 16384
index c81bf1a06e2581d91014ce23f6cf9fa3979a549d..561ff723cf34c95d4bb3d5c97ded025694515910 100644 (file)
  *
  * Enable this layer to allow use of alternative memory allocators.
  */
-//#define MBEDTLS_PLATFORM_MEMORY
+#ifdef CONFIG_MBEDTLS_PLATFORM_MEMORY
+#define MBEDTLS_PLATFORM_MEMORY
+#endif
 
 /**
  * \def MBEDTLS_PLATFORM_NO_STD_FUNCTIONS