lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] [bug #48300] Private mempools allocate foreign memory


From: chrysn
Subject: [lwip-devel] [bug #48300] Private mempools allocate foreign memory
Date: Fri, 24 Jun 2016 07:29:24 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Linux) AppleWebKit/538.15 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/538.15 Midori/0.5

Follow-up Comment #3, bug #48300 (project lwip):

The patch did not have the desired effect; the symptom persists, and applying
it didn't even change the symbol table (`nm -S` output); given I don't have
memp debugging enabled (which might probably catch the issue), MEMP_SIZE is 0,
so the `(MEMP_SIZE + MEMP_ALIGN(size))` term is already rounded, so thus is
`(num) * ...`.

Reviewing other uses of LWIP_MEM_ALIGN_SIZE: ip_frag.c's u8_t buf enlarges
itself by MEM_ALIGN_SIZE - 1 (which is roughly equivalent to one of my
original proposals; I think the `-1` is a good catch because it's sufficient,
but having the extra space inside the LWIP_MEM_ALIGN_SIZE macro caues
unnecessary increases -- details, though, I could be wrong about them and
would need to do the math thoroughly). The idiom seems suitable, all in all,
and was introduced back then for the very same reason (see 96b788bea7fb8).

I suggest we use that as a quick fix, and introduce a more precise mechanism
for memp as well as ip_frag's buf when a portable formulation of
`__attribute__((aligned(n)))` was found. (That would depend on users of other
compilers than gcc to chime in).

    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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