Bluedroid stack dynamic allocation changes to optimise DRAM usage

Structures allocated dynamically:
tACL_CONN, tBTM_PM_MCB, tBTM_SEC_DEV_REC, tGATT_TCB, tGATT_CLCB, tL2C_LCB, tL2C_CCB, tSDP_RECORD
Total dynamic allocation size ~19KB.
Peak dram usage reduced by ~12KB when in BT classic + BLE scenario(1 a2dp sink + 1 BLE gatt server)
This commit is contained in:
sushant.chougule
2020-07-02 00:05:54 +05:30
parent ec661be38d
commit 0583a04969
30 changed files with 1035 additions and 815 deletions

View File

@@ -41,6 +41,8 @@
#include "stack/sdp_api.h"
#include "sdpint.h"
#include "osi/list.h"
#if (SDP_INCLUDED == TRUE)
/********************************************************************************/
/* G L O B A L S D P D A T A */
@@ -87,6 +89,7 @@ void sdp_init (void)
/* Clears all structures and local SDP database (if Server is enabled) */
memset (&sdp_cb, 0, sizeof (tSDP_CB));
sdp_cb.server_db.p_record_list = list_new(osi_free_func);
/* Initialize the L2CAP configuration. We only care about MTU and flush */
sdp_cb.l2cap_my_cfg.mtu_present = TRUE;
sdp_cb.l2cap_my_cfg.mtu = SDP_MTU_SIZE;
@@ -140,6 +143,7 @@ void sdp_init (void)
void sdp_deinit (void)
{
list_free(sdp_cb.server_db.p_record_list);
#if SDP_DYNAMIC_MEMORY
osi_free(sdp_cb_ptr);
sdp_cb_ptr = NULL;