arduino-libraries / NTPClient

Connect to a NTP server
533 stars 366 forks source link

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

Open MHotchin opened 1 year ago

MHotchin commented 1 year 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 1 year 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.