The generic fix function
author | Richard Brooksby |
copyright | See Copyright and License. |
date | 1995-08-25 |
index terms | pair: fix function; design |
revision | //info.ravenbrook.com/project/mps/master/design/fix.txt#12 |
status | incomplete design |
tag | design.mps.fix |
Introduction
.intro: Fix is the interface through which the existence of references are communicated from the MPS client to the MPS. The interface also allows the value of such references to be changed (this is necessary in order to implement a moving memory manager).
Was-marked protocol
.was-marked: The ScanState has a Bool wasMarked field. This is used for finalization.
.was-marked.not: If a segment's fix method discovers that the object referred to by the ref (the one that it is supposed to be fixing) has not previously been marked (that is, this is the first reference to this object that has been fixed), and that the object was white (that is, in condemned space), it should (but need not) set the wasMarked field to FALSE in the passed ScanState.
.was-marked.otherwise: Otherwise, the fix method must leave the wasMarked field unchanged.
.was-marked.finalizable: The MRG pool (design.mps.poolmrg) uses the value of the wasMarked field to determine whether an object is finalizable.
Implementation
.fix.nailed: In a copying collection, a non-ambiguous fix to a broken heart should be snapped out even if there is a RankAMBIG ref to same object (that is, if the broken heart is nailed); the RankAMBIG reference must either be stale (no longer in existence) or bogus.
Document History
Copyright and License
Copyright © 2013–2020 Ravenbrook Limited.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.