Skip to content

Commit 84aebc6

Browse files
committed
Merge branch 'feature/bluedroid_link_based_dynamic_allocation' into 'master'
Bluedroid stack dynamic allocation changes to optimise DRAM usage See merge request espressif/esp-idf!9461
2 parents 95b3389 + 0583a04 commit 84aebc6

30 files changed

+1034
-814
lines changed

components/bt/common/osi/include/osi/list.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ bool list_is_empty(const list_t *list);
3434
// |list| may not be NULL.
3535
bool list_contains(const list_t *list, const void *data);
3636

37+
// Returns list_node which contains |data|, NULL otherwise.
38+
// |list| may not be NULL.
39+
list_node_t *list_get_node(const list_t *list, const void *data);
40+
3741
// Returns the length of the |list|. |list| may not be NULL.
3842
size_t list_length(const list_t *list);
3943

components/bt/common/osi/list.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,21 @@ bool list_contains(const list_t *list, const void *data)
6868
return false;
6969
}
7070

71+
list_node_t *list_get_node(const list_t *list, const void *data)
72+
{
73+
assert(list != NULL);
74+
assert(data != NULL);
75+
list_node_t *p_node_ret = NULL;
76+
for (list_node_t *node = list_begin(list); node != list_end(list); node = list_next(node)) {
77+
if (list_node(node) == data) {
78+
p_node_ret = node;
79+
break;
80+
}
81+
}
82+
83+
return p_node_ret;
84+
}
85+
7186
size_t list_length(const list_t *list)
7287
{
7388
assert(list != NULL);

0 commit comments

Comments
 (0)