From: Thomas Monjalon <thomas.monjalon@6wind.com>
To: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
Cc: dev@dpdk.org
Subject: Re: [PATCH 1/2] eal: add stailq safe iterator macro
Date: Fri, 22 Jul 2016 18:16:28 +0200 [thread overview]
Message-ID: <3574578.EDiVgcMiqN@xps13> (raw)
In-Reply-To: <1469203278-91363-1-git-send-email-sergio.gonzalez.monroy@intel.com>
2016-07-22 17:01, Sergio Gonzalez Monroy:
> Removing/freeing elements elements within a STAILQ_FOREACH loop
> is not safe. FreeBSD defines STAILQ_FOREACH_SAFE macro, which permits
> these operations safely.
>
> This patch defines this macro for Linux systems, where it is not defined.
[...]
> +#ifndef SLIST_FOREACH_SAFE
> +#define SLIST_FOREACH_SAFE(var, head, field, tvar) \
> + for ((var) = SLIST_FIRST((head)); \
> + (var) && ((tvar) = SLIST_NEXT((var), field), 1); \
> + (var) = (tvar))
> +#endif
The patch 2 requires STAILQ_FOREACH_SAFE, not SLIST_FOREACH_SAFE.
prev parent reply other threads:[~2016-07-22 16:16 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-22 16:01 [PATCH 1/2] eal: add stailq safe iterator macro Sergio Gonzalez Monroy
2016-07-22 16:01 ` [PATCH 2/2] mempool: fix unsafe tailq element removal Sergio Gonzalez Monroy
2016-07-25 16:30 ` Olivier Matz
2016-07-25 19:54 ` [PATCH v2] mempool: fix unsafe removal from list by callback Thomas Monjalon
2016-07-25 20:09 ` Olivier Matz
2016-07-25 20:21 ` Thomas Monjalon
2016-07-22 16:16 ` Thomas Monjalon [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3574578.EDiVgcMiqN@xps13 \
--to=thomas.monjalon@6wind.com \
--cc=dev@dpdk.org \
--cc=sergio.gonzalez.monroy@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.