Code review comment for ~dirk.zimoch/epics-base:FilterForInfoFields

Revision history for this message
Ben Franksen (bfrk) wrote :

I don't think we disagree. I am fine with your definition "is_owner==!must_lock". But whether or not to lock (dbScanLock) is not the only question relevant here.

Immutable data does not have an owner: there is no need for any locking. Nevertheless (in the absence of garbage collection or ref counting) we must assign responsibility for deallocating the memory (unless the data remains life forever). This is signalled by a non-NULL dtor.

The other question is who has the relevant meta data? Again, for mutable data this is clearly the owner. For immutable data it could be the record or the field_log.

My refactor conflated all three notions: presence of a dtor == db_field_log is owner == db_field_log has the meta data. This is okay for mutable data but not for immutable.

The problem at hand, filters that allow to access info items, has these features: the data is immutable, so no owner; it has infinite life time, so there is no dtor; yet the meta data is held by the field_log, not the record.

This means we need another "degree of freedom": at least one extra bit, perhaps two. The design question is: precisely what meaning shall these bits have?

« Back to merge proposal