]> granicus.if.org Git - esp-idf/commitdiff
component/bt: Change the osi_mem_dbg_init to the esp_bluedroid_init function.
authorYulong <huangyulong@espressif.com>
Tue, 13 Jun 2017 12:52:26 +0000 (08:52 -0400)
committerYulong <huangyulong@espressif.com>
Tue, 13 Jun 2017 12:52:26 +0000 (08:52 -0400)
components/bt/bluedroid/api/esp_bt_main.c
components/bt/bluedroid/main/bte_main.c
components/bt/bluedroid/osi/allocator.c
components/bt/bluedroid/osi/include/allocator.h

index 549865e7439db4e8dae576ddaf648f482e01d80d..deb6114bcd170d46480b5cdb634c010d9bfcf03e 100644 (file)
@@ -119,6 +119,10 @@ esp_err_t esp_bluedroid_init(void)
         return ESP_ERR_INVALID_STATE;
     }
 
+#ifdef CONFIG_BLUEDROID_MEM_DEBUG
+    osi_mem_dbg_init();
+#endif
+
     future_p = btc_main_get_future_p(BTC_MAIN_INIT_FUTURE);
     *future_p = future_new();
     if (*future_p == NULL) {
index 957580f0c1dea80d4dd3c72d77bf3871f864bad2..2705bff9b358abbae210de58e8edb83add266f81 100644 (file)
@@ -117,10 +117,6 @@ extern void osi_mem_dbg_init(void);
 ******************************************************************************/
 int bte_main_boot_entry(bluedroid_init_done_cb_t cb)
 {
-#ifdef CONFIG_BLUEDROID_MEM_DEBUG
-    osi_mem_dbg_init();
-#endif
-
     if (gki_init()) {
         LOG_ERROR("%s: Init GKI Module Failure.\n", __func__);
         return -1;
index 9dc3ee910db3a06289e073bbb17d58b21fc0cefc..be90dfc24b2aff1d03b1636a3ed01b90534af27a 100644 (file)
@@ -118,7 +118,7 @@ void osi_mem_dbg_show(void)
 char *osi_strdup(const char *str)
 {
     size_t size = strlen(str) + 1;  // + 1 for the null terminator
-    char *new_string = (char *)calloc(1, size);
+    char *new_string = (char *)osi_calloc(size);
 
     if (!new_string) {
         return NULL;
index 17a3a24634f5357e644b3c38eecc9f05eb9c52f7..82ef5b0ea0be7cbb2ec3161b47915495002c8c6d 100644 (file)
@@ -21,6 +21,7 @@
 
 #include <stddef.h>
 //#include <stdlib.h>
+#include "sdkconfig.h"
 
 typedef void *(*alloc_fn)(size_t size);
 typedef void (*free_fn)(void *ptr);