comparison src/alloc.c @ 11727:53ccd2d608ee

(gc_cons_threshold): Change back to int. (min): New macro. (inhibit_garbage_collection): Don't exceed value an int can hold.
author Richard M. Stallman <rms@gnu.org>
date Sat, 06 May 1995 23:04:13 +0000
parents 1ced2d67d411
children 6be0b7a0ac44
comparison
equal deleted inserted replaced
11726:77a296d0ab90 11727:53ccd2d608ee
43 #endif 43 #endif
44 extern __malloc_size_t _bytes_used; 44 extern __malloc_size_t _bytes_used;
45 extern int __malloc_extra_blocks; 45 extern int __malloc_extra_blocks;
46 46
47 #define max(A,B) ((A) > (B) ? (A) : (B)) 47 #define max(A,B) ((A) > (B) ? (A) : (B))
48 #define min(A,B) ((A) < (B) ? (A) : (B))
48 49
49 /* Macro to verify that storage intended for Lisp objects is not 50 /* Macro to verify that storage intended for Lisp objects is not
50 out of range to fit in the space for a pointer. 51 out of range to fit in the space for a pointer.
51 ADDRESS is the start of the block, and SIZE 52 ADDRESS is the start of the block, and SIZE
52 is the amount of space within which objects can start. */ 53 is the amount of space within which objects can start. */
67 68
68 /* Number of bytes of consing done since the last gc */ 69 /* Number of bytes of consing done since the last gc */
69 int consing_since_gc; 70 int consing_since_gc;
70 71
71 /* Number of bytes of consing since gc before another gc should be done. */ 72 /* Number of bytes of consing since gc before another gc should be done. */
72 EMACS_INT gc_cons_threshold; 73 int gc_cons_threshold;
73 74
74 /* Nonzero during gc */ 75 /* Nonzero during gc */
75 int gc_in_progress; 76 int gc_in_progress;
76 77
77 #ifndef VIRT_ADDR_VARIES 78 #ifndef VIRT_ADDR_VARIES
1319 int 1320 int
1320 inhibit_garbage_collection () 1321 inhibit_garbage_collection ()
1321 { 1322 {
1322 int count = specpdl_ptr - specpdl; 1323 int count = specpdl_ptr - specpdl;
1323 Lisp_Object number; 1324 Lisp_Object number;
1324 1325 int nbits = min (VALBITS, INTBITS);
1325 XSETINT (number, ((EMACS_INT) 1 << (VALBITS - 1)) - 1); 1326
1327 XSETINT (number, ((EMACS_INT) 1 << (nbits - 1)) - 1);
1326 1328
1327 specbind (Qgc_cons_threshold, number); 1329 specbind (Qgc_cons_threshold, number);
1328 1330
1329 return count; 1331 return count;
1330 } 1332 }