about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2023-10-13 21:17:13 +0200
committerptitSeb <sebastien.chev@gmail.com>2023-10-13 21:17:13 +0200
commit60fed04cb75df2d4545898b827713fc7a4cf856d (patch)
treed4aee6a20c853331b26e647736a5bd783fa4e687
parent6c956013a6860361e7095ef00b403fcbd1ac6038 (diff)
downloadbox64-60fed04cb75df2d4545898b827713fc7a4cf856d.tar.gz
box64-60fed04cb75df2d4545898b827713fc7a4cf856d.zip
Use BOX64_RESERVE_HIGHMEM by default on ADLINK profile
-rw-r--r--docs/USAGE.md8
-rw-r--r--src/custommem.c4
2 files changed, 8 insertions, 4 deletions
diff --git a/docs/USAGE.md b/docs/USAGE.md
index 5778a231..e2b6075e 100644
--- a/docs/USAGE.md
+++ b/docs/USAGE.md
@@ -303,6 +303,10 @@ Define x86_64 bash to launch script
  * XXX=yyyy

  will add XXX=yyyy env. var. and continue with BOX86_ENV2 ... until var doesn't exist

 

+#### BOX64_RESERVE_HIGH

+* 0 : Don't try to pe-reserve high memory (beyond 47bits) (Default)

+* 1 : Try to reserve (without allocating it) memory beyond 47bits (seems unstable)

+

 #### BOX64_JITGDB *

  * 0 : Just print the Segfault message on segfault (default)

  * 1 : Launch `gdb` when a segfault, bus error or illegal instruction signal is trapped, attached to the offending process and go in an endless loop, waiting.

@@ -329,7 +333,3 @@ Those variables are only valid inside a rcfile:
 #### BOX64_EXIT

  * 0 : Nothing special

  * 1 : Just exit, don't try to run the program

-

-#### BOX64_RESERVE_HIGH

-* 0 : Don't try to pe-reserve high memory (beyond 47bits) (Default)

-* 1 : Try to reserve (without allocating it) memory beyond 47bits (seems unstable)

diff --git a/src/custommem.c b/src/custommem.c
index fb55ac2c..a5f4cf61 100644
--- a/src/custommem.c
+++ b/src/custommem.c
@@ -1631,7 +1631,11 @@ static void atfork_child_custommem(void)
 void reserveHighMem()
 {
     char* p = getenv("BOX64_RESERVE_HIGH");
+    #ifdef ADLINK
+    if(p && p[0]=='0')
+    #else
     if(!p || p[0]=='0')
+    #endif
         return; // don't reserve by default
     intptr_t cur = 1LL<<47;
     mapmem_t* m = mapmem;