emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/emacs-23 r100566: Allow the Windows build t


From: Eli Zaretskii
Subject: [Emacs-diffs] /srv/bzr/emacs/emacs-23 r100566: Allow the Windows build to use upto 2GB of heap.
Date: Fri, 29 Apr 2011 17:23:44 +0300
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 100566
committer: Eli Zaretskii <address@hidden>
branch nick: emacs-23
timestamp: Fri 2011-04-29 17:23:44 +0300
message:
  Allow the Windows build to use upto 2GB of heap.
  
   src/w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
   New version that can reserve upto 2GB of heap space.
   etc/NEWS: Mention the new feature.
modified:
  etc/NEWS
  src/ChangeLog
  src/w32heap.c
=== modified file 'etc/NEWS'
--- a/etc/NEWS  2011-03-23 18:14:01 +0000
+++ b/etc/NEWS  2011-04-29 14:23:44 +0000
@@ -139,6 +139,11 @@
 ** The nextstep port can have different modifiers for the left and right
 alt/option key by customizing the value for ns-right-alternate-modifier.
 
+** The MS-Windows port can now use more than 500MB of heap.
+Depending on the available virtual memory, Emacs on Windows can now
+have up to 2GB of heap space.  This allows, e.g., to visit several
+large (> 256MB) files in the same session.
+
 
 * Installation Changes in Emacs 23.2
 

=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2011-04-26 18:31:04 +0000
+++ b/src/ChangeLog     2011-04-29 14:23:44 +0000
@@ -1,3 +1,8 @@
+2011-04-29  Eli Zaretskii  <address@hidden>
+
+       * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
+       New version that can reserve upto 2GB of heap space.
+
 2011-04-26  Chong Yidong  <address@hidden>
 
        * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).

=== modified file 'src/w32heap.c'
--- a/src/w32heap.c     2011-01-02 23:50:46 +0000
+++ b/src/w32heap.c     2011-04-29 14:23:44 +0000
@@ -119,6 +119,7 @@
   return data_region_end;
 }
 
+#if !defined (USE_LISP_UNION_TYPE) && !defined (USE_LSB_TAG)
 static char *
 allocate_heap (void)
 {
@@ -145,9 +146,31 @@
 
   return ptr;
 }
-
-
-/* Emulate Unix sbrk.  */
+#else  /* USE_LISP_UNION_TYPE || USE_LSB_TAG */
+static char *
+allocate_heap (void)
+{
+  unsigned long size = 0x80000000; /* start by asking for 2GB */
+  void *ptr = NULL;
+
+  while (!ptr && size > 0x00100000)
+    {
+      reserved_heap_size = size;
+      ptr = VirtualAlloc (NULL,
+                         get_reserved_heap_size (),
+                         MEM_RESERVE,
+                         PAGE_NOACCESS);
+      size -= 0x00800000; /* if failed, decrease request by 8MB */
+    }
+
+  return ptr;
+}
+#endif /* USE_LISP_UNION_TYPE || USE_LSB_TAG */
+
+
+/* Emulate Unix sbrk.  Note that ralloc.c expects the return value to
+   be the address of the _start_ (not end) of the new block in case of
+   success, and zero (not -1) in case of failure.  */
 void *
 sbrk (unsigned long increment)
 {


reply via email to

[Prev in Thread] Current Thread [Next in Thread]