Raymond Toy pushed to branch rtoy-mmap-anon-control-and-binding-stacks
at cmucl / cmucl
Commits:
-
f81b1ed0
by Raymond Toy
at 2016-05-11T19:19:00-07:00
Add comments.
-
c15a3f70
by Raymond Toy
at 2016-05-11T19:20:40-07:00
Fix up to preserve old behavior without RELOCATABLE_STACK_START.
2 changed files:
Changes:
src/lisp/lisp.c
--- a/src/lisp/lisp.c
+++ b/src/lisp/lisp.c
@@ -687,6 +687,13 @@ main(int argc, const char *argv[], const char *envp[])
if (builtin_image_flag != 0)
map_core_sections(argv[0]);
#endif
+
+ /*
+ * Validate the basic lisp spaces first like the heap and static
+ * and read-only spaces. Do this so that the stacks (if thy're
+ * relocatable) don't get randomly allocated on top of our desired
+ * lisp spaces.
+ */
validate();
gc_init();
validate_stacks();
src/lisp/solaris-os.c
--- a/src/lisp/solaris-os.c
+++ b/src/lisp/solaris-os.c
@@ -415,6 +415,10 @@ os_vm_address_t round_up_sparse_size(os_vm_address_t addr)
*/
static os_vm_address_t spaces[] = {
READ_ONLY_SPACE_START, STATIC_SPACE_START
+#ifndef RELOCATABLE_STACK_START
+ BINDING_STACK_START,
+ CONTROL_STACK_START
+#endif
};
/*
@@ -458,15 +462,19 @@ make_hole(char *space_start, size_t space_size)
void
make_holes(void)
{
+ int k;
os_vm_address_t hole;
/*
* Make holes of the appropriate size for desired spaces. The
- * stacks are handled in make_stack_holes.
+ * stacks are handled in make_stack_holes, if they are
+ * relocatable.
*/
- make_hole(spaces[0], *space_size[0]); /* Read-only space */
- make_hole(spaces[1], *space_size[1]); /* Static space */
+ for (k = 0; k < sizeof(spaces) / sizeof(spaces[0]); ++k) {
+ make_hole(spaces[k], *space_size[k]);
+ }
+
/* Round up the dynamic_space_size to the nearest SPARSE_BLOCK_SIZE */
dynamic_space_size = round_up_sparse_size(dynamic_space_size);
@@ -497,8 +505,10 @@ make_holes(void)
void
make_stack_holes(void)
{
+#ifdef RELOCATABLE_STACK_START
make_hole(control_stack, control_stack_size);
make_hole(binding_stack, binding_stack_size);
+#endif
}
void *