1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-31 17:30:54 -08:00
Commit graph

1673 commits

Author SHA1 Message Date
Pip Cet
fc555a3772 Merge branch 'master' into feature/igc 2025-05-01 12:59:07 +00:00
Po Lu
b455133450 Avoid performance regressions in unoptimized builds
* src/alloc.c (lisp_malloc): Declare val register.
2025-04-15 09:53:32 +08:00
Stefan Kangas
a7f5d183a8 Remove unused XMALLOC_BLOCK_INPUT_CHECK debug facility
The compile-time option XMALLOC_BLOCK_INPUT_CHECK was added in
2012 (commit 4d7e6e51dd) to allow blocking input during
malloc-family calls, in case any issues arose from related
changes in Emacs 24.3.  However, it has not been referenced on
emacs-devel or the bug tracker in over a decade.

It is clear that we do not need it, as our signal handlers do not
allocate memory.  Removing it simplifies the allocation function
wrappers and eliminates dead debug code.

Ref: https://debbugs.gnu.org/12450

* src/alloc.c [XMALLOC_BLOCK_INPUT_CHECK]
(malloc_block_input, malloc_unblock_input): Delete functions.
(MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Delete macros.  Update
all callers.
2025-04-14 20:40:49 +02:00
Pip Cet
7cf4f61fc5 Merge from 'savannah/master' 2025-03-18 12:13:58 +00:00
Po Lu
a5f8ce9f1e Re-port to 32-bit systems without alignment primitives
* configure.ac (ALIGNOF_INT, ALIGNOF_LONG, ALIGNOF_LONG_LONG):
New variables.
(emacs_cv_alignas_unavailable): Define if alignas and structure
alignment primitives are unavailable.  In such an environment,
the MSB tagging scheme must be enabled, as must the GNU malloc.

* msdos/sed2v2.inp: Adjust correspondingly.

* src/alloc.c (union emacs_align_type): Remove types which
contain flexible array members.  The address of a field
subsequent to an aggregate with flexible array members cannot
validly be taken.
(mark_memory) [!USE_LSB_TAG && !WIDE_EMACS_INT]: Strip type bits
before scanning memory.

* src/emacs.c (main):

* src/eval.c (Fautoload_do_load):

* src/fns.c (Frequire): Rename a number of illogically named
fields.

* src/lisp.h (ALIGNOF_EMACS_INT): Define to the natural
alignment of EMACS_INT.
(IDEAL_GCALIGNMENT): New macro.
(USE_LSB_TAG): Disable if no alignment specifiers are available,
WIDE_EMACS_INT is undefined, and the natural alignment of
EMACS_INT falls short of LSB tagging's requirements.
(gflags): Rename illogically named fields and don't define them
as bitfields, which runs afoul of certain compiler issues.
(will_dump_p, will_bootstrap_p, will_dump_with_pdumper_p)
(dumped_with_pdumper_p): Adjust accordingly.

* src/pdumper.c (VM_SUPPORTED): Define to 0 when !USE_LSB_TAG.
It is better to read dump files into the heap by hand than to be
supplied with an address that is not representable.
(_dump_object_start_pseudovector): Rename to
dump_object_start_pseudovector, to avoid encroaching on reserved
names.
(START_DUMP_PVEC): Adjust correspondingly.
(dump_mmap_contiguous_vm): Preserve errno around failure
cleanup.
(dump_bitset_bit_set_p): Work around certain compiler issues.
(pdumper_load) [!USE_LSB_TAG]: Reject dump file allocations
that are not representable as Lisp_Objects.

Tested on i386-unknown-solaris2.10, sparc-sun-solaris2.10.
2025-03-09 23:07:33 +08:00
Helmut Eller
6ff509af3d Don't forget to free process->gnutls_pproc if we HAVE_MPS (Bug#76473)
* src/gnutls.c (emacs_gnutls_deinit): Free gnutls_pproc here.
* src/alloc.c (cleanup_vector): Not here.
2025-02-22 14:23:05 +00:00
Pip Cet
48909543bd Merge from savannah/master 2025-02-17 09:39:18 +00:00
Pip Cet
eae38efc43 Split 'xpalloc' into two functions
The new function 'xpalloc_nbytes' calculates the new size without
performing the actual allocation.

* src/alloc.c (xpalloc_nbytes): New function.
(xpalloc): Use it.
2025-02-07 18:33:39 +00:00
Pip Cet
c001b4bf3a Keep hash table allocation statistics accurate (Bug#76069)
* src/alloc.c (hash_table_free_kv): Call 'hash_table_free_bytes",
which updates 'hash_table_allocated_bytes'.
2025-02-07 09:39:42 +00:00
Pip Cet
aa915b0c87 Fix GC tallying for hash table allocations (bug#76069)
* src/alloc.c (hash_table_alloc_kv): Use 'hash_table_alloc_bytes', not
'xmalloc'.
(hash_table_free_kv):
* src/lisp.h: Add size argument to 'hash_table_free_kv'.
* src/fns.c (maybe_resize_hash_table):
* src/lread.c (grow_obarray): Pass size to 'hash_table_free_kv'.  If
HAVE_MPS, pass dummy argument.
2025-02-05 17:52:34 +00:00
Paul Eggert
7ac05c33b1 Improve malloc Lisp alignment commentary
Prompted by a private email from Pip Cet.
2025-02-01 22:55:30 -08:00
Eli Zaretskii
75fe8c7e32 Remove DEFVAR_LISP_NOPRO
* src/alloc.c (process_mark_stack):
* src/lread.c (defvar_lisp_nopro):
* src/lisp.h (DEFVAR_LISP_NOPRO):
* src/font.c (syms_of_font): Remove the function and the macro,
their callers, and related comments.
2025-02-01 16:27:37 +02:00
Eli Zaretskii
46d1043f1c ; Avoid compiler warnings in alloc.c
* src/alloc.c (XFLOAT_INIT, pointer_align) [HAVE_MPS]: Don't
define, as they are unused in the HAVE_MPS build.
2025-02-01 15:19:02 +02:00
Po Lu
532ff6e29d Fix compilation warnings on Android
* src/alloc.c (pointer_align): Only define if
!USE_ALIGNED_ALLOC.
2025-02-01 20:59:24 +08:00
Pip Cet
6dcb99a2b8 Merge 'master' into 'feature/igc' 2025-02-01 12:48:57 +00:00
Stefan Kangas
bf97946d7d Merge branch 'scratch/no-purespace' into 'master' 2025-02-01 04:56:52 +01:00
Pip Cet
6f7e916a6c Merge branch 'master' into feature/igc 2025-01-31 16:40:29 +00:00
Paul Eggert
1f1088188e Avoid some make_formatted_string mallocs
* src/alloc.c (make_formatted_string):
Grow the local buffer from 64 to MAX_ALLOCA bytes.
2025-01-27 17:16:44 -08:00
Paul Eggert
f885806fdf Simplify make_formatted_string API
From a suggestion by Pip Cet.
* src/alloc.c (make_formatted_string): Omit first argument,
to simplify the calling convention.  All callers changed.
* src/doprnt.c (doprnt): Also support %u.  Update doc.
2025-01-26 23:05:50 -08:00
Stefan Kangas
278d1994af Remove redundant case_Lisp_Int macro
The case_Lisp_Int macro was originally introduced with different
definitions depending on USE_2_TAGS_FOR_INTS.  However, since commit
2b57012478, we have assumed that USE_2_TAGS_FOR_INTS is always
defined, and the macro has only a single definition.  As a result, the
macro is now unnecessary, and replacing it with standard C case labels
improves readability and understanding.

* src/lisp.h (case_Lisp_Int): Delete macro.
* src/alloc.c (process_mark_stack, survives_gc_p):
* src/data.c (Fcl_type_of):
* src/fns.c (value_cmp, sxhash_obj):
* src/pdumper.c (dump_object):
* src/print.c (print_object):
* src/xfaces.c (face_attr_equal_p): Remove uses of above macro.
2025-01-20 02:14:08 +01:00
Stefan Kangas
b4c8dad4e3 ; Fix typos 2025-01-19 22:53:31 +01:00
Stefan Kangas
4fd6a61605 Document that gc-cons-* variables have no effect with IGC
* src/alloc.c (syms_of_alloc) <gc-cons-threshold, gc-cons-percentage>:
Document that these variables have no effect with IGC.
2025-01-19 18:51:08 +01:00
Gerd Möllmann
c19d702b3b Merge branch 'master' into feature/igc 2025-01-19 15:52:10 +01:00
Stefan Kangas
251e3d2654 Replace call[1-8] with calln
Since the introduction of the 'calln' macro, the 'call1', 'call2', ...,
'call8' macros are just aliases for the former.  This is slightly
misleading and potentially unhelpful.  The number of arguments N can
also easily go out-of-synch with the used alias callN.  There is no
reason not to replace these aliases with using 'calln' directly.

To reduce the risk for mistakes, the tool Coccinelle was used to make
these changes.  See <https://coccinelle.gitlabpages.inria.fr/website/>.

* src/alloc.c, src/androidvfs.c, src/androidfns.c, src/buffer.c:
* src/callint.c, src/callproc.c, src/casefiddle.c, src/charset.c:
* src/chartab.c, src/cmds.c, src/coding.c, src/composite.c:
* src/data.c, src/dbusbind.c, src/dired.c, src/doc.c:
* src/emacs.c, src/eval.c, src/fileio.c, src/filelock.c:
* src/fns.c, src/frame.c, src/gtkutil.c, src/haikufns.c:
* src/haikumenu.c, src/image.c, src/insdel.c, src/intervals.c:
* src/keyboard.c, src/keymap.c, src/lisp.h, src/lread.c:
* src/minibuf.c, src/nsfns.m, src/nsselect.m, src/pgtkfns.c:
* src/pgtkselect.c, src/print.c, src/process.c, src/sort.c:
* src/syntax.c, src/textconv.c, src/textprop.c, src/undo.c:
* src/w32fns.c, src/window.c, src/xfaces.c, src/xfns.c:
* src/xmenu.c, src/xselect.c, src/xterm.c:
Replace all uses of 'call1', 'call2', ..., 'call8' with 'calln'.
2025-01-19 14:29:41 +01:00
Paul Eggert
d3a2ec5210 Simplify alloc by assuming MALLOC_IS_LISP_ALIGNED
Problem reported by Hong Xu <https://bugs.gnu.org/75551#14>.
* src/alloc.c (MALLOC_IS_LISP_ALIGNED): static_assert it,
since it is true on all current Emacs platforms.
All uses simplified to assume it is true.
(xmalloc, xzalloc, xrealloc, lisp_malloc): Just use
malloc/calloc/realloc.  Since we are using the malloc-gnu
and realloc-posix modules, we need not worry about whether
these functions return a null pointer for zero-size requests.
(xrealloc): Stop worrying about no-longer-existing platforms
where realloc (nullptr, ...) did not work.
(laligned, lmalloc, lrealloc): Remove.  All uses removed.
2025-01-17 15:56:30 -08:00
Stefan Kangas
a24380324d Remove inhibit_garbage_collection when HAVE_MPS
This function call does nothing to stop GC with MPS.  Remove it to save
a few nanoseconds, and, more importantly, for documentation purposes.

* src/alloc.c [HAVE_MPS] (allow_garbage_collection)
(inhibit_garbage_collection): Remove function definitions.
* src/lisp.h [HAVE_MPS] (inhibit_garbage_collection): Don't declare.
* src/alloc.c [HAVE_MPS] (garbage_collect):
* src/eval.c [HAVE_MPS] (probably_quit):
* src/fns.c [HAVE_MPS] (hash_table_user_defined_call):
* src/nsmenu.m [HAVE_MPS] (ns_menu_show):
* src/term.c [HAVE_MPS] (tty_menu_show):
* src/undo.c [HAVE_MPS] (truncate_undo_list):
* src/xdisp.c [HAVE_MPS] (display_echo_area, decode_mode_spec):
* src/xmenu.c [HAVE_MPS] (x_menu_show): Don't call
inhibit_garbage_collection.
Ref: https://lists.gnu.org/r/emacs-devel/2025-01/msg00362.html
2025-01-12 15:49:47 +01:00
Pip Cet
e8deac66ad Attempt to catch mismatched igc_xzalloc/xfree calls
* src/igc.h:
* src/igc.c (igc_check_freeable) [ENABLE_CHECKING]: New function.
* src/alloc.c (xfree): Call it.
2025-01-10 16:19:10 +00:00
Gerd Möllmann
2838be3fd5 Merge branch 'master' into scratch/igc 2025-01-08 04:04:49 +01:00
Paul Eggert
4da38c6321 Update copyright year to 2025
Run "TZ=UTC0 admin/update-copyright".
2025-01-01 07:39:17 +00:00
Stefan Kangas
f818744cd4 Improve purify-flag docstring
* src/alloc.c (syms_of_alloc): Improve purify-flag docstring.
2024-12-15 19:33:59 +01:00
Stefan Kangas
d6b05b1282 Make 'purecopy' an obsolete function alias for 'identity'
* lisp/subr.el (purecopy): New obsolete function alias for 'identity'.
* src/alloc.c (purecopy): Remove function.
(Fpurecopy): Remove DEFUN.
(syms_of_alloc): Remove defsubr for above DEFUN.
* lisp/loadup.el (purify-flag): Don't set to hash table.

* doc/lispref/spellfile:
* doc/lispref/keymaps.texi (Tool Bar):
* lisp/emacs-lisp/byte-opt.el (side-effect-free-fns): Delete
references to 'purecopy'
2024-12-12 22:48:21 +01:00
Stefan Kangas
b299a5d184 Delete obsolete comment about using purespace
* src/alloc.c (Fmake_byte_code): Delete obsolete comment.
2024-12-12 22:48:20 +01:00
Stefan Kangas
ad9adab042 Remove unused function my_heap_start
* src/alloc.c (my_heap_start) [DOUG_LEA_MALLOC && GNU_LINUX]:
Remove unused function.  Update callers.
2024-12-12 22:48:20 +01:00
Stefan Kangas
892be3b3d7 Remove check for working malloc_set_state
This check was added to 'malloc_initialize_hook' in order to "insulate
Emacs better from configuration screwups" (commit b4788b9394).  With
unexec gone, we no longer use 'malloc_set_state', and thus don't need
this check.

Note that this patch removes the last uses of the deprecated glibc
functions 'malloc_set_state' and 'malloc_get_state' from our code.

* src/alloc.c (malloc_initialize_hook) [DOUG_LEA_MALLOC]:
Remove check for working 'malloc_set_state'.
(alloc_unexec_pre) [DOUG_LEA_MALLOC]: Delete unused function.
(alloc_unexec_post) [DOUG_LEA_MALLOC]: Delete function.
(malloc_state_ptr) [DOUG_LEA_MALLOC]: Delete variable.
* configure.ac (emacs_cv_var_doug_lea_malloc): Don't check for
malloc_set_state and malloc_get_state.
2024-12-12 22:48:20 +01:00
Pip Cet
c951fd415c Avoid compiler warning in process_mark_stack
* src/alloc.c (process_mark_stack): Only declare and assign to 'po' if
it's needed.
Problem reported by: Stefan Kangas <stefankangas@gmail.com>.
2024-12-12 22:48:15 +01:00
Pip Cet
c9ab325876 Pure storage removal: Remove documentation
As pure storage is now gone, it no longer needs to be documented.

* doc/lispref/elisp.texi (Top):
* doc/lispref/internals.texi (GNU Emacs Internals): Remove "Pure
Storage" section.
(Building Emacs, Garbage Collection, Writing Emacs Primitives):
* doc/lispref/symbols.texi (Standard Properties): Remove references to
pure storage.
* src/alloc.c (Fgarbage_collect): Remove docstring text referring to
pure storage.
2024-12-12 22:48:12 +01:00
Pip Cet
e1e101c6c1 Pure storage removal: Remove support for pinned objects
* src/alloc.c (symbol_block_pinned): Remove variable.
(init_symbol): Don't initialize 'pinned flag'.
(pinned_objects): Remove variable.
(mark_pinned_objects, mark_pinned_symbols): Remove functions.
(garbage_collect): Don't call 'mark_pinned_objects',
'mark_pinned_symbols'.
* src/lisp.h (struct Lisp_Symbol): Remove 'pinned' flag.
* src/pdumper.c (dump_symbol): Remove 'pinned' flag from dump.
2024-12-12 22:48:12 +01:00
Pip Cet
5ec8696663 Pure storage removal: Replace calls to removed functions
* src/alloc.c (string_bytes, pin_string, valid_lisp_object_p)
(process_mark_stack, survives_gc_p, syms_of_alloc):
* src/androidterm.c (android_term_init): Replace call to
'build_pure_c_string'.
* src/buffer.c (init_buffer_once, syms_of_buffer):
* src/bytecode.c (exec_byte_code):
* src/callint.c (syms_of_callint):
* src/callproc.c (syms_of_callproc):
* src/category.c (Fdefine_category):
* src/coding.c (syms_of_coding):
* src/comp.c (Fcomp__compile_ctxt_to_file0)
(maybe_defer_native_compilation, syms_of_comp):
* src/data.c (Fsetcar, Fsetcdr, Fdefalias, Faset, syms_of_data):
* src/dbusbind.c (syms_of_dbusbind):
* src/doc.c (Fsnarf_documentation):
* src/emacs-module.c (syms_of_module):
* src/eval.c (Finternal__define_uninitialized_variable)
(Fdefconst_1, define_error, syms_of_eval):
* src/fileio.c (syms_of_fileio):
* src/fns.c (Ffillarray, Fclear_string, check_mutable_hash_table):
* src/fontset.c (syms_of_fontset):
* src/frame.c (make_initial_frame):
* src/haikufns.c (syms_of_haikufns):
* src/intervals.c (create_root_interval):
* src/keyboard.c (syms_of_keyboard):
* src/keymap.c (Fmake_sparse_keymap, Fset_keymap_parent)
(store_in_keymap, syms_of_keymap):
* src/lisp.h:
* src/lread.c (Fload, read0, intern_c_string_1, define_symbol)
(Fintern, defsubr, syms_of_lread):
* src/pdumper.c (Fdump_emacs_portable):
* src/pgtkfns.c (syms_of_pgtkfns):
* src/pgtkterm.c (syms_of_pgtkterm):
* src/process.c (syms_of_process):
* src/search.c (syms_of_search):
* src/sqlite.c (syms_of_sqlite):
* src/syntax.c (syms_of_syntax):
* src/treesit.c (syms_of_treesit):
* src/w32fns.c (syms_of_w32fns):
* src/xdisp.c (syms_of_xdisp):
* src/xfaces.c (syms_of_xfaces):
* src/xfns.c (syms_of_xfns):
* src/xftfont.c (syms_of_xftfont):
* src/xterm.c (syms_of_xterm): Remove calls to 'PURE_P', 'CHECK_IMPURE',
'Fpurecopy', and replace calls to 'build_pure_c_string', 'pure_list',
'pure_listn', etc., by impure equivalents.
2024-12-12 22:48:11 +01:00
Pip Cet
f84ccff5a6 Pure storage removal: Main part
* src/alloc.c (pure, PUREBEG, purebeg, pure_size)
(pure_bytes_used_before_overflow, pure_bytes_used_lisp)
(pure_bytes_used_non_lisp): Remove definitions.
(init_strings): Make empty strings impure.
(cons_listn): Drop 'cons' argument.
(pure_listn): Remove function.
(init_vectors): Allocate zero vector manually to avoid freelist issues.
(pure_alloc, check_pure_size, find_string_data_in_pure)
(make_pure_string, make_pure_c_string, pure_cons, make_pure_float)
(make_pure_bignum, make_pure_vector, purecopy_hash_table): Remove
functions.
(purecopy): Reduce to hash consing our argument.
(init_alloc_once_for_pdumper): Adjust to lack of pure space.
(pure-bytes-used): Adjust docstring to mark as obsolete.
(purify-flag): Keep for hash consing, but adjust docstring.
* src/bytecode.c:
* src/comp.c: Don't include "puresize.h".
* src/conf_post.h (SYSTEM_PURESIZE_EXTRA): Remove definition.
* src/data.c (pure_write_error): Remove function.
* src/deps.mk: Remove puresize.h dependency throughout.
* src/emacs.c:
* src/fns.c:
* src/intervals.c:
* src/keymap.c: Don't include "puresize.h".
* src/lisp.h (struct Lisp_Hash_Table): Adjust comment.
(pure_listn, pure_list, build_pure_c_string): Remove.
* src/w32heap.c (FREEABLE_P): Don't do use 'dumped_data'.
(malloc_before_dump, realloc_before_dump, free_before_dump): Remove
functions.
* src/w32heap.h: Adjust prototype.
* lisp/loadup.el:
* lisp/startup.el: Remove purespace code.
2024-12-12 22:48:11 +01:00
Pip Cet
b2bc337a5f Unexec removal: Remove HYBRID_MALLOC support
* src/gmalloc.c (gdefault_morecore): Remove HYBRID_MALLOC code.
(allocated_via_gmalloc, hybrid_malloc, hybrid_calloc, hybrid_free_1)
(hybrid_free, hybrid_aligned_alloc, hybrid_realloc): Remove functions.

* msdos/sed1v2.inp:
* msdos/sedlibmk.inp:
* src/alloc.c (GC_MALLOC_CHECK, USE_ALIGNED_ALLOC)
(refill_memory_reserve, aligned_alloc):
* src/emacs.c (main):
* src/lastfile.c (my_edata):
* src/lisp.h:
* src/ralloc.c:
* src/sysdep.c (get_current_dir_name_or_unreachable):
* src/xdisp.c (decode_mode_spec): Remove HYBRID_MALLOC conditions.

* configure.ac (hybrid_malloc, HYBRID_MALLOC): Remove variables and
dependent code.
* src/conf_post.h (hybrid_malloc, hybrid_calloc, hybrid_free)
(hybrid_aligned_alloc, hybrid_realloc): Remove conditional prototypes.
* src/Makefile.in (HYBRID_MALLOC): Remove variable.
(base_obj): Remove sheap.o
(LIBEGNU_ARCHIVE):
* lib/Makefile.in (libgnu_a_OBJECTS): Remove libegnu.a support.
2024-12-12 22:48:11 +01:00
Pip Cet
15e2b14f03 Unexec removal: Main part
* configure.ac: Remove unexec-specific parts.
(EMACS_CONFIG_FEATURES): Always report that we do not have the UNEXEC
feature.
(AC_ECHO): No longer display a line about the unexec feature.
* lisp/loadup.el:
* lisp/startup.el: Remove unexec-specific code.
* src/Makefile.in (base_obj): Drop 'UNEXEC_OBJ'.
* src/alloc.c (staticvec): Never initialize this variable.
(BLOCK_ALIGN): Always allow large blocks.
(mmap_lisp_allowed_p): Remove unexec-specific code.
* src/buffer.c (init_buffer):
* src/conf_post.h (ADDRESS_SANITIZER):
* src/emacs.c (load_pdump, main): Remove unexec-specific code.
(Fdump_emacs): Remove function.
(syms_of_emacs): Remove 'Fdump_emacs'.
* src/lastfile.c: Remove unexec-specific code.
* src/lisp.h (gflags): Remove unexec-specific flags.
(will_dump_p, will_bootstrap_p, will_dump_with_unexec_p)
(dumped_with_unexec_p, definitely_will_not_unexec_p): Remove or adjust
predicates.
(SUBR_SECTION_ATTRIBUTE): Remove unexec-specific definition.
* src/pdumper.c (Fdump_emacs_portable): Remove unexec-specific warning.
* src/process.c (init_process_emacs): Remove !unexec condition
* src/sysdep.c (maybe_disable_address_randomization): Adjust comment.
(init_signals):
* src/timefns.c (init_timefns): Remove unexec-specific code.
* src/w32heap.c (report_temacs_memory_usage): Remove function.
* src/w32heap.h: Adjust comment.
* src/w32image.c (globals_of_w32image): Remove unexec-specific code.
2024-12-12 22:48:11 +01:00
Gerd Möllmann
414de92a56 Initial child frames based on master
This is based on a diff from 2024-10-15 which still applied.
Since then, I've inadvertantly modified the igc branch so that
it is no longer possible to get a clean diff of what has changed
since I created the branch.
2024-10-22 06:40:19 +02:00
Gerd Möllmann
d864c26b20 Merge branch 'master' into scratch/igc 2024-10-19 04:50:24 +02:00
Eli Zaretskii
83b0e604ce Merge from origin/emacs-30
4b9a8fd607 etags-regen-file-extensions: Add .pm
956f14ae5e * src/treesit.c (treesit_debug_print_parser_list): Fix co...
300d05ecb4 Type-check argument to network-lookup-address-info
0f0f21b7f2 ; Improve doc strings of options related to numbered backups
f0daa2f215 Conservative heuristic for tree-sitter parser ranges (bug...
035024b4e5 ; Fix treesit.c printing
8771310a10 ; * admin/notes/unicode: Need to run textsec-tests (bug#7...
4c6f45fa8e Re-enable GC mark trace buffer by default
c607701589 ; * src/haiku_support.cc: Correct last change.
ae22ad7f62 ; Add even more tests for previous commit
460b9d705a Fix treesit_sync_visible_region's range fixup code (bug#7...
81347c1aaf ; * etc/PROBLEMS: Fix last change (bug#73207).
a82b7f3e82 Document unavailability of frame geometry on Wayland
2024-09-21 07:30:19 -04:00
Mattias Engdegård
4c6f45fa8e Re-enable GC mark trace buffer by default
Enable GC_REMEMBER_LAST_MARKED by default (it was disabled in Emacs 29)
to make it easier to debug difficult-to-reproduce GC problems
encountered by users.  This increases GC costs by about 5 %, which can
be avoided by turning the mark trace buffer back off using the new
--disable-gc-mark-trace option.

See discussion at
https://lists.gnu.org/archive/html/emacs-devel/2024-09/msg00240.html

* configure.ac (--disable-gc-mark-trace): New config option.
* etc/NEWS: Mention it.
* src/alloc.c: Enable it by default and avoid a compiler warning.
2024-09-17 13:27:35 +02:00
Eli Zaretskii
358208dfaa Remove low-level keyboard hook when attaching GDB to Emacs on Windows
This fixes the problem whereby attaching GDB to a running Emacs
on MS-Windows would slow down keyboard input, because the
low-level keyboard hook installed by Emacs at startup was still
installed, but with Emacs stopped, the hook code couldn't run,
and therefore the OS would time-out waiting for the hook to
return.  Now when GDB is attached to Emacs, it will remove the
hook right away.
* src/.gdbinit: Call 'remove_w32_kbdhook' if the keyboard hook is
already installed.
* src/alloc.c (defined_WINDOWSNT): New enum.
(gdb_make_enums_visible): Add 'defined_WINDOWSNT'.
2024-09-07 11:15:43 +03:00
Pip Cet
6682d0e6c9 Fix gnutls crashes on MPS Windows builds
A more general mechanism to pin pointers used for external callbacks is
needed.

* src/process.h (struct Lisp_Process): Add 'gnutls_pproc' pointer to a
pointer to ourselves.
* src/alloc.c (cleanup_vector): Free 'gnutls_pproc'.
* src/gnutls.c (emacs_gnutls_handshake): Allocate 'gnutls_pproc', and
use it.
* src/w32.c (emacs_gnutls_pull):
(emacs_gnutls_push): Use indirection through 'gnutls_pproc'.
2024-08-24 17:23:55 +00:00
Pip Cet
ab35741d43 Better GDB support for MPS builds
* src/.gdbinit: Add MPS-specific signal handlers.
* src/alloc.c (gdb_make_enums_visible): Add 'defined_HAVE-MPS'.
2024-08-22 17:57:26 +00:00
Stefan Kangas
7c8e28607b Prefer static_assert to verify
Although static_assert is C11-specific, and Emacs remains on C99, it
has been backported to older compilers by Gnulib.  Gnulib has already
changed to prefer static_assert, and we can do the same.

* lib-src/asset-directory-tool.c (main_2):
* src/alloc.c (BLOCK_ALIGN, aligned_alloc, lisp_align_malloc)
(vectorlike_nbytes, allocate_pseudovector):
* src/android.c (android_globalize_reference, android_set_dashes):
* src/android.h:
* src/androidfont.c (androidfont_draw, androidfont_text_extents):
* src/androidvfs.c:
* src/bidi.c (BIDI_CACHE_MAX_ELTS_PER_SLOT, bidi_find_bracket_pairs):
* src/buffer.c (init_buffer_once):
* src/casefiddle.c (do_casify_multibyte_string):
* src/dispnew.c (scrolling_window, scrolling):
* src/editfns.c (styled_format):
* src/emacs-module.c (module_extract_big_integer):
* src/fileio.c (Fdo_auto_save):
* src/fns.c (next_almost_prime, hash_string):
* src/fringe.c (init_fringe):
* src/keyboard.h (kbd_buffer_store_event_hold):
* src/keymap.c:
* src/lisp.h (memclear, reduce_emacs_uint_to_hash_hash, modiff_incr):
* src/lread.c (skip_lazy_string):
* src/pdumper.c (dump_bignum, Fdump_emacs_portable)
(dump_do_dump_relocation, pdumper_load):
* src/process.c (make_process, Fmake_process, connect_network_socket):
* src/regex-emacs.c:
* src/sort.c (tim_sort):
* src/sysdep.c (init_random, SSIZE_MAX):
* src/thread.c:
* src/timefns.c (trillion_factor):
* src/unexelf.c:
* src/xterm.c (x_send_scroll_bar_event): Prefer static_assert to Gnulib
verify.  Remove import of verify.h, except when used for other reasons.
2024-08-22 00:51:55 +02:00
Gerd Möllmann
6a137e0c1d Merge branch 'master' into scratch/igc 2024-08-05 06:32:17 +02:00