I am using the development branch v0_impl in GitHub - coderkalyan/libserard: A compact implementation of the Cyphal/serial protocol in C for high-integrity real-time embedded systems · GitHub and find that I am losing memory with every received message.
I think I the issue relates to
struct SerardInternalRxSession* rxs =
(struct SerardInternalRxSession*) cavlSearch((struct SerardTreeNode**) &subscription->sessions,
(void*) &metadata->remote_node_id,
&rxSubscriptionPredicateOnSession,
NULL);
if (rxs == NULL)
{
rxs = (struct SerardInternalRxSession*) ins->memory_rx_session
.allocate(ins->memory_rx_session.user_reference, sizeof(struct SerardInternalRxSession));
Putting my debugger on allocations, I find that this allocation happens in every call. It is as if rxs was not registered in the cavl tree and thus every search fails, return 0 and a new rxs is allocated.