Clarifying why and documenting that transformed references must be in automatic pools, in response to review <https://github.com/ravenbrook/mps/pull/214#issuecomment-1590952221>.

This commit is contained in:
Richard Brooksby 2023-06-16 12:29:06 +01:00
parent 1ca69dd4ab
commit 1b334cdce5
3 changed files with 10 additions and 2 deletions

View file

@ -170,7 +170,10 @@ Res TransformAddOldNew(Transform transform,
if (old_list[i] == new_list[i])
continue; /* ignore identity-transforms */
/* Old refs must be in managed memory. */
/* .old-white: Old refs must be in managed memory, because
transformFix is only reached when a reference is to something
in the condemned set. Other referenes are eliminated by
TraceFix, and we can't (currently) transformation of them. */
{
Seg seg;
AVER(SegOfAddr(&seg, transform->arena, old_list[i]));

View file

@ -92,6 +92,9 @@ Not yet written
* Why the arena must be parked [When writing this up see
impl.c.trans.park. RB 2023-06-16].
* Why we can't transform arbitrary references (see
impl.c.trans.old-white).
References
----------

View file

@ -104,7 +104,9 @@ Interface
``transform`` is the transform to which the mappings will be added.
``old_array`` points to an array of old references.
``old_array`` points to an array of old references, all of which
must be to objects in pools whose blocks are automatically managed
(see :ref:`pool-properties`).
``new_array`` points to an array of corresponding new references.