MPS issue job003329

TitlePurpose of mps_alert_collection_set is unclear
Statusclosed
Priorityoptional
Assigned userGareth Rees
OrganizationRavenbrook
DescriptionIn mps.h [1] there's an undocumented function "mps_alert_collection_set". Looking at the implementation in mpsi.c [2], it sets "arena->alertCollection". This is a "client alert fn" that is called when a collection starts or finishes: see TracePostStartMessage and TracePostMessage in traceanc.c [3].

This seems dodgy: (a) it's calling back to the client program asynchronously; (b) there's already a (safe, synchronous) mechanism for the MPS to tell the client program about collection starting and stopping (that is, the message queue).
AnalysisThis function is used by the amcss test case, but in fact all it does is print messages to confirm that the alert has been received.

For the moment I've left this function undocumented.

GDR 2013-03-08: I propose that we deprecate it in the documentation and remove it in version 1.112. Or just remove it now: it's never been documented, and it's not used by OpenDylan.
How foundinspection
Evidence[1] <https://info.ravenbrook.com/project/mps/master/code/mps.h>
[2] <https://info.ravenbrook.com/project/mps/master/code/mpsi.c>
[3] <https://info.ravenbrook.com/project/mps/master/code/traceanc.c>
Observed in1.110.0
Created byGareth Rees
Created on2012-10-19 16:13:51
Last modified byGareth Rees
Last modified on2013-03-12 14:33:27
History2012-10-19 GDR Created.
2013-03-08 GDR Proposal.

Fixes

Change Effect Date User Description
181119 closed 2013-03-12 14:33:27 Gareth Rees Remove "mps_alert_collection_set" from public interface and remove its implementation and test case. Client programs should use the messages interface to find out what the MPS is doing.