[ET Trac] [Einstein Toolkit] #1986: this compared to NULL in CarpetLib

Einstein Toolkit trac-noreply at einsteintoolkit.org
Thu Mar 2 16:09:05 CST 2017


#1986: this compared to NULL in CarpetLib
---------------------+------------------------------------------------------
  Reporter:  rhaas   |       Owner:  eschnett           
      Type:  defect  |      Status:  reopened           
  Priority:  minor   |   Milestone:                     
 Component:  Carpet  |     Version:  development version
Resolution:          |    Keywords:                     
---------------------+------------------------------------------------------

Comment (by rhaas):

 No,
 {{{
 this ? cent : src->cent
 }}}
 is what the current (in master) code does and that gives the "this
 compared to NULL warning". The underlying issue is using a NULL this
 pointer to call member functions. In the case of PeriodicCarpet this
 happens when doing dst->copy_from(...) with a NULL dst when dst is not a
 local component.

 I had a fix for that but it involved calling new_typed_data() when dst
 would otherwise be NULL. Initially the thought was that new_typed_data()
 may be too expensive. I am no longer so sure since transfer_from itself
 already creates a new gdata for its buf object all the time. I am however
 now working on a (not thread safe...) replacement that uses a single
 typed_data for all such occurrences.

-- 
Ticket URL: <https://trac.einsteintoolkit.org/ticket/1986#comment:6>
Einstein Toolkit <http://einsteintoolkit.org>
The Einstein Toolkit


More information about the Trac mailing list