You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is Issue 351 moved from a Google Code project.
Added by 2010-09-14T05:17:42.000Z by ryanfobel.
Please review that bug for more context and additional comments, but update this bug.
Closed (Fixed).
Original labels: Type-Enhancement, Priority-Medium, Component-Core, Milestone-0020
Original description
What change would like to see?
I would like to see dynamic memory allocation removed from the Wire library.
Why?
The length of the dynamically-allocated buffers never changes, so I can't see any reason to use dynamic allocation. It's probably not a big deal for most people, but I've recently been struggling with random crashes due to SRAM issues (e.g. see http://www.arduino.cc/playground/Code/AvailableMemory); I'm not an expert, but my take is that it's better to avoid dynamic memory allocation unless it's absolutely necessary. I can't see any advantages in this case, and static allocation simplifies memory profiling...
Would this cause any incompatibilities with previous versions? If so, how can these be mitigated?
No.
I've modified Wire.h/cpp and twi.c by statically allocating all buffers. The attached patch was made against r959.
The text was updated successfully, but these errors were encountered:
This is Issue 351 moved from a Google Code project.
Added by 2010-09-14T05:17:42.000Z by ryanfobel.
Please review that bug for more context and additional comments, but update this bug.
Closed (Fixed).
Original labels: Type-Enhancement, Priority-Medium, Component-Core, Milestone-0020
Original description
What change would like to see?
I would like to see dynamic memory allocation removed from the Wire library.
Why?
The length of the dynamically-allocated buffers never changes, so I can't see any reason to use dynamic allocation. It's probably not a big deal for most people, but I've recently been struggling with random crashes due to SRAM issues (e.g. see http://www.arduino.cc/playground/Code/AvailableMemory); I'm not an expert, but my take is that it's better to avoid dynamic memory allocation unless it's absolutely necessary. I can't see any advantages in this case, and static allocation simplifies memory profiling...
Would this cause any incompatibilities with previous versions? If so, how
can these be mitigated?
No.
I've modified Wire.h/cpp and twi.c by statically allocating all buffers. The attached patch was made against r959.
The text was updated successfully, but these errors were encountered: