4 ms·
> and heap thrashing since we're allocating and deallocating the result structure every single callback. This should not an issue. It is entirely possible to
by epcoa 3y ago
> and heap thrashing since we're allocating and deallocating the result structure every single callback.
This should not an issue. It is entirely possible to write this without any dynamic allocation (other than stack) at all, or it could be done be done with an arena.
Consider with something as powerful as an esp32 a hash table is not even strictly necessary, surely for a single purpose use case like this.
- sodality2 3y agoI figure the internal data structure that already exists in the BT library probably uses something similar to a hash table, so I emulated it with less of the data being saved (just a MAC). You’re right though, there are smaller choices for data structures. I ended up upgrading to a better board with more memory, and just used the existing structure in the BT library. It fixed a number of other problems at the same time.