comparison src/sheap.c @ 4840:17b3dc5500b0

changes to get old non-pdump dumping on Cygwin to work (sort of)
author Ben Wing <ben@xemacs.org>
date Tue, 12 Jan 2010 23:19:13 -0600
parents 70921960b980
children 19a72041c5ed
comparison
equal deleted inserted replaced
4839:5f1c6ca4d05e 4840:17b3dc5500b0
25 25
26 #include <unistd.h> 26 #include <unistd.h>
27 #include <sheap-adjust.h> 27 #include <sheap-adjust.h>
28 28
29 #define STATIC_HEAP_BASE 0x800000 29 #define STATIC_HEAP_BASE 0x800000
30 #define STATIC_HEAP_SLOP 0x40000 30 #define STATIC_HEAP_SLOP 0x80000
31 #define STATIC_HEAP_SIZE \ 31 #define STATIC_HEAP_SIZE \
32 (STATIC_HEAP_BASE + SHEAP_ADJUSTMENT + STATIC_HEAP_SLOP) 32 (STATIC_HEAP_BASE + SHEAP_ADJUSTMENT + STATIC_HEAP_SLOP)
33 #define BLOCKSIZE (1<<12) 33 #define BLOCKSIZE (1<<12)
34 #define ALLOC_UNIT (BLOCKSIZE-1) 34 #define ALLOC_UNIT (BLOCKSIZE-1)
35 #define ALLOC_MASK ~((unsigned long)(ALLOC_UNIT)) 35 #define ALLOC_MASK ~((unsigned long)(ALLOC_UNIT))
82 { 82 {
83 if (static_heap_ptr + size >= static_heap_base + static_heap_size) 83 if (static_heap_ptr + size >= static_heap_base + static_heap_size)
84 { 84 {
85 printf ( 85 printf (
86 "\nRequested %d bytes, static heap exhausted! base is %p, current ptr\n" 86 "\nRequested %d bytes, static heap exhausted! base is %p, current ptr\n"
87 "is %p. You have exhausted the static heap. \n" 87 "is %p, static heap size is %ld. You have exhausted the static heap. \n"
88 "\n" 88 "\n"
89 "If you are simply trying to compile, remove sheap-adjust.h\n" 89 "If you are simply trying to compile, remove sheap-adjust.h\n"
90 "and recompile from the top level. If this doesn't\n" 90 "and recompile from the top level. If this doesn't\n"
91 "work then STATIC_HEAP_SLOP (defined in this file) is too small.\n" 91 "work then STATIC_HEAP_SLOP (defined in this file) is too small.\n"
92 "\n" 92 "\n"
93 "If you want to run temacs, change SHEAP_ADJUSTMENT in sheap-adjust.h\n" 93 "If you want to run temacs, change SHEAP_ADJUSTMENT in sheap-adjust.h\n"
94 "to 0 or a +ve number. Generally you should *not* try to run temacs\n" 94 "to 0 or a +ve number. Generally you should *not* try to run temacs\n"
95 "with a static heap, you should dump first.\n", 95 "with a static heap, you should dump first.\n",
96 size, static_heap_base, static_heap_ptr); 96 size, static_heap_base, static_heap_ptr, static_heap_size);
97 97
98 exit(-1); 98 exit(-1);
99 return 0; 99 return 0;
100 } 100 }
101 } 101 }