[m-rev.] Updated diff for deep profiling.
Fergus Henderson
fjh at cs.mu.OZ.AU
Tue May 22 14:54:06 AEST 2001
On 22-May-2001, Zoltan Somogyi <zs at cs.mu.OZ.AU> wrote:
> On 18-May-2001, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> > [Zoltan wrote:]
> > > +++ dense_bitset.m Mon May 14 12:51:48 2001
> > ...
> > > +% This module provides an ADT for storing dense sets of small integers.
> > > +% The sets are represented as bit vectors, which are implemented as arrays
> > > +% of integers.
> >
> > I think Ralph already commented that this was similar to
> > library/bitmap.m. Could that be used instead?
>
> You are asking the wrong person. Tom wrote that, not me. However, I believe
> he wrote it before Ralph wrote, or at least committed, bitmap.m.
If it's just historical reasons, then the code should be changed to use
library/bitmap.m.
> > > Index: deep/interface.m
> > > +to(Where, Cmd) -->
> > > + io__tell(Where, Res),
> > > + ( { Res = ok } ->
> > > + io__write(Cmd),
> > > + io__write_string(".\n"),
> > > + io__told
> > > + ;
> > > + { error("mdprof to: couldn't open pipe") }
> > > + ).
> >
> > It's probably a good idea to use exceptions for errors here, but error/1
> > throws a software error exception, whereas this is really an I/O error.
> > So it would be better to use throw/1 rather than error/1.
> >
> > (Likewise elsewhere in this file.)
>
> Well, the system design tests for the existence of those pipes, and creates
> them if they do not initially exist, so if they cannot be opened, it is either
> a design error or a sign of intervention by God (i.e. root).
In that case, I suggest adding a comment e.g.
% <fill in the blank> should ensure that the pipe exists
% (and is writable)
where <fill in the blank> identifies the relevant part of the system
which is responsible for ensuring that the pipe exists.
> > > -library-menu.texi: $(LIBRARY_DIR)/*.m
> > > +library-menu.texi: $(LIBRARY_DIR)/[a-z]*.m
> >
> > What's the purpose of that change?
> > It doesn't seem to be described in the log message.
>
> I can undo it if you like, but it allows you to make backup copies of library
> modules in files starting with an upper case letter, without that action
> causing a time-consuming rebuilding of the library manual.
I think it would be cleaner to undo it.
It's a separate change, unrelated to adding deep profiling.
Using backup file names such as foo.m.old works fine.
Using uppercase letters is not portable to systems with
case-insensitive file systems anyway.
> > > +# array.m contains C code that #includes exception.h. This requires us
> > > +# to force exception.h to be made before array.c is compiled.
> > > +$(os_subdir)array.$O: $(cs_subdir)exception.c
> > > +$(os_subdir)array.pic_o: $(cs_subdir)exception.c
> >
> > That won't work with --target asm.
> >
> > The dependency should be on the `.h' file, rather than on the `.c' file,
> > I think. But I don't think that is enough to solve the problem in all
> > grades.
>
> There are no rules for making the .h file, therefore one can't put a
> dependency on it. Its builting is a side-effect, and takes place only
> if the module exports some procedures.
That is grade dependent: in grade hlc.gc there are rules for making the .h
file. But it won't work in other grades, I agree.
> > Won't the normal dependencies handle this correctly anyway?
>
> No. I added the rule after finding that out.
>
> > The normal dependencies build all the .cs before building any of the .os.
>
> That depends (depended) on RM_C.
Ah, so the normal rules failed only in the case when RM_C is set?
Since RM_C has been deleted, that case should no longer arise.
Or is there some other case in which the normal rules failed?
> However, I have made the reporting of array bound errors via exception
> an implementor only facility, controlled by the ML_ARRAY_THROW_EXCEPTIONS.
> Since implementors can manually make exception.h if required, I have deleted
> the dependency of array.o on exception.c.
Deleting the dependency is the right thing to do, but I'd still like to
know if there are any cases where manual intervention is required.
--
Fergus Henderson <fjh at cs.mu.oz.au> | "I have always known that the pursuit
| of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-reviews mailing list
post: mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------
More information about the reviews
mailing list