MPS issue job001681

TitleAMCHeaderFix is an unnecessary copy.
Statusclosed
Prioritynice
Assigned userRichard Brooksby
OrganizationRavenbrook
DescriptionAMCHeaderFix is an unnecessary copy.

It's clear that at some point this function was created by copying
AMCFix and editing it. Bad bad bad.
AnalysisProbably AMCHeaderFix should do something like: adjust, call AMCFix,
adjust. Possibly this should be a generic so that any pool can (with a
small cost in speed) have the ability to support headered objects.

See also job001789.

The AMC design says that the copy was made deliberately: "There are two versions of the fix method, due to its criticality" (see design.mps.poolamc.header.fix [1]). That's bogus with modern compilers.

GDR 2014-09-26: All test cases pass if we always set pool->fix = AMCHeaderFix in amcInitComm. Here are some benchmark results for gcbench in HOT variety with seed 1937632292 (best of 3 runs):

              xci6ll lii6ll w3i6mv
AMCFix: 61.94 35.56 8.01
AMCHeaderFix: 59.35 35.69 8.03

It looks as though the difference, if any, is within the normal range of variation.
How foundinspection
EvidenceSee poolamc.c
[1] <http://www.ravenbrook.com/project/mps/...lamc.html#design.mps.poolamc.header.fix>
Observed in1.108.0
Created byDavid Jones
Created on2007-07-12 15:35:00
Last modified byGareth Rees
Last modified on2014-10-20 16:38:54
History2007-07-12 DRJ Created
2013-03-19 GDR Assigned to RB.
2013-05-23 GDR Added reference to design.
2013-06-16 RB Downgraded to "nice" as this isn't affecting anyone (see job003499).

Fixes

Change Effect Date User Description
187293 closed 2014-10-20 16:38:54 Gareth Rees Remove duplicate function AMCFix (and rename AMCHeaderFix to AMCFix) so that we don't have the burden of maintaining two copies of this function.