Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix memory leak on end() -> begin() -> end() #260

Merged
merged 1 commit into from
Sep 5, 2022

Conversation

facchinm
Copy link
Contributor

Should fix #243 and maybe some other memory related issues.

Only tested in Peripheral mode, with services and characteristics allocated:

  • as global objects (arduino way)
  • in function stack
  • in heap

On mbed-enabled platforms, the memory check can be activated via


  ....
  mbed_stats_heap_t heap_stats;
  mbed_stats_heap_get(&heap_stats);
  Serial.print("Heap size: ");
  Serial.print(heap_stats.current_size);
  Serial.print(" / ");
  Serial.println(heap_stats.reserved_size);
  ....

Only tested in Peripheral mode, with services and characteristics allocated:
* as global objects (arduino way)
* in function stack
* in heap

On mbed-enabled platforms, the memory check can be activated via

```

  ....
  mbed_stats_heap_t heap_stats;
  mbed_stats_heap_get(&heap_stats);
  Serial.print("Heap size: ");
  Serial.print(heap_stats.current_size);
  Serial.print(" / ");
  Serial.println(heap_stats.reserved_size);
  ....
```
@per1234 per1234 added type: imperfection Perceived defect in any part of project topic: code Related to content of the project itself labels Aug 31, 2022
@facchinm facchinm merged commit 5954d96 into arduino-libraries:master Sep 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BLE.begin() -> BLE.end() -> BLE.begin() [again]
2 participants