lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] [bug #52763] mdns: move data off the stack and dynamically


From: Douglas
Subject: [lwip-devel] [bug #52763] mdns: move data off the stack and dynamically allocate data.
Date: Sun, 31 Dec 2017 05:09:16 -0500 (EST)
User-agent: 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
all.

> 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
builds?

> 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
mem_free().


(file #42771)
    _______________________________________________________

Additional Item Attachment:

File name: 0001-mdns-move-data-off-the-stack-and-dynamically-allocat.patch
Size:68 KB


    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?52763>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]