Mercurial > hg > xemacs-beta
comparison src/sheap.c @ 410:de805c49cfc1 r21-2-35
Import from CVS: tag r21-2-35
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:19:21 +0200 |
parents | 74fd4e045ea6 |
children | 697ef44129c6 |
comparison
equal
deleted
inserted
replaced
409:301b9ebbdf3b | 410:de805c49cfc1 |
---|---|
17 along with XEmacs; see the file COPYING. If not, write to the Free | 17 along with XEmacs; see the file COPYING. If not, write to the Free |
18 Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA | 18 Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA |
19 02111-1307, USA.*/ | 19 02111-1307, USA.*/ |
20 | 20 |
21 #include <config.h> | 21 #include <config.h> |
22 #include <stdio.h> | |
23 #include "lisp.h" | 22 #include "lisp.h" |
23 | |
24 #include <unistd.h> | 24 #include <unistd.h> |
25 #include <sheap-adjust.h> | 25 #include <sheap-adjust.h> |
26 | 26 |
27 #define STATIC_HEAP_BASE 0x800000 | 27 #define STATIC_HEAP_BASE 0x800000 |
28 #define STATIC_HEAP_SLOP 0x40000 | 28 #define STATIC_HEAP_SLOP 0x40000 |
38 char* static_heap_ptr=static_heap_buffer; | 38 char* static_heap_ptr=static_heap_buffer; |
39 unsigned long static_heap_size=STATIC_HEAP_SIZE; | 39 unsigned long static_heap_size=STATIC_HEAP_SIZE; |
40 int static_heap_initialized=0; | 40 int static_heap_initialized=0; |
41 int static_heap_dumped=0; | 41 int static_heap_dumped=0; |
42 | 42 |
43 void* more_static_core ( ptrdiff_t increment ); | |
43 void* more_static_core ( ptrdiff_t increment ) | 44 void* more_static_core ( ptrdiff_t increment ) |
44 { | 45 { |
45 int size = (int) increment; | 46 int size = (int) increment; |
46 void *result; | 47 void *result; |
47 | 48 |
56 #endif | 57 #endif |
57 static_heap_base=(char*)ALIGN_ALLOC(static_heap_buffer); | 58 static_heap_base=(char*)ALIGN_ALLOC(static_heap_buffer); |
58 static_heap_ptr=static_heap_base; | 59 static_heap_ptr=static_heap_base; |
59 static_heap_size=STATIC_HEAP_SIZE - | 60 static_heap_size=STATIC_HEAP_SIZE - |
60 (static_heap_base-static_heap_buffer); | 61 (static_heap_base-static_heap_buffer); |
61 #ifdef __CYGWIN32__ | 62 #ifdef CYGWIN |
62 sbrk(BLOCKSIZE); /* force space for fork to work */ | 63 sbrk(BLOCKSIZE); /* force space for fork to work */ |
63 #endif | 64 #endif |
64 static_heap_initialized=1; | 65 static_heap_initialized=1; |
65 } | 66 } |
66 | 67 |
117 "# define SHEAP_ADJUSTMENT (%d)\n", | 118 "# define SHEAP_ADJUSTMENT (%d)\n", |
118 ((static_heap_ptr - static_heap_buffer) - STATIC_HEAP_BASE)); | 119 ((static_heap_ptr - static_heap_buffer) - STATIC_HEAP_BASE)); |
119 fclose (stream); | 120 fclose (stream); |
120 } | 121 } |
121 | 122 |
123 void report_sheap_usage (int die_if_pure_storage_exceeded); | |
122 void | 124 void |
123 report_sheap_usage (int die_if_pure_storage_exceeded) | 125 report_sheap_usage (int die_if_pure_storage_exceeded) |
124 { | 126 { |
125 int rc = 0; | 127 int rc = 0; |
126 | 128 |