MPS issue job003776

TitlePool generations don't refer to the generation they belong to
Statusclosed
Prioritynice
Assigned userGareth Rees
OrganizationRavenbrook
DescriptionA pool generation belongs to a generation (via a ring in the generation). But it does not have a reference to the generation! Instead it has a reference to a chain and a generation number. The generation number is either an index into the array of generations in the chain, or else it is one more than the highest generation in the chain, in which case it is the arena top generation.

See the GenDesc and PoolGen structures in chain.h [1].

This is unnecessarily complex: every time you want to look up the generation that a pool generation belongs to, you have to remember the top generation logic. So this logic is repeated in several places in locus.c. [2]
AnalysisIt would be simpler and clearer is a pool generation referenced its generation directly. The logic for associating a pool generation with the arena’s top generation would then only appear in one place (the new function ChainGen).
How foundinspection
Evidence[1] <https://info.ravenbrook.com/project/mps/master/code/chain.h>
[2] <https://info.ravenbrook.com/project/mps/master/code/locus.c>
Created byGareth Rees
Created on2014-04-30 10:15:37
Last modified byGareth Rees
Last modified on2014-05-19 15:56:52
History2014-04-30 GDR Created.

Fixes

Change Effect Date User Description
186190 closed 2014-05-19 15:56:49 Gareth Rees Merge branch/2014-04-30/poolgen into the master sources.