@@ -133,11 +133,14 @@ extern char _heap_start[];
133
133
* most.
134
134
*/
135
135
/*
136
- #define UMM_STATS_FULL
137
136
*/
138
137
#define UMM_STATS
139
138
140
- #ifdef UMM_STATS
139
+ #ifdef DEBUG_ESP_PORT
140
+ #define UMM_STATS_FULL
141
+ #endif
142
+
143
+ #if defined(UMM_STATS ) || defined(UMM_STATS_FULL )
141
144
142
145
typedef struct UMM_STATISTICS_t {
143
146
unsigned short int free_blocks ;
@@ -157,11 +160,31 @@ size_t umm_free_heap_size_lw( void );
157
160
158
161
#define STATS__FREE_BLOCKS_UPDATE (s ) ummStats.free_blocks += (s)
159
162
163
+ #else // not UMM_STATS or UMM_STATS_FULL
164
+ #define STATS__FREE_BLOCKS_UPDATE (s ) (void)(s)
165
+ #endif
166
+
160
167
#ifdef UMM_STATS_FULL
161
168
#define STATS__FREE_BLOCKS_MIN () \
162
169
if (ummStats.free_blocks < ummStats.free_blocks_min) \
163
170
ummStats.free_blocks_min = ummStats.free_blocks
164
171
172
+ //C TODO: Needs a new name. ISR is too specific to our use. For upstream
173
+ //C needs to indicate it is related to a temporary low, created during a
174
+ //C realloc that includes memmove/copy.
175
+ #define STATS__FREE_BLOCKS_ISR_MIN () \
176
+ if (ummStats.free_blocks < ummStats.free_blocks_isr_min) \
177
+ ummStats.free_blocks_isr_min = ummStats.free_blocks
178
+
179
+ #define STATS__ALLOC_REQUEST (tag , s ) \
180
+ { \
181
+ ummStats.tag##_count += 1; \
182
+ if (ummStats.alloc_max_size < s) \
183
+ ummStats.alloc_max_size = s; \
184
+ }
185
+
186
+ #define STATS__OOM_UPDATE () ummStats.oom_count += 1
187
+
165
188
static inline size_t ICACHE_FLASH_ATTR umm_free_heap_size_lw_min ( void ) {
166
189
return (size_t )ummStats .free_blocks_min * umm_block_size ();
167
190
}
@@ -195,28 +218,7 @@ static inline size_t ICACHE_FLASH_ATTR umm_get_oom_count( void ) {
195
218
return ummStats .oom_count ;
196
219
}
197
220
198
- //C TODO: Needs a new name. ISR is too specific to our use. For upstream
199
- //C needs to indicate it is related to a temporary low, created during a
200
- //C realloc that includes memmove/copy.
201
- #define STATS__FREE_BLOCKS_ISR_MIN () \
202
- if (ummStats.free_blocks < ummStats.free_blocks_isr_min) \
6D4E
203
- ummStats.free_blocks_isr_min = ummStats.free_blocks
204
-
205
- #define STATS__ALLOC_REQUEST (tag , s ) \
206
- { \
207
- ummStats.tag##_count += 1; \
208
- if (ummStats.alloc_max_size < s) \
209
- ummStats.alloc_max_size = s; \
210
- }
211
-
212
- #define STATS__OOM_UPDATE () ummStats.oom_count += 1
213
- #endif
214
-
215
- #else // ! UMM_STATS
216
- #define STATS__FREE_BLOCKS_UPDATE (s ) (void)(s)
217
- #endif
218
-
219
- #if !defined(UMM_STATS_FULL )
221
+ #else // Not UMM_STATS_FULL
220
222
#define STATS__FREE_BLOCKS_MIN () (void)0
221
223
#define STATS__FREE_BLOCKS_ISR_MIN () (void)0
222
224
#define STATS__ALLOC_REQUEST (tag , s ) (void)(s)
0 commit comments