Files
mercury/runtime/mercury_report_stats.h
Julien Fischer ee1d0782be Handle I/O errors when reporting statistics.
Detect I/O errors that occur when reporting statistics and handle them them by
throwing io.error exceptions.

runtime/mercury_report_stats.[ch]:
    Make MR_report_{standard,full_memory}_stats return zero on success
    or errno if an I/O error occurs.

library/io.m:
    Return a system_error indication from the report statistics predicates
    and throw an io.error exception on an error.

library/benchmarking.m:
    Implement report_stats/0 and report_full_memory_stats/0 by calling the
    report statistics predicates from the io module rather then by using
    foreign_procs. This ensures we get identical error handling behaviour
    between the two modules.

    Simplify the C# and Java statistics reporting methods.
2021-04-05 16:35:44 +10:00

21 lines
566 B
C

// vim: ts=4 sw=4 expandtab ft=c
// Copyright (C) 2021 The Mercury team.
// This file is distributed under the terms specified in COPYING.LIB.
// mercury_report_stats.h - functions for reporting statistics
// about the execution of the current program.
#ifndef MERCURY_REPORT_STATS_H
#define MERCURY_REPORT_STATS_H
#include <stdio.h>
#include "mercury_timing.h"
#include "mercury_heap.h"
extern int MR_report_standard_stats(FILE *fp, int *line_number);
extern int MR_report_full_memory_stats(FILE *fp, int *line_number);
#endif // not MERCURY_REPORT_STATS_H