[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] [bug #52763] mdns: move data off the stack and dynamically
[lwip-devel] [bug #52763] mdns: move data off the stack and dynamically allocate data.
Sun, 31 Dec 2017 05:09:16 -0500 (EST)
Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:57.0) Gecko/20100101 Firefox/57.0
Follow-up Comment #3, bug #52763 (project lwip):
Thank you for all the feedback, and an attempt has been made to address it
> Maybe having just a goto in the LWIP_ERROR macro and freeing the domain and
return in a common block?
Done, this now assumes that the LWIP_ERROR always includes the handler forms
otherwise it will give unreachable code warnings. I had not understood that
LWIP_ERROR should have done that and had defined it to be empty in non-debug
code, but perhaps that was just my mistake? Was the intention for the
LWIP_ERROR check to always be performed, but perhaps only verbose in debug
> Running realloc on each adding of a name to a domain seems like it will
fragment memory very quickly - or maybe many of the realloc calls will need to
do nothing if more memory than requested is given earlier.
There are trade offs, and stack allocation is fast and simple, but it is not
easy to grow a stack allocation and allocating the peak usage seems excessive
for a very limited system.
The use of realloc() has been removed for now, it uses mem_malloc() and
Additional Item Attachment:
File name: 0001-mdns-move-data-off-the-stack-and-dynamically-allocat.patch
Reply to this item at:
Message sent via/by Savannah