Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-4496

Refactor usages of ReferenceCounted such that the retain method is used in a consistent manner

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Internal
    • Labels:

      ReferenceCounted.retain is supposed to be called each time we store a new reference to a ReferenceCounted object in the process heap. However, for various reasons, including the fact that manual reference counting is difficult, we sometimes

      As a result, it is very difficult (at least to me, but maybe I am not the only one) to reason about the code that uses reference counting. To improve the matters, we could

      • refactor all existing usages of ReferenceCounted such that retain is always called immediately before (in the program order) the write action that stores a new reference in the process heap;
      • urge ourselves to follow the approach taken in the aforementioned refactoring.

            Assignee:
            Unassigned Unassigned
            Reporter:
            valentin.kovalenko@mongodb.com Valentin Kavalenka
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: