comparison src/vm-limit.c @ 1400:af08281c0cbe

(warnfunction): Renamed to warn_function (was used inconsistently). (morecore_with_warning, memory_warnings): Change callers (were inconsistent).
author Roland McGrath <roland@gnu.org>
date Mon, 12 Oct 1992 19:59:52 +0000
parents 70d0cd4c5bff
children 60bb5e719468
comparison
equal deleted inserted replaced
1399:dbb56cda0b28 1400:af08281c0cbe
40 */ 40 */
41 static int warnlevel; 41 static int warnlevel;
42 42
43 /* Function to call to issue a warning; 43 /* Function to call to issue a warning;
44 0 means don't issue them. */ 44 0 means don't issue them. */
45 static void (*warnfunction) (); 45 static void (*warn_function) ();
46 46
47 extern POINTER sbrk (); 47 extern POINTER sbrk ();
48 48
49 /* Get more memory space, complaining if we're near the end. */ 49 /* Get more memory space, complaining if we're near the end. */
50 50
61 get_lim_data (); 61 get_lim_data ();
62 five_percent = lim_data / 20; 62 five_percent = lim_data / 20;
63 63
64 /* Find current end of memory and issue warning if getting near max */ 64 /* Find current end of memory and issue warning if getting near max */
65 cp = sbrk (0); 65 cp = sbrk (0);
66 data_size = cp - data_space_start; 66 data_size = (char *) cp - (char *) data_space_start;
67 67
68 if (warnfunction) 68 if (warn_function)
69 switch (warnlevel) 69 switch (warnlevel)
70 { 70 {
71 case 0: 71 case 0:
72 if (data_size > five_percent * 15) 72 if (data_size > five_percent * 15)
73 { 73 {
109 when we go up again. */ 109 when we go up again. */
110 else if (warnlevel > 2 && data_size < five_percent * 18) 110 else if (warnlevel > 2 && data_size < five_percent * 18)
111 warnlevel = 2; 111 warnlevel = 2;
112 112
113 if (EXCEEDS_LISP_PTR (cp)) 113 if (EXCEEDS_LISP_PTR (cp))
114 (*warnfunction) ("Warning: memory in use exceeds lisp pointer size"); 114 (*warn_function) ("Warning: memory in use exceeds lisp pointer size");
115 115
116 result = sbrk (size); 116 result = sbrk (size);
117 if (result == (POINTER) -1) 117 if (result == (POINTER) -1)
118 return NULL; 118 return NULL;
119 return result; 119 return result;
132 if (start) 132 if (start)
133 data_space_start = start; 133 data_space_start = start;
134 else 134 else
135 data_space_start = start_of_data (); 135 data_space_start = start_of_data ();
136 136
137 warnfunction = warnfun; 137 warn_function = warnfun;
138 __morecore = &morecore_with_warning; 138 __morecore = &morecore_with_warning;
139 } 139 }