-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Commit ab309e4
Copy ESP8266 String w/SSO to ESP32 repo (#2715)
I redid the ESP8266 WString library to enable small string optimization
(SSO) a while back, and think it would be helpful even on the ESP32 with
its higher memory complement.
SSO avoids lots of tiny mallocs() on the heap which cause fragmentation
by using the memory in the class object itself to store the actual
string and only mallocing() for buffers that are larger than what can
fit in thie class object. Modern C++ std::string implementations have
this optimization as well, but since we're using Arduino strings we had
to roll our own.1 parent 932666a commit ab309e4
3 files changed
+656
-729
lines changedOriginal file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2 | 2 |
| |
3 | 3 |
| |
4 | 4 |
| |
5 | + | ||
5 | 6 |
| |
6 | 7 |
| |
7 | 8 |
| |
| |||
22 | 23 |
| |
23 | 24 |
| |
24 | 25 |
| |
25 | - | ||
26 | - | ||
26 | + | ||
27 | 27 |
| |
28 | 28 |
| |
29 | - | ||
30 | - | ||
31 | - | ||
29 | + | ||
30 | + | ||
31 | + | ||
32 | 32 |
| |
33 | 33 |
| |
34 | 34 |
| |
35 | 35 |
| |
36 | 36 |
| |
37 | 37 |
| |
38 | - | ||
39 | - | ||
38 | + | ||
40 | 39 |
| |
41 | 40 |
| |
42 | 41 |
| |
43 | - | ||
44 | - | ||
42 | + | ||
45 | 43 |
| |
46 | 44 |
| |
47 | 45 |
| |
48 | - | ||
49 | - | ||
46 | + | ||
50 | 47 |
| |
51 | 48 |
| |
52 | 49 |
| |
| |||
56 | 53 |
| |
57 | 54 |
| |
58 | 55 |
| |
59 | - | ||
60 | - | ||
56 | + | ||
61 | 57 |
| |
62 | 58 |
| |
63 | 59 |
| |
64 | 60 |
| |
65 | 61 |
| |
66 | 62 |
| |
67 | 63 |
| |
68 | - | ||
69 | - | ||
64 | + | ||
70 | 65 |
| |
71 | 66 |
|
0 commit comments