summaryrefslogtreecommitdiffstats
path: root/asmrun/startup.c
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>1997-07-02 18:16:15 +0000
committerXavier Leroy <xavier.leroy@inria.fr>1997-07-02 18:16:15 +0000
commitb149e67a887edbe66c5159dcc09485862ff3cf55 (patch)
tree5be8990215f73919b29c461d86726e75001e7f07 /asmrun/startup.c
parentf9ca4fbbeb38d1c1979300f68a9e37b409eb4c7e (diff)
Nouveau module Marshal dans stdlib
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@1633 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'asmrun/startup.c')
-rw-r--r--asmrun/startup.c30
1 files changed, 20 insertions, 10 deletions
diff --git a/asmrun/startup.c b/asmrun/startup.c
index f1dbc709a..c78fff4dc 100644
--- a/asmrun/startup.c
+++ b/asmrun/startup.c
@@ -27,23 +27,33 @@
header_t atom_table[256];
char * static_data_start, * static_data_end;
+char * code_area_start, * code_area_end;
-/* Initialize the atom table */
+/* Initialize the atom table and the static data and code area limits. */
+struct segment { char * begin; char * end; };
+
+static void minmax_table(table, min, max)
+ struct segment table[];
+ char ** min, ** max;
+{
+ int i;
+ *min = table[0].begin;
+ *max = table[0].end;
+ for (i = 1; table[i].begin != 0; i++) {
+ if (table[i].begin < *min) *min = table[i].begin;
+ if (table[i].end > *max) *max = table[i].end;
+ }
+}
+
static void init_atoms()
{
int i;
- extern struct { char * begin; char * end; } caml_data_segments[];
+ extern struct segment caml_data_segments[], caml_code_segments[];
for (i = 0; i < 256; i++) atom_table[i] = Make_header(0, i, White);
- static_data_start = caml_data_segments[0].begin;
- static_data_end = caml_data_segments[0].end;
- for (i = 1; caml_data_segments[i].begin != 0; i++) {
- if (caml_data_segments[i].begin < static_data_start)
- static_data_start = caml_data_segments[i].begin;
- if (caml_data_segments[i].end > static_data_end)
- static_data_end = caml_data_segments[i].end;
- }
+ minmax_table(caml_data_segments, &static_data_start, &static_data_end);
+ minmax_table(caml_code_segments, &code_area_start, &code_area_end);
}
/* Configuration parameters and flags */