Skip to content

Commit ac6ea45

Browse files
rtakacsrobertsipka
authored andcommitted
Enable custom allocators for mbedtls only if JSTEST_MEMSTAT_ENABLED is defined. (#234)
If MBEDTLS_PLATFORM_C and MBEDTLS_PLATFORM_MEMORY are defined for mbedtls, the binary size is bigger by 1 KB. This patch enables these macros only for the test build. JSRemoteTest-DCO-1.0-Signed-off-by: Roland Takacs [email protected]
1 parent b871850 commit ac6ea45

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

jstest/resources/patches/tizenrt-mbedtls.diff

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
diff --git a/external/include/mbedtls/config.h b/external/include/mbedtls/config.h
2-
index 7d5cda4..57e1501 100644
2+
index 7d5cda4..64e8187 100644
33
--- a/external/include/mbedtls/config.h
44
+++ b/external/include/mbedtls/config.h
5-
@@ -132,7 +132,7 @@
5+
@@ -132,7 +132,9 @@
66
*
77
* Enable this layer to allow use of alternative memory allocators.
88
*/
99
-//#define MBEDTLS_PLATFORM_MEMORY
10+
+#if defined(JSTEST_MEMSTAT_ENABLED)
1011
+#define MBEDTLS_PLATFORM_MEMORY
12+
+#endif
1113

1214
/**
1315
* \def MBEDTLS_PLATFORM_NO_STD_FUNCTIONS
14-
@@ -678,7 +678,7 @@
16+
@@ -678,7 +680,7 @@
1517
* enabled as well):
1618
* MBEDTLS_TLS_ECDH_ANON_WITH_AES_128_CBC_SHA256
1719
*/
@@ -20,12 +22,14 @@ index 7d5cda4..57e1501 100644
2022

2123
/**
2224
* \def MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
23-
@@ -2178,7 +2178,7 @@
25+
@@ -2178,7 +2180,9 @@
2426
*
2527
* This module enables abstraction of common (libc) functions.
2628
*/
2729
-//#define MBEDTLS_PLATFORM_C
30+
+#if defined(JSTEST_MEMSTAT_ENABLED)
2831
+#define MBEDTLS_PLATFORM_C
32+
+#endif
2933

3034
/**
3135
* \def MBEDTLS_RIPEMD160_C

0 commit comments

Comments
 (0)