EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  <20212022  2023  2024  Index 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  <20212022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: [Merge] ~dirk.zimoch/epics-base:FilterForInfoFields into epics-base:7.0
From: Ben Franksen via Core-talk <core-talk at aps.anl.gov>
To: mp+399414 at code.launchpad.net
Date: Wed, 10 Mar 2021 15:29:55 -0000
Here is what I think we should do. We add another member (one bit, no extra storage needed) to allow the filter to override the ownership decision made by dbfl_has_copy. We should also rename dbfl_has_copy to dbfl_is_owner to make this clearer. Then, instead of defining a dummy dtor, you can set pfl->is_owner = 1 and all is well. Like this:

diff --git a/modules/database/src/ioc/db/db_field_log.h b/modules/database/src/ioc/db/db_field_log.h
index e517d529f..68e725ed6 100644
--- a/modules/database/src/ioc/db/db_field_log.h
+++ b/modules/database/src/ioc/db/db_field_log.h
@@ -107,6 +107,7 @@ struct dbfl_ref {
  */
 typedef struct db_field_log {
     unsigned int     type:1;  /* type (union) selector */
+    unsigned int is_owner:1;  /* whether we own the data */
     /* ctx is used for all types */
     unsigned int      ctx:1;  /* context (operation type) */
     /* the following are used for value and reference types */
@@ -131,8 +132,9 @@ typedef struct db_field_log {
  * this case, making a copy is redundant, so we have no dtor. But conceptually
  * the db_field_log still owns the (empty) data.
  */
-#define dbfl_has_copy(p)\
- ((p) && ((p)->type==dbfl_type_val || (p)->u.r.dtor || (p)->no_elements==0))
+#define dbfl_is_owner(p)\
+ ((p) && ((p)->type==dbfl_type_val || (p)->u.r.dtor || (p)->no_elements==0\
+ || (p)->is_owner))
 
 #define dbfl_pfield(p)\
  ((p)->type==dbfl_type_val ? &p->u.v.field : p->u.r.field)

-- 
https://code.launchpad.net/~dirk.zimoch/epics-base/+git/epics-base/+merge/399414
Your team EPICS Core Developers is requested to review the proposed merge of ~dirk.zimoch/epics-base:FilterForInfoFields into epics-base:7.0.

References:
[Merge] ~dirk.zimoch/epics-base:FilterForInfoFields into epics-base:7.0 Dirk Zimoch via Core-talk

Navigate by Date:
Prev: Re: [Merge] ~dirk.zimoch/epics-base:FilterForInfoFields into epics-base:7.0 Dirk Zimoch via Core-talk
Next: Re: [Merge] ~dirk.zimoch/epics-base:FilterForInfoFields into epics-base:7.0 Ben Franksen via Core-talk
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  <20212022  2023  2024 
Navigate by Thread:
Prev: Re: [Merge] ~dirk.zimoch/epics-base:FilterForInfoFields into epics-base:7.0 Dirk Zimoch via Core-talk
Next: Re: [Merge] ~dirk.zimoch/epics-base:FilterForInfoFields into epics-base:7.0 Ben Franksen via Core-talk
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  <20212022  2023  2024 
ANJ, 10 Mar 2021 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·