arduino-libraries / NTPClient

Connect to a NTP server
554 stars 376 forks source link

Memory buffer could be stack allocated, saving global memory. #178

Open MHotchin opened 2 years ago

MHotchin commented 2 years ago

Currently the memory buffer used to send and receive the UDP packet is allocated in the NTP object.

It is only ever used in one function, it could be allocated as a stack object instead.

MHotchin commented 2 years ago

My mistake - it's used in two places, but none of the data in the buffer is reused. It could be stack allocated in both functions.