aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog9
-rw-r--r--src/nsfns.m9
-rw-r--r--src/w32heap.c25
3 files changed, 38 insertions, 5 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 6819a76f028..b6e30ab817c 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,12 @@
12011-05-05 Eli Zaretskii <eliz@gnu.org>
2
3 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
4 New version that can reserve upto 2GB of heap space.
5
62011-05-05 Chong Yidong <cyd@stupidchicken.com>
7
8 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
9
12011-05-05 Teodor Zlatanov <tzz@lifelogs.com> 102011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
2 11
3 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to 12 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
diff --git a/src/nsfns.m b/src/nsfns.m
index d4445d1d627..cdf350066be 100644
--- a/src/nsfns.m
+++ b/src/nsfns.m
@@ -1416,9 +1416,10 @@ DEFUN ("ns-popup-color-panel", Fns_popup_color_panel, Sns_popup_color_panel,
1416DEFUN ("ns-read-file-name", Fns_read_file_name, Sns_read_file_name, 1, 4, 0, 1416DEFUN ("ns-read-file-name", Fns_read_file_name, Sns_read_file_name, 1, 4, 0,
1417 doc: /* Use a graphical panel to read a file name, using prompt PROMPT. 1417 doc: /* Use a graphical panel to read a file name, using prompt PROMPT.
1418Optional arg DIR, if non-nil, supplies a default directory. 1418Optional arg DIR, if non-nil, supplies a default directory.
1419Optional arg ISLOAD, if non-nil, means read a file name for saving. 1419Optional arg MUSTMATCH, if non-nil, means the returned file or
1420directory must exist.
1420Optional arg INIT, if non-nil, provides a default file name to use. */) 1421Optional arg INIT, if non-nil, provides a default file name to use. */)
1421 (Lisp_Object prompt, Lisp_Object dir, Lisp_Object isLoad, Lisp_Object init) 1422 (Lisp_Object prompt, Lisp_Object dir, Lisp_Object mustmatch, Lisp_Object init)
1422{ 1423{
1423 static id fileDelegate = nil; 1424 static id fileDelegate = nil;
1424 int ret; 1425 int ret;
@@ -1443,7 +1444,7 @@ Optional arg INIT, if non-nil, provides a default file name to use. */)
1443 if ([dirS characterAtIndex: 0] == '~') 1444 if ([dirS characterAtIndex: 0] == '~')
1444 dirS = [dirS stringByExpandingTildeInPath]; 1445 dirS = [dirS stringByExpandingTildeInPath];
1445 1446
1446 panel = NILP (isLoad) ? 1447 panel = NILP (mustmatch) ?
1447 (id)[EmacsSavePanel savePanel] : (id)[EmacsOpenPanel openPanel]; 1448 (id)[EmacsSavePanel savePanel] : (id)[EmacsOpenPanel openPanel];
1448 1449
1449 [panel setTitle: promptS]; 1450 [panel setTitle: promptS];
@@ -1457,7 +1458,7 @@ Optional arg INIT, if non-nil, provides a default file name to use. */)
1457 1458
1458 panelOK = 0; 1459 panelOK = 0;
1459 BLOCK_INPUT; 1460 BLOCK_INPUT;
1460 if (NILP (isLoad)) 1461 if (NILP (mustmatch))
1461 { 1462 {
1462 ret = [panel runModalForDirectory: dirS file: initS]; 1463 ret = [panel runModalForDirectory: dirS file: initS];
1463 } 1464 }
diff --git a/src/w32heap.c b/src/w32heap.c
index bbdabd23502..477c11a5160 100644
--- a/src/w32heap.c
+++ b/src/w32heap.c
@@ -114,6 +114,7 @@ get_data_end (void)
114 return data_region_end; 114 return data_region_end;
115} 115}
116 116
117#if !defined (USE_LISP_UNION_TYPE) && !defined (USE_LSB_TAG)
117static char * 118static char *
118allocate_heap (void) 119allocate_heap (void)
119{ 120{
@@ -140,9 +141,31 @@ allocate_heap (void)
140 141
141 return ptr; 142 return ptr;
142} 143}
144#else /* USE_LISP_UNION_TYPE || USE_LSB_TAG */
145static char *
146allocate_heap (void)
147{
148 unsigned long size = 0x80000000; /* start by asking for 2GB */
149 void *ptr = NULL;
150
151 while (!ptr && size > 0x00100000)
152 {
153 reserved_heap_size = size;
154 ptr = VirtualAlloc (NULL,
155 get_reserved_heap_size (),
156 MEM_RESERVE,
157 PAGE_NOACCESS);
158 size -= 0x00800000; /* if failed, decrease request by 8MB */
159 }
160
161 return ptr;
162}
163#endif /* USE_LISP_UNION_TYPE || USE_LSB_TAG */
143 164
144 165
145/* Emulate Unix sbrk. */ 166/* Emulate Unix sbrk. Note that ralloc.c expects the return value to
167 be the address of the _start_ (not end) of the new block in case of
168 success, and zero (not -1) in case of failure. */
146void * 169void *
147sbrk (unsigned long increment) 170sbrk (unsigned long increment)
148{ 171{