Change to memory allocation for OpenVMS

VERIFIED FIXED in M10

Status

()

Core
XPCOM
P3
normal
VERIFIED FIXED
19 years ago
19 years ago

People

(Reporter: Colin Blake, Assigned: Suresh Duddi (gone))

Tracking

Trunk
DEC
Other
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

19 years ago
You asked me to file a bug report on this one, so here you go...

I know this code is likely to change in M10, but the attached diffs are what I
have working now for OpenVMS. If you can check this in, I'll make any necessary
changes later once the UNIX code path has the M10 changes.

This change ONLY affects OpenVMS.

Index: nsPageMgr.cpp
===================================================================
RCS file: /cvsroot/mozilla/xpcom/ds/nsPageMgr.cpp,v
retrieving revision 3.10
diff -u -r3.10 nsPageMgr.cpp
--- nsPageMgr.cpp       1999/08/11 05:59:26     3.10
+++ nsPageMgr.cpp       1999/08/13 20:16:06
@@ -39,6 +39,9 @@
 #endif

 #if defined(VMS)
+#if defined(DEBUG)
+#include <stdio.h>
+#endif
 #include <starlet.h>
 #include <ssdef.h>
 #include <vadef.h>
@@ -326,13 +329,27 @@
     int status;

     /*
+    ** The default is 32767 pages. This is quite a lot (the pages are 4k).
+    ** Let's at least make it configurable.
+    */
+
+    char *tmp;
+    tmp = getenv("VMS_PAGE_MANAGER_SIZE");
+    if (tmp)
+       size=atoi(tmp);
+#if defined(DEBUG)
+    printf("Requested page manager size is %d 4k pages\n",size);
+#endif
+
+    /*
     ** $EXPREG will extend the virtual address region by the requested
     ** number of pages (or pagelets on Alpha). The process must have
     ** sufficient PGFLQUOTA for the operation, otherwise SS$_EXQUOTA will
     ** be returned. However, in the case of SS$_EXQUOTA, $EXPREG will have
     ** grown the region by the largest possible amount. In this case we will
-    ** take what we could get, just so long as its over our minimum
-    ** threshold.
+    ** put back the maximum amount and repeat the $EXPREG requesting half of
+    ** maximum (so as to leave some memory for others), just so long as its
+    ** over our minimum threshold.
     */

     status = sys$expreg(size << (NS_PAGEMGR_PAGE_BITS-VA$C_PAGELET_SHIFT_SIZE),
@@ -344,14 +361,28 @@
             size = ( (int)retadr.va_range$ps_end_va -
                      (int)retadr.va_range$ps_start_va + 1
                    ) >> NS_PAGEMGR_PAGE_BITS;
+            status=sys$deltva(&retadr,&retadr2,0);
+           size=size/2;
             if (size < minPages) {
-                status=sys$deltva(&retadr,&retadr2,0);
                 return PR_FAILURE;
             }
+           status = sys$expreg(
+               size << (NS_PAGEMGR_PAGE_BITS-VA$C_PAGELET_SHIFT_SIZE),
+                &retadr,0,0);
+           if (status != SS$_NORMAL) {
+               status=sys$deltva(&retadr,&retadr2,0);
+                return PR_FAILURE;
+           }
+            size = ( (int)retadr.va_range$ps_end_va -
+                     (int)retadr.va_range$ps_start_va + 1
+                   ) >> NS_PAGEMGR_PAGE_BITS;
             break;
         default:
             return PR_FAILURE;
     }
+#if defined(DEBUG)
+    printf("Actual page manager size is %d 4k pages\n",size);
+#endif

     /* We got at least something */
     addr = (nsPage *)retadr.va_range$ps_start_va;
(Assignee)

Updated

19 years ago
Status: NEW → ASSIGNED
(Assignee)

Updated

19 years ago
Target Milestone: M10
(Assignee)

Updated

19 years ago
Status: ASSIGNED → RESOLVED
Last Resolved: 19 years ago
QA Contact: beppe → colin
Resolution: --- → FIXED
(Assignee)

Comment 1

19 years ago
This is a code fix. Colin can you check this and mark this bug verified.

cvs commit -m "bug#11902 Changes for page manager for openVMS. Thanks to Colin

 Blake <colin@theblakes.com>" nsPageMgr.cpp

Checking in nsPageMgr.cpp;
/cvsroot/mozilla/xpcom/ds/nsPageMgr.cpp,v  <--  nsPageMgr.cpp
new revision: 3.12; previous revision: 3.11
(Reporter)

Updated

19 years ago
Status: RESOLVED → VERIFIED
(Reporter)

Comment 2

19 years ago
Thanks dp.
You need to log in before you can comment on or make changes to this bug.