1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-12 06:21:02 -08:00

Enforcing parking restrictions when adding references to transforms in response to review <https://github.com/ravenbrook/mps/pull/214#discussion_r1230987289>.

This commit is contained in:
Richard Brooksby 2023-06-16 12:48:42 +01:00
parent 1b334cdce5
commit dd38a6ef07
2 changed files with 11 additions and 4 deletions

View file

@ -152,19 +152,26 @@ Res TransformAddOldNew(Transform transform,
Res res;
Index i;
Count added = 0;
Arena arena;
AVERT(Transform, transform);
AVER(old_list != NULL);
AVER(new_list != NULL);
/* count: cannot check */
/* .assume.parked: If the mutator isn't adding references while the
arena is parked, we might need to access the client-provided
lists (old_list, new_list), using ArenaRead. Insisting on
parking keeps things simple. */
arena = transform->arena;
AVER(ArenaGlobals(arena)->clamped);
AVER(arena->busyTraces == TraceSetEMPTY);
res = TableGrow(transform->oldToNew, count);
if (res != ResOK)
return res;
for (i = 0; i < count; ++i) {
/* NOTE: If the mutator isn't adding references while the arena is parked,
we might need to access the client-provided lists, using ArenaRead. */
if (old_list[i] == NULL)
continue; /* permitted, but no transform to do */
if (old_list[i] == new_list[i])

View file

@ -90,7 +90,7 @@ Not yet written
* Nice side-effect is that "old" objects are killed.
* Why the arena must be parked [When writing this up see
impl.c.trans.park. RB 2023-06-16].
impl.c.trans.park and impl.c.trans.assume.parked. RB 2023-06-16].
* Why we can't transform arbitrary references (see
impl.c.trans.old-white).