[m-rev.] for review: add skeleton region_builtin module
Julien Fischer
juliensf at csse.unimelb.edu.au
Fri Jun 8 16:45:48 AEST 2007
Estimated hours taken: 0.5
Branches: main
Add a new builtin module that defines a type and some predicates that
will be introduced by RBMM transformation. These are all just
placeholders at the moment.
library/region_builtin.m:
Add a new builtin module that contains types and predicates
that will be used by RBMM.
library/library.m:
Import the new module.
Unrelated change: delete the commented out clause of
mercury_std_library_module/1 for the unsafe module.
(The unsafe module was deleted from the standard library
after trace goals were introduced.)
doc/Mmakefile:
Don't include region_builtin.m in the library reference manual.
Julien.
Index: doc/Mmakefile
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/doc/Mmakefile,v
retrieving revision 1.46
diff -u -r1.46 Mmakefile
--- doc/Mmakefile 1 Jun 2007 14:23:43 -0000 1.46
+++ doc/Mmakefile 8 Jun 2007 06:42:13 -0000
@@ -257,6 +257,8 @@
;; \
$(LIBRARY_DIR)/table_builtin.m) \
;; \
+ $(LIBRARY_DIR)/region_builtin.m) \
+ ;; \
$(LIBRARY_DIR)/robdd.m) \
;; \
$(LIBRARY_DIR)/term_size_prof_builtin.m) \
@@ -286,6 +288,8 @@
$(LIBRARY_DIR)/erlang_rtti_implementation.m) \
;; \
$(LIBRARY_DIR)/table_builtin.m) \
+ ;; \
+ $(LIBRARY_DIR)/region_builtin.m) \
;; \
$(LIBRARY_DIR)/robdd.m) \
;; \
Index: library/library.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/library/library.m,v
retrieving revision 1.107
diff -u -r1.107 library.m
--- library/library.m 7 Jun 2007 06:14:00 -0000 1.107
+++ library/library.m 8 Jun 2007 06:42:13 -0000
@@ -147,6 +147,7 @@
:- import_module par_builtin.
:- import_module private_builtin.
:- import_module profiling_builtin.
+:- import_module region_builtin.
:- import_module rtti_implementation.
:- import_module table_builtin.
:- import_module term_size_prof_builtin.
@@ -245,6 +246,7 @@
mercury_std_library_module("random").
mercury_std_library_module("rational").
mercury_std_library_module("rbtree").
+mercury_std_library_module("region_builtin").
mercury_std_library_module("relation").
mercury_std_library_module("require").
mercury_std_library_module("robdd").
@@ -290,7 +292,6 @@
mercury_std_library_module("type_desc").
mercury_std_library_module("unit").
mercury_std_library_module("univ").
-% mercury_std_library_module("unsafe").
mercury_std_library_module("varset").
mercury_std_library_module("version_array").
mercury_std_library_module("version_array2d").
Index: library/region_builtin.m
===================================================================
RCS file: library/region_builtin.m
diff -N library/region_builtin.m
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ library/region_builtin.m 8 Jun 2007 06:42:13 -0000
@@ -0,0 +1,69 @@
+%---------------------------------------------------------------------------%
+% vim: ft=mercury ts=4 sw=4 et wm=0 tw=0
+%---------------------------------------------------------------------------%
+% Copyright (C) 2007 The University of Melbourne.
+% This file may only be copied under the terms of the GNU Library General
+% Public License - see the file COPYING.LIB in the Mercury distribution.
+%---------------------------------------------------------------------------%
+%
+% File: region_builtin.m.
+% Main authors: qph, juliensf.
+% Stability: low.
+%
+% This file is automatically imported into every module when region-based
+% memory management is enabled. It contains support predicates used for
+% RBMM.
+%
+% This module is a private part of the Mercury implementation; user modules
+% should never explicitly import this module. The interface for this module
+% does not get included in the Mercury library reference manual.
+%
+%-----------------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%
+
+:- module region_builtin.
+:- interface.
+
+%-----------------------------------------------------------------------------%
+
+ % A pointer to a memory region.
+ %
+:- type region.
+
+ % Create a new region.
+ %
+:- impure pred create_region(region::out) is det.
+
+ % Remove a region.
+ %
+:- impure pred remove_region(region::in) is det.
+
+%-----------------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%
+
+:- implementation.
+
+% XXX the following definitions are just placeholders. When runtime
+% support for RBMM is introduced they will be changed.
+
+:- type region == c_pointer.
+
+:- pragma foreign_proc("C",
+ create_region(Region::out),
+ [will_not_call_mercury],
+"
+ /* Region */
+ MR_fatal_error(\"region_builtin.create_region/1 NYI.\");
+").
+
+:- pragma foreign_proc("C",
+ remove_region(Region::in),
+ [will_not_call_mercury],
+"
+ /* Region */
+ MR_fatal_error(\"region_builtin.remove_region/1 NYI.\");
+").
+
+%-----------------------------------------------------------------------------%
+:- end_module region_builtin.
+%-----------------------------------------------------------------------------%
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to: mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions: mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------
More information about the reviews
mailing list