On Thu, Jan 26, 2017 at 2:11 PM, Evan Huus <[email protected]> wrote:

>
> Each block can consist of multiple chunks, so you need a second, inner
> loop. You can do this with WMEM_CHUNK_NEXT.
>
> Do note, however, that:
> - you'll be iterating over every piece of memory allocated in this
> scope, which will probably be quite expensive
>

I get it.


> - your code will fail any time wmem chooses a different allocator
> (this happens in CI, and occasionally elsewhere as well)
>
>
I don't get this. Can you explain it a little bit?


> What problem specifically are you trying to solve? There may be an easier
> way.
>
> Evan


The general problem is: a function takes a wmem string as input. This
function can do wmem_realloc, then I need the scope the variable lives in.
If the caller gives the wrong scope, I have a crash. The question is how
can I check that the variable is consistent with the provided scope?
Despite very expensive, I could have this check in debug only to reduce the
debug time.
___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <[email protected]>
Archives:    https://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-dev
             mailto:[email protected]?subject=unsubscribe

Reply via email to