#59 Patch for forwarding of references

closed
None
5
2012-09-21
2006-06-30
No

The current implementation to handle when forwarding of
weak, soft, and phantom references does not record the
updated addresses. This patch fixes the problem.

    STATEMENT OF ORIGIN FOR A SINGLE CONTRIBUTOR

I, Matthew Hertz:

(a) represent that either:

(i) I am the only author and owner of the contributed
software
(described as/entitled fix to ReferenceGlue),
which was neither derived nor copied from any
other software,
or

(ii) that any exception to (i) is software which was
obtained under the
CPL (Common Public License),

and

(b) hereby agree to license this contributed software
under the CPL.

Discussion

  • Matthew Hertz

    Matthew Hertz - 2006-06-30

    Simple patch to ReferenceGlue.java

     
  • Daniel Frampton

    Daniel Frampton - 2006-06-30

    Logged In: YES
    user_id=1215450

    On review I believe the current behaviour is correct, and
    this patch would break mark compact (the only collector
    that calls this phase).

    For collectors such as semispace, the forwarding process
    occurs incrementally during collection as both the new and
    old copies are visible. In this case, we must update
    the 'new' versions of objects. For these collectors forward
    () is never called.

    The forward method exists specifically for collectors that
    need a separate forwarding phase (e.g. mark compact),
    where the old copies of the objects have all references
    updated to where the objects will be moved to. The new
    references are currently dangling -- we cannot use them
    and must tread carefully.

    For this reason we maintain prevReference as an 'old'
    reference while walking the linked list, as we are still
    updating the 'old' locations.

     
  • Matthew Hertz

    Matthew Hertz - 2006-06-30

    Logged In: YES
    user_id=1530334

    While I understand why the code exists, it will only work if
    the code uses an additional pass to move objects and does
    not move objects and set forwarding pointers in this method.

    Given these two contradictory approaches (I discovered this
    problem while portning my bookmarking collector to the CVS
    head), perhaps we should use a boolean parameter to specify
    whether the method will also be copying the objects (in
    which case we should include my code).

     
  • Dave Grove

    Dave Grove - 2006-07-07

    Logged In: YES
    user_id=1215435

    Hi Daniel,

    I assigned this to you just to record that you are iterating
    with Matthew on it.

     
  • Daniel Frampton

    Daniel Frampton - 2006-10-26

    Logged In: YES
    user_id=1215450

    Current behaviour is correct.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks