All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
To: Jeremie Galarneau <jeremie.galarneau@efficios.com>
Cc: lttng-dev <lttng-dev@lists.lttng.org>
Subject: Re: [PATCH urcu] cds_lfht_is_node_deleted parameter can be marked const
Date: Mon, 28 Oct 2019 15:27:58 -0400 (EDT)	[thread overview]
Message-ID: <458869007.17979.1572290878981.JavaMail.zimbra__7654.35921946249$1572290900$gmane$org@efficios.com> (raw)
In-Reply-To: <20191028192436.66672-1-jeremie.galarneau@efficios.com>

Merged into liburcu master, thanks!

Mathieu

----- On Oct 28, 2019, at 3:24 PM, Jeremie Galarneau jeremie.galarneau@efficios.com wrote:

> Mark the cds_lfht_node pointer parameter of cds_lfht_is_node_deleted
> as const. The fact that this parameter is mutable makes it harder to
> use liburcu in const-correct code.
> 
> Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
> ---
> include/urcu/rculfhash.h | 2 +-
> src/rculfhash.c          | 4 ++--
> 2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/include/urcu/rculfhash.h b/include/urcu/rculfhash.h
> index cbf513e..20b822f 100644
> --- a/include/urcu/rculfhash.h
> +++ b/include/urcu/rculfhash.h
> @@ -499,7 +499,7 @@ int cds_lfht_del(struct cds_lfht *ht, struct cds_lfht_node
> *node);
>  * This function does not issue any memory barrier.
>  */
> extern
> -int cds_lfht_is_node_deleted(struct cds_lfht_node *node);
> +int cds_lfht_is_node_deleted(const struct cds_lfht_node *node);
> 
> /*
>  * cds_lfht_resize - Force a hash table resize
> diff --git a/src/rculfhash.c b/src/rculfhash.c
> index ff42df0..8e60f19 100644
> --- a/src/rculfhash.c
> +++ b/src/rculfhash.c
> @@ -825,7 +825,7 @@ struct cds_lfht_node *clear_flag(struct cds_lfht_node *node)
> }
> 
> static
> -int is_removed(struct cds_lfht_node *node)
> +int is_removed(const struct cds_lfht_node *node)
> {
> 	return ((unsigned long) node) & REMOVED_FLAG;
> }
> @@ -1829,7 +1829,7 @@ int cds_lfht_del(struct cds_lfht *ht, struct cds_lfht_node
> *node)
> 	return ret;
> }
> 
> -int cds_lfht_is_node_deleted(struct cds_lfht_node *node)
> +int cds_lfht_is_node_deleted(const struct cds_lfht_node *node)
> {
> 	return is_removed(CMM_LOAD_SHARED(node->next));
> }
> --
> 2.23.0

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com
_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

       reply	other threads:[~2019-10-28 19:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20191028192436.66672-1-jeremie.galarneau@efficios.com>
2019-10-28 19:27 ` Mathieu Desnoyers [this message]
2019-10-28 19:24 [PATCH urcu] cds_lfht_is_node_deleted parameter can be marked const Jérémie Galarneau

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='458869007.17979.1572290878981.JavaMail.zimbra__7654.35921946249$1572290900$gmane$org@efficios.com' \
    --to=mathieu.desnoyers@efficios.com \
    --cc=jeremie.galarneau@efficios.com \
    --cc=lttng-dev@lists.lttng.org \
    /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.