Closed geeksville closed 3 years ago
can you explain it in more detail
sure. It is often super useful to redefine new/delete so you can debug, track all allocations. And in most (all? it might be a requirement of the C++ language spec?) libraries new/delete are declared with weak binding, so applications can define their own implementation if needed.
The adafruit_nrf52 lib was not marking their implementation as weakly bound. So any attempt to redefine it would be declared illegal by the linker.
More info here: https://stackoverflow.com/a/8186116
Closed since I don’t think it is necessary. For debug purpose please modify the func directly. We can’t have all function as weak for override
Sometimes app developers need to redefine new/delete for debugging or other purposes. This changes the definitions to have the weak attribute, so that will be allowed by the linker rather than throwing an error.