comparison src/alloc.c @ 764:bb24f1180bb6

entered into RCS
author Jim Blandy <jimb@redhat.com>
date Mon, 13 Jul 1992 19:54:34 +0000
parents 540b047ece4d
children dc3fda1e21d0
comparison
equal deleted inserted replaced
763:f2efaa0394de 764:bb24f1180bb6
22 #include "lisp.h" 22 #include "lisp.h"
23 #include "puresize.h" 23 #include "puresize.h"
24 #ifndef standalone 24 #ifndef standalone
25 #include "buffer.h" 25 #include "buffer.h"
26 #include "window.h" 26 #include "window.h"
27 #ifdef MULTI_SCREEN 27 #ifdef MULTI_FRAME
28 #include "screen.h" 28 #include "frame.h"
29 #endif /* MULTI_SCREEN */ 29 #endif /* MULTI_FRAME */
30 #endif 30 #endif
31 31
32 #include "syssignal.h" 32 #include "syssignal.h"
33 33
34 #define max(A,B) ((A) > (B) ? (A) : (B)) 34 #define max(A,B) ((A) > (B) ? (A) : (B))
66 #ifndef VIRT_ADDR_VARIES 66 #ifndef VIRT_ADDR_VARIES
67 extern 67 extern
68 #endif /* VIRT_ADDR_VARIES */ 68 #endif /* VIRT_ADDR_VARIES */
69 int malloc_sbrk_unused; 69 int malloc_sbrk_unused;
70 70
71 /* Two thresholds controlling how much undo information to keep. */ 71 /* Two limits controlling how much undo information to keep. */
72 int undo_threshold; 72 int undo_limit;
73 int undo_high_threshold; 73 int undo_strong_limit;
74 74
75 /* Non-nil means defun should do purecopy on the function definition */ 75 /* Non-nil means defun should do purecopy on the function definition */
76 Lisp_Object Vpurify_flag; 76 Lisp_Object Vpurify_flag;
77 77
78 #ifndef HAVE_SHM 78 #ifndef HAVE_SHM
1088 turned off in that buffer. Calling truncate_undo_list on 1088 turned off in that buffer. Calling truncate_undo_list on
1089 Qt tends to return NULL, which effectively turns undo back on. 1089 Qt tends to return NULL, which effectively turns undo back on.
1090 So don't call truncate_undo_list if undo_list is Qt. */ 1090 So don't call truncate_undo_list if undo_list is Qt. */
1091 if (! EQ (nextb->undo_list, Qt)) 1091 if (! EQ (nextb->undo_list, Qt))
1092 nextb->undo_list 1092 nextb->undo_list
1093 = truncate_undo_list (nextb->undo_list, undo_threshold, 1093 = truncate_undo_list (nextb->undo_list, undo_limit,
1094 undo_high_threshold); 1094 undo_strong_limit);
1095 nextb = nextb->next; 1095 nextb = nextb->next;
1096 } 1096 }
1097 } 1097 }
1098 1098
1099 gc_in_progress = 1; 1099 gc_in_progress = 1;
1342 for (i = 0; i < size; i++) /* and then mark its elements */ 1342 for (i = 0; i < size; i++) /* and then mark its elements */
1343 mark_object (&ptr->contents[i]); 1343 mark_object (&ptr->contents[i]);
1344 } 1344 }
1345 break; 1345 break;
1346 1346
1347 #ifdef MULTI_SCREEN 1347 #ifdef MULTI_FRAME
1348 case Lisp_Screen: 1348 case Lisp_Frame:
1349 { 1349 {
1350 register struct screen *ptr = XSCREEN (obj); 1350 register struct frame *ptr = XFRAME (obj);
1351 register int size = ptr->size; 1351 register int size = ptr->size;
1352 register int i; 1352 register int i;
1353 1353
1354 if (size & ARRAY_MARK_FLAG) break; /* Already marked */ 1354 if (size & ARRAY_MARK_FLAG) break; /* Already marked */
1355 ptr->size |= ARRAY_MARK_FLAG; /* Else mark it */ 1355 ptr->size |= ARRAY_MARK_FLAG; /* Else mark it */
1356 1356
1357 mark_object (&ptr->name); 1357 mark_object (&ptr->name);
1358 mark_object (&ptr->focus_screen); 1358 mark_object (&ptr->focus_frame);
1359 mark_object (&ptr->width); 1359 mark_object (&ptr->width);
1360 mark_object (&ptr->height); 1360 mark_object (&ptr->height);
1361 mark_object (&ptr->selected_window); 1361 mark_object (&ptr->selected_window);
1362 mark_object (&ptr->minibuffer_window); 1362 mark_object (&ptr->minibuffer_window);
1363 mark_object (&ptr->param_alist); 1363 mark_object (&ptr->param_alist);
1364 } 1364 }
1365 break; 1365 break;
1366 #endif /* MULTI_SCREEN */ 1366 #endif /* MULTI_FRAME */
1367 1367
1368 #if 0 1368 #if 0
1369 case Lisp_Temp_Vector: 1369 case Lisp_Temp_Vector:
1370 { 1370 {
1371 register struct Lisp_Vector *ptr = XVECTOR (obj); 1371 register struct Lisp_Vector *ptr = XVECTOR (obj);
1898 1898
1899 DEFVAR_LISP ("purify-flag", &Vpurify_flag, 1899 DEFVAR_LISP ("purify-flag", &Vpurify_flag,
1900 "Non-nil means loading Lisp code in order to dump an executable.\n\ 1900 "Non-nil means loading Lisp code in order to dump an executable.\n\
1901 This means that certain objects should be allocated in shared (pure) space."); 1901 This means that certain objects should be allocated in shared (pure) space.");
1902 1902
1903 DEFVAR_INT ("undo-threshold", &undo_threshold, 1903 DEFVAR_INT ("undo-limit", &undo_limit,
1904 "Keep no more undo information once it exceeds this size.\n\ 1904 "Keep no more undo information once it exceeds this size.\n\
1905 This threshold is applied when garbage collection happens.\n\ 1905 This limit is applied when garbage collection happens.\n\
1906 The size is counted as the number of bytes occupied,\n\ 1906 The size is counted as the number of bytes occupied,\n\
1907 which includes both saved text and other data."); 1907 which includes both saved text and other data.");
1908 undo_threshold = 20000; 1908 undo_limit = 20000;
1909 1909
1910 DEFVAR_INT ("undo-high-threshold", &undo_high_threshold, 1910 DEFVAR_INT ("undo-strong-limit", &undo_strong_limit,
1911 "Don't keep more than this much size of undo information.\n\ 1911 "Don't keep more than this much size of undo information.\n\
1912 A command which pushes past this size is itself forgotten.\n\ 1912 A command which pushes past this size is itself forgotten.\n\
1913 This threshold is applied when garbage collection happens.\n\ 1913 This limit is applied when garbage collection happens.\n\
1914 The size is counted as the number of bytes occupied,\n\ 1914 The size is counted as the number of bytes occupied,\n\
1915 which includes both saved text and other data."); 1915 which includes both saved text and other data.");
1916 undo_high_threshold = 30000; 1916 undo_strong_limit = 30000;
1917 1917
1918 defsubr (&Scons); 1918 defsubr (&Scons);
1919 defsubr (&Slist); 1919 defsubr (&Slist);
1920 defsubr (&Svector); 1920 defsubr (&Svector);
1921 defsubr (&Smake_byte_code); 1921 defsubr (&Smake_byte_code);