lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] [bug #20478] memp_malloc returns bogus value on malloc fail


From: Frédéric Bernon
Subject: [lwip-devel] [bug #20478] memp_malloc returns bogus value on malloc failure
Date: Sat, 14 Jul 2007 15:28:40 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; fr; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4

Follow-up Comment #11, bug #20478 (project lwip):

Yes, ok, that's the point I miss (explain at the beginning of the file): "We
don't need to preserve the struct memp while not allocated, so we can save a
little space and set MEMP_SIZE to 0."

Sorry Simon. So, if we want to avoid the "extra" if, we could come to the
original patch with a little change:

+++ memp.c 2007-07-11 11:41:49.105656200 -0700
@@ -355,6 +355,7 @@
#if MEMP_STATS
++lwip_stats.memp[type].err;
#endif /* MEMP_STATS */
+ SYS_ARCH_UNPROTECT(old_level); 
+ return NULL;
}

SYS_ARCH_UNPROTECT(old_level); 

But it increase a little bit the footprint ("more" if
SYS_LIGHTWEIGHT_PROT=1). Footprint vs Speed, for this specific case, I don't
have any preference...


    _______________________________________________________

Reply to this item at:

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

_______________________________________________
  Message posté via/par Savannah
  http://savannah.nongnu.org/





reply via email to

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