earlephilhower / ESP8266SAM

Speech synthesis for ESP8266 using S.A.M. port
315 stars 41 forks source link

proposal: save static memory #7

Closed liebman closed 5 years ago

liebman commented 5 years ago

There are many 256 and 60 byte arrays, about 4k in total, that are only used during "say". On an ESP8266 that uses enough memory to prevent using SSL. This, hack at the moment, shows that one can dynamically allocate these when needed and keep memory free for https requests as long as they are not both used at the same time. Thoughts?

liebman commented 5 years ago

. Make the SAMData a member of the class, seems like logically it should be there

If its a class member it won't be accessible from the C code.

. Get rid of the #if SAMDATA and just replace it always.

Will do.

. How about making ::say() return a bool, and false when it's OOM, OTW true? That way we can inform the main code if they care enough to check

Good idea.

earlephilhower commented 5 years ago

. Make the SAMData a member of the class, seems like logically it should be there

If its a class member it won't be accessible from the C code.

Fair enough, I stand corrected. :)

liebman commented 5 years ago

Ok - your suggestions have been implemented.

liebman commented 5 years ago

@earlephilhower any more changes needed?

earlephilhower commented 5 years ago

Thanks for the reminder. I've been busy preparing for an industry trade show and not looking at the projects much this month.