[Git][cmucl/cmucl][rtoy-mmap-anon-control-and-binding-stacks] 2 commits: Add comments.

Raymond Toy rtoy at common-lisp.net
Thu May 12 02:20:55 UTC 2016


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:

- src/lisp/lisp.c
- src/lisp/solaris-os.c


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 *



View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/compare/38fdea64c854d5f0e13f1b16ea94fa974caeb340...c15a3f708a16275a7504ced4f163f102dfbcb287
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/cmucl-cvs/attachments/20160512/bf1aa0c5/attachment.html>


More information about the cmucl-cvs mailing list