aboutsummaryrefslogtreecommitdiffstats
path: root/src/alloc.c
diff options
context:
space:
mode:
authorAlan Mackenzie2022-01-11 21:57:54 +0000
committerAlan Mackenzie2022-01-11 21:57:54 +0000
commit2128cd8c08da84ab40608ac5db0fecfce733cfad (patch)
treee295275b1a99aed2e5e0cc270f91614062c670f6 /src/alloc.c
parent4e77177b063f9da8a48709aa3ef416d0ac21837b (diff)
parent18dac472553e6cd1102b644c2175012e12215c18 (diff)
downloademacs-2128cd8c08da84ab40608ac5db0fecfce733cfad.tar.gz
emacs-2128cd8c08da84ab40608ac5db0fecfce733cfad.zip
Merge branch 'master' into scratch/correct-warning-pos
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c34
1 files changed, 24 insertions, 10 deletions
diff --git a/src/alloc.c b/src/alloc.c
index 0d69f23048a..e0b2c220231 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -1,6 +1,6 @@
1/* Storage allocation and gc for GNU Emacs Lisp interpreter. 1/* Storage allocation and gc for GNU Emacs Lisp interpreter.
2 2
3Copyright (C) 1985-1986, 1988, 1993-1995, 1997-2021 Free Software 3Copyright (C) 1985-1986, 1988, 1993-1995, 1997-2022 Free Software
4Foundation, Inc. 4Foundation, Inc.
5 5
6This file is part of GNU Emacs. 6This file is part of GNU Emacs.
@@ -125,6 +125,7 @@ union emacs_align_type
125 struct Lisp_Overlay Lisp_Overlay; 125 struct Lisp_Overlay Lisp_Overlay;
126 struct Lisp_Sub_Char_Table Lisp_Sub_Char_Table; 126 struct Lisp_Sub_Char_Table Lisp_Sub_Char_Table;
127 struct Lisp_Subr Lisp_Subr; 127 struct Lisp_Subr Lisp_Subr;
128 struct Lisp_Sqlite Lisp_Sqlite;
128 struct Lisp_User_Ptr Lisp_User_Ptr; 129 struct Lisp_User_Ptr Lisp_User_Ptr;
129 struct Lisp_Vector Lisp_Vector; 130 struct Lisp_Vector Lisp_Vector;
130 struct terminal terminal; 131 struct terminal terminal;
@@ -3160,26 +3161,26 @@ cleanup_vector (struct Lisp_Vector *vector)
3160 module_finalize_function (function); 3161 module_finalize_function (function);
3161 } 3162 }
3162#endif 3163#endif
3163 else if (NATIVE_COMP_FLAG 3164#ifdef HAVE_NATIVE_COMP
3164 && PSEUDOVECTOR_TYPEP (&vector->header, PVEC_NATIVE_COMP_UNIT)) 3165 else if (PSEUDOVECTOR_TYPEP (&vector->header, PVEC_NATIVE_COMP_UNIT))
3165 { 3166 {
3166 struct Lisp_Native_Comp_Unit *cu = 3167 struct Lisp_Native_Comp_Unit *cu =
3167 PSEUDOVEC_STRUCT (vector, Lisp_Native_Comp_Unit); 3168 PSEUDOVEC_STRUCT (vector, Lisp_Native_Comp_Unit);
3168 unload_comp_unit (cu); 3169 unload_comp_unit (cu);
3169 } 3170 }
3170 else if (NATIVE_COMP_FLAG 3171 else if (PSEUDOVECTOR_TYPEP (&vector->header, PVEC_SUBR))
3171 && PSEUDOVECTOR_TYPEP (&vector->header, PVEC_SUBR))
3172 { 3172 {
3173 struct Lisp_Subr *subr = 3173 struct Lisp_Subr *subr =
3174 PSEUDOVEC_STRUCT (vector, Lisp_Subr); 3174 PSEUDOVEC_STRUCT (vector, Lisp_Subr);
3175 if (!NILP (subr->native_comp_u[0])) 3175 if (!NILP (subr->native_comp_u))
3176 { 3176 {
3177 /* FIXME Alternative and non invasive solution to this 3177 /* FIXME Alternative and non invasive solution to this
3178 cast? */ 3178 cast? */
3179 xfree ((char *)subr->symbol_name); 3179 xfree ((char *)subr->symbol_name);
3180 xfree (subr->native_c_name[0]); 3180 xfree (subr->native_c_name);
3181 } 3181 }
3182 } 3182 }
3183#endif
3183} 3184}
3184 3185
3185/* Reclaim space used by unmarked vectors. */ 3186/* Reclaim space used by unmarked vectors. */
@@ -3902,6 +3903,7 @@ count as reachable for the purpose of deciding whether to run
3902FUNCTION. FUNCTION will be run once per finalizer object. */) 3903FUNCTION. FUNCTION will be run once per finalizer object. */)
3903 (Lisp_Object function) 3904 (Lisp_Object function)
3904{ 3905{
3906 CHECK_TYPE (FUNCTIONP (function), Qfunctionp, function);
3905 struct Lisp_Finalizer *finalizer 3907 struct Lisp_Finalizer *finalizer
3906 = ALLOCATE_PSEUDOVECTOR (struct Lisp_Finalizer, function, PVEC_FINALIZER); 3908 = ALLOCATE_PSEUDOVECTOR (struct Lisp_Finalizer, function, PVEC_FINALIZER);
3907 finalizer->function = function; 3909 finalizer->function = function;
@@ -6159,6 +6161,9 @@ garbage_collect (void)
6159 mark_terminals (); 6161 mark_terminals ();
6160 mark_kboards (); 6162 mark_kboards ();
6161 mark_threads (); 6163 mark_threads ();
6164#ifdef HAVE_PGTK
6165 mark_pgtkterm ();
6166#endif
6162 6167
6163#ifdef USE_GTK 6168#ifdef USE_GTK
6164 xg_mark_data (); 6169 xg_mark_data ();
@@ -6803,15 +6808,17 @@ mark_object (Lisp_Object arg)
6803 break; 6808 break;
6804 6809
6805 case PVEC_SUBR: 6810 case PVEC_SUBR:
6811#ifdef HAVE_NATIVE_COMP
6806 if (SUBR_NATIVE_COMPILEDP (obj)) 6812 if (SUBR_NATIVE_COMPILEDP (obj))
6807 { 6813 {
6808 set_vector_marked (ptr); 6814 set_vector_marked (ptr);
6809 struct Lisp_Subr *subr = XSUBR (obj); 6815 struct Lisp_Subr *subr = XSUBR (obj);
6810 mark_object (subr->native_intspec); 6816 mark_object (subr->native_intspec);
6811 mark_object (subr->native_comp_u[0]); 6817 mark_object (subr->native_comp_u);
6812 mark_object (subr->lambda_list[0]); 6818 mark_object (subr->lambda_list);
6813 mark_object (subr->type[0]); 6819 mark_object (subr->type);
6814 } 6820 }
6821#endif
6815 break; 6822 break;
6816 6823
6817 case PVEC_FREE: 6824 case PVEC_FREE:
@@ -7736,6 +7743,12 @@ enum defined_HAVE_X_WINDOWS { defined_HAVE_X_WINDOWS = true };
7736enum defined_HAVE_X_WINDOWS { defined_HAVE_X_WINDOWS = false }; 7743enum defined_HAVE_X_WINDOWS { defined_HAVE_X_WINDOWS = false };
7737#endif 7744#endif
7738 7745
7746#ifdef HAVE_PGTK
7747enum defined_HAVE_PGTK { defined_HAVE_PGTK = true };
7748#else
7749enum defined_HAVE_PGTK { defined_HAVE_PGTK = false };
7750#endif
7751
7739/* When compiled with GCC, GDB might say "No enum type named 7752/* When compiled with GCC, GDB might say "No enum type named
7740 pvec_type" if we don't have at least one symbol with that type, and 7753 pvec_type" if we don't have at least one symbol with that type, and
7741 then xbacktrace could fail. Similarly for the other enums and 7754 then xbacktrace could fail. Similarly for the other enums and
@@ -7755,5 +7768,6 @@ union
7755 enum More_Lisp_Bits More_Lisp_Bits; 7768 enum More_Lisp_Bits More_Lisp_Bits;
7756 enum pvec_type pvec_type; 7769 enum pvec_type pvec_type;
7757 enum defined_HAVE_X_WINDOWS defined_HAVE_X_WINDOWS; 7770 enum defined_HAVE_X_WINDOWS defined_HAVE_X_WINDOWS;
7771 enum defined_HAVE_PGTK defined_HAVE_PGTK;
7758} const EXTERNALLY_VISIBLE gdb_make_enums_visible = {0}; 7772} const EXTERNALLY_VISIBLE gdb_make_enums_visible = {0};
7759#endif /* __GNUC__ */ 7773#endif /* __GNUC__ */