aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.in54
-rw-r--r--src/alloc.c20
-rw-r--r--src/bignum.c8
-rw-r--r--src/buffer.c8
-rw-r--r--src/buffer.h14
-rw-r--r--src/composite.c25
-rw-r--r--[-rwxr-xr-x]src/dmpstruct.awk0
-rw-r--r--src/editfns.c5
-rw-r--r--src/emacs-module.c2
-rw-r--r--src/filelock.c1
-rw-r--r--src/fingerprint-dummy.c23
-rw-r--r--src/fingerprint.h4
-rw-r--r--src/fns.c2
-rw-r--r--src/fontset.c2
-rw-r--r--src/frame.c7
-rw-r--r--src/frame.h7
-rw-r--r--src/gtkutil.c8
-rw-r--r--src/lisp.h24
-rw-r--r--src/pdumper.c123
-rw-r--r--src/process.c3
-rw-r--r--src/process.h4
-rw-r--r--src/termhooks.h2
-rw-r--r--src/terminal.c4
-rw-r--r--src/thread.c8
-rw-r--r--src/thread.h2
-rw-r--r--src/w32fns.c2
-rw-r--r--src/w32term.c2
-rw-r--r--src/widget.c5
-rw-r--r--src/window.c30
-rw-r--r--src/window.h5
-rw-r--r--src/xfns.c7
-rw-r--r--src/xsettings.c4
-rw-r--r--src/xterm.c4
-rw-r--r--src/xterm.h2
-rw-r--r--src/xwidget.c5
-rw-r--r--src/xwidget.h6
36 files changed, 187 insertions, 245 deletions
diff --git a/src/Makefile.in b/src/Makefile.in
index dee3a534db3..2348c8dae4c 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -331,6 +331,7 @@ BUILD_DETAILS = @BUILD_DETAILS@
331UNEXEC_OBJ = @UNEXEC_OBJ@ 331UNEXEC_OBJ = @UNEXEC_OBJ@
332 332
333DUMPING=@DUMPING@ 333DUMPING=@DUMPING@
334CHECK_STRUCTS = @CHECK_STRUCTS@
334 335
335# 'make' verbosity. 336# 'make' verbosity.
336AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ 337AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
@@ -458,7 +459,9 @@ all: emacs$(EXEEXT) $(pdmp) $(OTHER_FILES)
458 459
459dmpstruct_headers=$(srcdir)/lisp.h $(srcdir)/buffer.h \ 460dmpstruct_headers=$(srcdir)/lisp.h $(srcdir)/buffer.h \
460 $(srcdir)/intervals.h $(srcdir)/charset.h $(srcdir)/bignum.h 461 $(srcdir)/intervals.h $(srcdir)/charset.h $(srcdir)/bignum.h
462ifeq ($(CHECK_STRUCTS),true)
461pdumper.o: dmpstruct.h 463pdumper.o: dmpstruct.h
464endif
462dmpstruct.h: $(srcdir)/dmpstruct.awk 465dmpstruct.h: $(srcdir)/dmpstruct.awk
463dmpstruct.h: $(libsrc)/make-fingerprint$(EXEEXT) $(dmpstruct_headers) 466dmpstruct.h: $(libsrc)/make-fingerprint$(EXEEXT) $(dmpstruct_headers)
464 $(AM_V_GEN)POSIXLY_CORRECT=1 awk -f $(srcdir)/dmpstruct.awk \ 467 $(AM_V_GEN)POSIXLY_CORRECT=1 awk -f $(srcdir)/dmpstruct.awk \
@@ -541,7 +544,7 @@ ${lispintdir}/cp51932.el ${lispintdir}/eucjp-ms.el: FORCE
541 544
542charsets = ${top_srcdir}/admin/charsets/charsets.stamp 545charsets = ${top_srcdir}/admin/charsets/charsets.stamp
543${charsets}: FORCE 546${charsets}: FORCE
544 ${MAKE} -C ../admin/charsets all 547 $(MAKE) -C ../admin/charsets all
545 548
546charscript = ${lispintdir}/charscript.el 549charscript = ${lispintdir}/charscript.el
547${charscript}: FORCE 550${charscript}: FORCE
@@ -592,8 +595,9 @@ $(etc)/DOC: lisp.mk $(libsrc)/make-docfile$(EXEEXT) $(obj) $(lisp)
592 $(AM_V_at)$(libsrc)/make-docfile -a $(etc)/DOC -d $(lispsource) \ 595 $(AM_V_at)$(libsrc)/make-docfile -a $(etc)/DOC -d $(lispsource) \
593 $(shortlisp) 596 $(shortlisp)
594 597
595$(libsrc)/make-docfile$(EXEEXT): $(lib)/libgnu.a 598$(libsrc)/make-docfile$(EXEEXT) $(libsrc)/make-fingerprint$(EXEEXT): \
596 $(MAKE) -C $(libsrc) make-docfile$(EXEEXT) 599 $(lib)/libgnu.a
600 $(MAKE) -C $(dir $@) $(notdir $@)
597 601
598buildobj.h: Makefile 602buildobj.h: Makefile
599 $(AM_V_GEN)for i in $(ALLOBJS); do \ 603 $(AM_V_GEN)for i in $(ALLOBJS); do \
@@ -621,30 +625,21 @@ $(ALLOBJS): globals.h
621LIBEGNU_ARCHIVE = $(lib)/lib$(if $(HYBRID_MALLOC),e)gnu.a 625LIBEGNU_ARCHIVE = $(lib)/lib$(if $(HYBRID_MALLOC),e)gnu.a
622 626
623$(LIBEGNU_ARCHIVE): $(config_h) 627$(LIBEGNU_ARCHIVE): $(config_h)
624 $(MAKE) -C $(lib) all 628 $(MAKE) -C $(dir $@) all
625
626EMACS_DEPS_PRE=$(LIBXMENU) $(ALLOBJS)
627EMACS_DEPS_POST=$(LIBEGNU_ARCHIVE) $(EMACSRES) ${charsets} ${charscript}
628BUILD_EMACS_PRE=$(AM_V_CCLD)$(CC) $(ALL_CFLAGS) $(TEMACS_LDFLAGS) $(LDFLAGS) \
629 -o $@ $(ALLOBJS)
630BUILD_EMACS_POST=$(LIBEGNU_ARCHIVE) $(W32_RES_LINK) $(LIBES)
631
632## We hash this file to generate the build fingerprint
633temacs.in$(EXEEXT): $(EMACS_DEPS_PRE) fingerprint-dummy.o $(EMACS_DEPS_POST)
634 $(BUILD_EMACS_PRE) fingerprint-dummy.o $(BUILD_EMACS_POST)
635 629
636$(libsrc)/make-fingerprint$(EXEEXT): $(libsrc)/make-fingerprint.c $(lib)/libgnu.a 630FINGERPRINTED = $(LIBXMENU) $(ALLOBJS) $(LIBEGNU_ARCHIVE) $(EMACSRES)
637 $(MAKE) -C $(libsrc) make-fingerprint$(EXEEXT) 631fingerprint.c: $(FINGERPRINTED) $(libsrc)/make-fingerprint$(EXEEXT)
638 632 $(AM_V_GEN)$(libsrc)/make-fingerprint$(EXEEXT) $(FINGERPRINTED) >$@.tmp
639fingerprint.c: temacs.in$(EXEEXT) $(libsrc)/make-fingerprint$(EXEEXT) 633 $(AM_V_at)mv $@.tmp $@
640 $(libsrc)/make-fingerprint$(EXEEXT) temacs.in$(EXEEXT) > fingerprint.c
641 634
642## We have to create $(etc) here because init_cmdargs tests its 635## We have to create $(etc) here because init_cmdargs tests its
643## existence when setting Vinstallation_directory (FIXME?). 636## existence when setting Vinstallation_directory (FIXME?).
644## This goes on to affect various things, and the emacs binary fails 637## This goes on to affect various things, and the emacs binary fails
645## to start if Vinstallation_directory has the wrong value. 638## to start if Vinstallation_directory has the wrong value.
646temacs$(EXEEXT): $(EMACS_DEPS_PRE) fingerprint.o $(EMACS_DEPS_POST) 639temacs$(EXEEXT): fingerprint.o $(charsets) $(charscript)
647 $(BUILD_EMACS_PRE) fingerprint.o $(BUILD_EMACS_POST) 640 $(AM_V_CCLD)$(CC) -o $@ $(ALL_CFLAGS) $(TEMACS_LDFLAGS) $(LDFLAGS) \
641 $(ALLOBJS) fingerprint.o \
642 $(LIBEGNU_ARCHIVE) $(W32_RES_LINK) $(LIBES)
648 $(MKDIR_P) $(etc) 643 $(MKDIR_P) $(etc)
649ifeq ($(DUMPING),unexec) 644ifeq ($(DUMPING),unexec)
650 ifneq ($(PAXCTL_notdumped),) 645 ifneq ($(PAXCTL_notdumped),)
@@ -655,15 +650,15 @@ endif
655## The following oldxmenu-related rules are only (possibly) used if 650## The following oldxmenu-related rules are only (possibly) used if
656## HAVE_X11 && !USE_GTK, but there is no harm in always defining them. 651## HAVE_X11 && !USE_GTK, but there is no harm in always defining them.
657$(lwlibdir)/liblw.a: $(config_h) globals.h lisp.h FORCE 652$(lwlibdir)/liblw.a: $(config_h) globals.h lisp.h FORCE
658 $(MAKE) -C $(lwlibdir) liblw.a 653 $(MAKE) -C $(dir $@) $(notdir $@)
659$(oldXMenudir)/libXMenu11.a: FORCE 654$(oldXMenudir)/libXMenu11.a: FORCE
660 $(MAKE) -C $(oldXMenudir) libXMenu11.a 655 $(MAKE) -C $(dir $@) $(notdir $@)
661FORCE: 656FORCE:
662.PHONY: FORCE 657.PHONY: FORCE
663 658
664.PRECIOUS: ../config.status Makefile 659.PRECIOUS: ../config.status Makefile
665../config.status: $(top_srcdir)/configure.ac $(top_srcdir)/m4/*.m4 660../config.status: $(top_srcdir)/configure.ac $(top_srcdir)/m4/*.m4
666 $(MAKE) -C .. $(notdir $@) 661 $(MAKE) -C $(dir $@) $(notdir $@)
667Makefile: ../config.status $(srcdir)/Makefile.in 662Makefile: ../config.status $(srcdir)/Makefile.in
668 $(MAKE) -C .. src/$@ 663 $(MAKE) -C .. src/$@
669 664
@@ -681,7 +676,7 @@ ns-app: emacs$(EXEEXT) $(pdmp)
681 676
682mostlyclean: 677mostlyclean:
683 rm -f temacs$(EXEEXT) core ./*.core \#* ./*.o 678 rm -f temacs$(EXEEXT) core ./*.core \#* ./*.o
684 rm -f temacs.in$(EXEEXT) fingerprint.c dmpstruct.h 679 rm -f dmpstruct.h fingerprint.c
685 rm -f emacs.pdmp 680 rm -f emacs.pdmp
686 rm -f ../etc/DOC 681 rm -f ../etc/DOC
687 rm -f bootstrap-emacs$(EXEEXT) $(bootstrap_pdmp) 682 rm -f bootstrap-emacs$(EXEEXT) $(bootstrap_pdmp)
@@ -719,7 +714,7 @@ extraclean: distclean
719ETAGS = ../lib-src/etags${EXEEXT} 714ETAGS = ../lib-src/etags${EXEEXT}
720 715
721${ETAGS}: FORCE 716${ETAGS}: FORCE
722 ${MAKE} -C ../lib-src $(notdir $@) 717 $(MAKE) -C $(dir $@) $(notdir $@)
723 718
724# Remove macuvs.h and fingerprint.c since they'd cause `src/emacs` 719# Remove macuvs.h and fingerprint.c since they'd cause `src/emacs`
725# to be built before we can get TAGS. 720# to be built before we can get TAGS.
@@ -744,11 +739,8 @@ TAGS: ${ETAGS} $(ctagsfiles1) $(ctagsfiles2)
744 739
745## Arrange to make tags tables for ../lisp and ../lwlib, 740## Arrange to make tags tables for ../lisp and ../lwlib,
746## which the above TAGS file for the C files includes by reference. 741## which the above TAGS file for the C files includes by reference.
747../lisp/TAGS: FORCE 742../lisp/TAGS $(lwlibdir)/TAGS: FORCE
748 $(MAKE) -C ../lisp TAGS ETAGS="$(ETAGS)" 743 $(MAKE) -C $(dir $@) $(notdir $@) ETAGS="$(ETAGS)"
749
750$(lwlibdir)/TAGS: FORCE
751 $(MAKE) -C $(lwlibdir) TAGS ETAGS="$(ETAGS)"
752 744
753tags: TAGS ../lisp/TAGS $(lwlibdir)/TAGS 745tags: TAGS ../lisp/TAGS $(lwlibdir)/TAGS
754.PHONY: tags 746.PHONY: tags
diff --git a/src/alloc.c b/src/alloc.c
index e48807c49ad..dd783863be8 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -3718,8 +3718,8 @@ Its value is void, and its function definition and property list are nil. */)
3718Lisp_Object 3718Lisp_Object
3719make_misc_ptr (void *a) 3719make_misc_ptr (void *a)
3720{ 3720{
3721 struct Lisp_Misc_Ptr *p = ALLOCATE_PSEUDOVECTOR (struct Lisp_Misc_Ptr, pointer, 3721 struct Lisp_Misc_Ptr *p = ALLOCATE_PLAIN_PSEUDOVECTOR (struct Lisp_Misc_Ptr,
3722 PVEC_MISC_PTR); 3722 PVEC_MISC_PTR);
3723 p->pointer = a; 3723 p->pointer = a;
3724 return make_lisp_ptr (p, Lisp_Vectorlike); 3724 return make_lisp_ptr (p, Lisp_Vectorlike);
3725} 3725}
@@ -3729,7 +3729,7 @@ make_misc_ptr (void *a)
3729Lisp_Object 3729Lisp_Object
3730build_overlay (Lisp_Object start, Lisp_Object end, Lisp_Object plist) 3730build_overlay (Lisp_Object start, Lisp_Object end, Lisp_Object plist)
3731{ 3731{
3732 struct Lisp_Overlay *p = ALLOCATE_PSEUDOVECTOR (struct Lisp_Overlay, next, 3732 struct Lisp_Overlay *p = ALLOCATE_PSEUDOVECTOR (struct Lisp_Overlay, plist,
3733 PVEC_OVERLAY); 3733 PVEC_OVERLAY);
3734 Lisp_Object overlay = make_lisp_ptr (p, Lisp_Vectorlike); 3734 Lisp_Object overlay = make_lisp_ptr (p, Lisp_Vectorlike);
3735 OVERLAY_START (overlay) = start; 3735 OVERLAY_START (overlay) = start;
@@ -3743,8 +3743,8 @@ DEFUN ("make-marker", Fmake_marker, Smake_marker, 0, 0, 0,
3743 doc: /* Return a newly allocated marker which does not point at any place. */) 3743 doc: /* Return a newly allocated marker which does not point at any place. */)
3744 (void) 3744 (void)
3745{ 3745{
3746 struct Lisp_Marker *p = ALLOCATE_PSEUDOVECTOR (struct Lisp_Marker, buffer, 3746 struct Lisp_Marker *p = ALLOCATE_PLAIN_PSEUDOVECTOR (struct Lisp_Marker,
3747 PVEC_MARKER); 3747 PVEC_MARKER);
3748 p->buffer = 0; 3748 p->buffer = 0;
3749 p->bytepos = 0; 3749 p->bytepos = 0;
3750 p->charpos = 0; 3750 p->charpos = 0;
@@ -3766,8 +3766,8 @@ build_marker (struct buffer *buf, ptrdiff_t charpos, ptrdiff_t bytepos)
3766 /* Every character is at least one byte. */ 3766 /* Every character is at least one byte. */
3767 eassert (charpos <= bytepos); 3767 eassert (charpos <= bytepos);
3768 3768
3769 struct Lisp_Marker *m = ALLOCATE_PSEUDOVECTOR (struct Lisp_Marker, buffer, 3769 struct Lisp_Marker *m = ALLOCATE_PLAIN_PSEUDOVECTOR (struct Lisp_Marker,
3770 PVEC_MARKER); 3770 PVEC_MARKER);
3771 m->buffer = buf; 3771 m->buffer = buf;
3772 m->charpos = charpos; 3772 m->charpos = charpos;
3773 m->bytepos = bytepos; 3773 m->bytepos = bytepos;
@@ -3821,8 +3821,8 @@ make_event_array (ptrdiff_t nargs, Lisp_Object *args)
3821Lisp_Object 3821Lisp_Object
3822make_user_ptr (void (*finalizer) (void *), void *p) 3822make_user_ptr (void (*finalizer) (void *), void *p)
3823{ 3823{
3824 struct Lisp_User_Ptr *uptr = ALLOCATE_PSEUDOVECTOR (struct Lisp_User_Ptr, 3824 struct Lisp_User_Ptr *uptr
3825 finalizer, PVEC_USER_PTR); 3825 = ALLOCATE_PLAIN_PSEUDOVECTOR (struct Lisp_User_Ptr, PVEC_USER_PTR);
3826 uptr->finalizer = finalizer; 3826 uptr->finalizer = finalizer;
3827 uptr->p = p; 3827 uptr->p = p;
3828 return make_lisp_ptr (uptr, Lisp_Vectorlike); 3828 return make_lisp_ptr (uptr, Lisp_Vectorlike);
@@ -3945,7 +3945,7 @@ FUNCTION. FUNCTION will be run once per finalizer object. */)
3945 (Lisp_Object function) 3945 (Lisp_Object function)
3946{ 3946{
3947 struct Lisp_Finalizer *finalizer 3947 struct Lisp_Finalizer *finalizer
3948 = ALLOCATE_PSEUDOVECTOR (struct Lisp_Finalizer, prev, PVEC_FINALIZER); 3948 = ALLOCATE_PSEUDOVECTOR (struct Lisp_Finalizer, function, PVEC_FINALIZER);
3949 finalizer->function = function; 3949 finalizer->function = function;
3950 finalizer->prev = finalizer->next = NULL; 3950 finalizer->prev = finalizer->next = NULL;
3951 finalizer_insert (&finalizers, finalizer); 3951 finalizer_insert (&finalizers, finalizer);
diff --git a/src/bignum.c b/src/bignum.c
index 4118601e108..009d73118c2 100644
--- a/src/bignum.c
+++ b/src/bignum.c
@@ -86,8 +86,8 @@ make_bignum_bits (size_t bits)
86 if (integer_width < bits) 86 if (integer_width < bits)
87 overflow_error (); 87 overflow_error ();
88 88
89 struct Lisp_Bignum *b = ALLOCATE_PSEUDOVECTOR (struct Lisp_Bignum, value, 89 struct Lisp_Bignum *b = ALLOCATE_PLAIN_PSEUDOVECTOR (struct Lisp_Bignum,
90 PVEC_BIGNUM); 90 PVEC_BIGNUM);
91 mpz_init (b->value); 91 mpz_init (b->value);
92 mpz_swap (b->value, mpz[0]); 92 mpz_swap (b->value, mpz[0]);
93 return make_lisp_ptr (b, Lisp_Vectorlike); 93 return make_lisp_ptr (b, Lisp_Vectorlike);
@@ -342,8 +342,8 @@ bignum_to_string (Lisp_Object num, int base)
342Lisp_Object 342Lisp_Object
343make_bignum_str (char const *num, int base) 343make_bignum_str (char const *num, int base)
344{ 344{
345 struct Lisp_Bignum *b = ALLOCATE_PSEUDOVECTOR (struct Lisp_Bignum, value, 345 struct Lisp_Bignum *b = ALLOCATE_PLAIN_PSEUDOVECTOR (struct Lisp_Bignum,
346 PVEC_BIGNUM); 346 PVEC_BIGNUM);
347 mpz_init (b->value); 347 mpz_init (b->value);
348 int check = mpz_set_str (b->value, num, base); 348 int check = mpz_set_str (b->value, num, base);
349 eassert (check == 0); 349 eassert (check == 0);
diff --git a/src/buffer.c b/src/buffer.c
index c0f7521c9e1..ab477481912 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -584,10 +584,10 @@ even if it is dead. The return value is never nil. */)
584 set_string_intervals (name, NULL); 584 set_string_intervals (name, NULL);
585 bset_name (b, name); 585 bset_name (b, name);
586 586
587 if (STRINGP (Vcode_conversion_workbuf_name) 587 b->inhibit_buffer_hooks
588 && strncmp (SSDATA (name), SSDATA (Vcode_conversion_workbuf_name), 588 = (STRINGP (Vcode_conversion_workbuf_name)
589 SBYTES (Vcode_conversion_workbuf_name)) == 0) 589 && strncmp (SSDATA (name), SSDATA (Vcode_conversion_workbuf_name),
590 b->inhibit_buffer_hooks = true; 590 SBYTES (Vcode_conversion_workbuf_name)) == 0);
591 591
592 bset_undo_list (b, SREF (name, 0) != ' ' ? Qnil : Qt); 592 bset_undo_list (b, SREF (name, 0) != ' ' ? Qnil : Qt);
593 593
diff --git a/src/buffer.h b/src/buffer.h
index 63b162161c6..f42c3e97b97 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -741,8 +741,8 @@ struct buffer
741 See `cursor-type' for other values. */ 741 See `cursor-type' for other values. */
742 Lisp_Object cursor_in_non_selected_windows_; 742 Lisp_Object cursor_in_non_selected_windows_;
743 743
744 /* No more Lisp_Object beyond this point. Except undo_list, 744 /* No more Lisp_Object beyond cursor_in_non_selected_windows_.
745 which is handled specially in Fgarbage_collect. */ 745 Except undo_list, which is handled specially in Fgarbage_collect. */
746 746
747 /* This structure holds the coordinates of the buffer contents 747 /* This structure holds the coordinates of the buffer contents
748 in ordinary buffers. In indirect buffers, this is not used. */ 748 in ordinary buffers. In indirect buffers, this is not used. */
@@ -1019,14 +1019,12 @@ bset_width_table (struct buffer *b, Lisp_Object val)
1019 structure, make sure that this is still correct. */ 1019 structure, make sure that this is still correct. */
1020 1020
1021#define BUFFER_LISP_SIZE \ 1021#define BUFFER_LISP_SIZE \
1022 ((offsetof (struct buffer, own_text) - header_size) / word_size) 1022 PSEUDOVECSIZE (struct buffer, cursor_in_non_selected_windows_)
1023 1023
1024/* Size of the struct buffer part beyond leading Lisp_Objects, in word_size 1024/* Allocated size of the struct buffer part beyond leading
1025 units. Rounding is needed for --with-wide-int configuration. */ 1025 Lisp_Objects, in word_size units. */
1026 1026
1027#define BUFFER_REST_SIZE \ 1027#define BUFFER_REST_SIZE (VECSIZE (struct buffer) - BUFFER_LISP_SIZE)
1028 ((((sizeof (struct buffer) - offsetof (struct buffer, own_text)) \
1029 + (word_size - 1)) & ~(word_size - 1)) / word_size)
1030 1028
1031/* Initialize the pseudovector header of buffer object. BUFFER_LISP_SIZE 1029/* Initialize the pseudovector header of buffer object. BUFFER_LISP_SIZE
1032 is required for GC, but BUFFER_REST_SIZE is set up just to be consistent 1030 is required for GC, but BUFFER_REST_SIZE is set up just to be consistent
diff --git a/src/composite.c b/src/composite.c
index c426cbb1246..88f1235f116 100644
--- a/src/composite.c
+++ b/src/composite.c
@@ -787,28 +787,19 @@ static Lisp_Object gstring_work;
787static Lisp_Object gstring_work_headers; 787static Lisp_Object gstring_work_headers;
788 788
789static Lisp_Object 789static Lisp_Object
790fill_gstring_header (Lisp_Object header, ptrdiff_t from, ptrdiff_t from_byte, 790fill_gstring_header (ptrdiff_t from, ptrdiff_t from_byte,
791 ptrdiff_t to, Lisp_Object font_object, Lisp_Object string) 791 ptrdiff_t to, Lisp_Object font_object, Lisp_Object string)
792{ 792{
793 ptrdiff_t len = to - from, i; 793 ptrdiff_t len = to - from;
794
795 if (len == 0) 794 if (len == 0)
796 error ("Attempt to shape zero-length text"); 795 error ("Attempt to shape zero-length text");
797 if (VECTORP (header)) 796 eassume (0 < len);
798 { 797 Lisp_Object header = (len <= 8
799 if (ASIZE (header) != len + 1) 798 ? AREF (gstring_work_headers, len - 1)
800 args_out_of_range (header, make_fixnum (len + 1)); 799 : make_uninit_vector (len + 1));
801 }
802 else
803 {
804 if (len <= 8)
805 header = AREF (gstring_work_headers, len - 1);
806 else
807 header = make_uninit_vector (len + 1);
808 }
809 800
810 ASET (header, 0, font_object); 801 ASET (header, 0, font_object);
811 for (i = 0; i < len; i++) 802 for (ptrdiff_t i = 0; i < len; i++)
812 { 803 {
813 int c; 804 int c;
814 805
@@ -1748,7 +1739,7 @@ should be ignored. */)
1748 frombyte = string_char_to_byte (string, frompos); 1739 frombyte = string_char_to_byte (string, frompos);
1749 } 1740 }
1750 1741
1751 header = fill_gstring_header (Qnil, frompos, frombyte, 1742 header = fill_gstring_header (frompos, frombyte,
1752 topos, font_object, string); 1743 topos, font_object, string);
1753 gstring = gstring_lookup_cache (header); 1744 gstring = gstring_lookup_cache (header);
1754 if (! NILP (gstring)) 1745 if (! NILP (gstring))
diff --git a/src/dmpstruct.awk b/src/dmpstruct.awk
index 55626cf8b21..55626cf8b21 100755..100644
--- a/src/dmpstruct.awk
+++ b/src/dmpstruct.awk
diff --git a/src/editfns.c b/src/editfns.c
index bfffadc733d..6fb43af4e9c 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -2686,8 +2686,9 @@ but is not deleted; if you save the buffer in a file, the invisible
2686text is included in the file. \\[widen] makes all visible again. 2686text is included in the file. \\[widen] makes all visible again.
2687See also `save-restriction'. 2687See also `save-restriction'.
2688 2688
2689When calling from a program, pass two arguments; positions (integers 2689When calling from Lisp, pass two arguments START and END:
2690or markers) bounding the text that should remain visible. */) 2690positions (integers or markers) bounding the text that should
2691remain visible. */)
2691 (register Lisp_Object start, Lisp_Object end) 2692 (register Lisp_Object start, Lisp_Object end)
2692{ 2693{
2693 CHECK_FIXNUM_COERCE_MARKER (start); 2694 CHECK_FIXNUM_COERCE_MARKER (start);
diff --git a/src/emacs-module.c b/src/emacs-module.c
index 2bb1062574e..47ca3368c0f 100644
--- a/src/emacs-module.c
+++ b/src/emacs-module.c
@@ -427,7 +427,7 @@ static struct Lisp_Module_Function *
427allocate_module_function (void) 427allocate_module_function (void)
428{ 428{
429 return ALLOCATE_PSEUDOVECTOR (struct Lisp_Module_Function, 429 return ALLOCATE_PSEUDOVECTOR (struct Lisp_Module_Function,
430 min_arity, PVEC_MODULE_FUNCTION); 430 documentation, PVEC_MODULE_FUNCTION);
431} 431}
432 432
433#define XSET_MODULE_FUNCTION(var, ptr) \ 433#define XSET_MODULE_FUNCTION(var, ptr) \
diff --git a/src/filelock.c b/src/filelock.c
index 5cec1996201..baf87b7f635 100644
--- a/src/filelock.c
+++ b/src/filelock.c
@@ -822,6 +822,7 @@ t if it is locked by you, else a string saying which user has locked it. */)
822 USE_SAFE_ALLOCA; 822 USE_SAFE_ALLOCA;
823 823
824 filename = Fexpand_file_name (filename, Qnil); 824 filename = Fexpand_file_name (filename, Qnil);
825 filename = ENCODE_FILE (filename);
825 826
826 MAKE_LOCK_NAME (lfname, filename); 827 MAKE_LOCK_NAME (lfname, filename);
827 828
diff --git a/src/fingerprint-dummy.c b/src/fingerprint-dummy.c
deleted file mode 100644
index 1603519783e..00000000000
--- a/src/fingerprint-dummy.c
+++ /dev/null
@@ -1,23 +0,0 @@
1/* Dummy fingerprint
2
3Copyright (C) 2016, 2018-2019 Free Software Foundation, Inc.
4
5This file is part of GNU Emacs.
6
7GNU Emacs is free software: you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation, either version 3 of the License, or (at
10your option) any later version.
11
12GNU Emacs is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
19
20#include "fingerprint.h"
21
22/* Dummy fingerprint to use as hash input. */
23const uint8_t fingerprint[32] = { 0 };
diff --git a/src/fingerprint.h b/src/fingerprint.h
index 913b668b4e0..0b195fd0ca7 100644
--- a/src/fingerprint.h
+++ b/src/fingerprint.h
@@ -20,12 +20,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
20#ifndef EMACS_FINGERPRINT_H 20#ifndef EMACS_FINGERPRINT_H
21#define EMACS_FINGERPRINT_H 21#define EMACS_FINGERPRINT_H
22 22
23#include <stdint.h>
24
25/* We generate fingerprint.c and fingerprint.o from all the sources in 23/* We generate fingerprint.c and fingerprint.o from all the sources in
26 Emacs. This way, we have a unique value that we can use to pair 24 Emacs. This way, we have a unique value that we can use to pair
27 data files (like a portable dump image) with a specific build of 25 data files (like a portable dump image) with a specific build of
28 Emacs. */ 26 Emacs. */
29extern const uint8_t fingerprint[32]; 27extern unsigned char const fingerprint[32];
30 28
31#endif 29#endif
diff --git a/src/fns.c b/src/fns.c
index b97b132b0fe..c3202495daf 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -3904,7 +3904,7 @@ static struct Lisp_Hash_Table *
3904allocate_hash_table (void) 3904allocate_hash_table (void)
3905{ 3905{
3906 return ALLOCATE_PSEUDOVECTOR (struct Lisp_Hash_Table, 3906 return ALLOCATE_PSEUDOVECTOR (struct Lisp_Hash_Table,
3907 count, PVEC_HASH_TABLE); 3907 index, PVEC_HASH_TABLE);
3908} 3908}
3909 3909
3910/* An upper bound on the size of a hash table index. It must fit in 3910/* An upper bound on the size of a hash table index. It must fit in
diff --git a/src/fontset.c b/src/fontset.c
index 2729fae6ee9..eec1e0da4cc 100644
--- a/src/fontset.c
+++ b/src/fontset.c
@@ -1444,7 +1444,7 @@ or t for the default fontset.
1444 1444
1445TARGET may be a single character to use FONT-SPEC for. 1445TARGET may be a single character to use FONT-SPEC for.
1446 1446
1447Target may be a cons (FROM . TO), where FROM and TO are characters. 1447TARGET may be a cons (FROM . TO), where FROM and TO are characters.
1448In that case, use FONT-SPEC for all the characters in the range 1448In that case, use FONT-SPEC for all the characters in the range
1449between FROM and TO (inclusive). 1449between FROM and TO (inclusive).
1450 1450
diff --git a/src/frame.c b/src/frame.c
index d0c77149ba8..192ef4244fb 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -798,7 +798,8 @@ adjust_frame_size (struct frame *f, int new_width, int new_height, int inhibit,
798static struct frame * 798static struct frame *
799allocate_frame (void) 799allocate_frame (void)
800{ 800{
801 return ALLOCATE_ZEROED_PSEUDOVECTOR (struct frame, face_cache, PVEC_FRAME); 801 return ALLOCATE_ZEROED_PSEUDOVECTOR (struct frame, tool_bar_items,
802 PVEC_FRAME);
802} 803}
803 804
804struct frame * 805struct frame *
@@ -5662,8 +5663,8 @@ selected frame. This is useful when `make-pointer-invisible' is set. */)
5662 5663
5663#ifdef HAVE_WINDOW_SYSTEM 5664#ifdef HAVE_WINDOW_SYSTEM
5664 5665
5665# if (defined HAVE_NS \ 5666# if (defined USE_GTK || defined HAVE_NS || defined HAVE_XINERAMA \
5666 || (!defined USE_GTK && (defined HAVE_XINERAMA || defined HAVE_XRANDR))) 5667 || defined HAVE_XRANDR)
5667void 5668void
5668free_monitors (struct MonitorInfo *monitors, int n_monitors) 5669free_monitors (struct MonitorInfo *monitors, int n_monitors)
5669{ 5670{
diff --git a/src/frame.h b/src/frame.h
index ed62e7ace0f..ec8f61465f2 100644
--- a/src/frame.h
+++ b/src/frame.h
@@ -190,9 +190,6 @@ struct frame
190 Lisp_Object current_tool_bar_string; 190 Lisp_Object current_tool_bar_string;
191#endif 191#endif
192 192
193 /* Desired and current tool-bar items. */
194 Lisp_Object tool_bar_items;
195
196#ifdef USE_GTK 193#ifdef USE_GTK
197 /* Where tool bar is, can be left, right, top or bottom. 194 /* Where tool bar is, can be left, right, top or bottom.
198 Except with GTK, the only supported position is `top'. */ 195 Except with GTK, the only supported position is `top'. */
@@ -204,7 +201,9 @@ struct frame
204 Lisp_Object font_data; 201 Lisp_Object font_data;
205#endif 202#endif
206 203
207 /* Beyond here, there should be no more Lisp_Object components. */ 204 /* Desired and current tool-bar items. */
205 Lisp_Object tool_bar_items;
206 /* tool_bar_items should be the last Lisp_Object member. */
208 207
209 /* Cache of realized faces. */ 208 /* Cache of realized faces. */
210 struct face_cache *face_cache; 209 struct face_cache *face_cache;
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 4bd73b1a6d1..b130692c87a 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -1401,7 +1401,6 @@ x_wm_set_size_hint (struct frame *f, long int flags, bool user_position)
1401 GdkGeometry size_hints; 1401 GdkGeometry size_hints;
1402 gint hint_flags = 0; 1402 gint hint_flags = 0;
1403 int base_width, base_height; 1403 int base_width, base_height;
1404 int min_rows = 0, min_cols = 0;
1405 int win_gravity = f->win_gravity; 1404 int win_gravity = f->win_gravity;
1406 Lisp_Object fs_state, frame; 1405 Lisp_Object fs_state, frame;
1407 int scale = xg_get_scale (f); 1406 int scale = xg_get_scale (f);
@@ -1450,13 +1449,10 @@ x_wm_set_size_hint (struct frame *f, long int flags, bool user_position)
1450 base_height = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, 1) 1449 base_height = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, 1)
1451 + FRAME_MENUBAR_HEIGHT (f) + FRAME_TOOLBAR_HEIGHT (f); 1450 + FRAME_MENUBAR_HEIGHT (f) + FRAME_TOOLBAR_HEIGHT (f);
1452 1451
1453 if (min_cols > 0) --min_cols; /* We used one col in base_width = ... 1); */
1454 if (min_rows > 0) --min_rows; /* We used one row in base_height = ... 1); */
1455
1456 size_hints.base_width = base_width; 1452 size_hints.base_width = base_width;
1457 size_hints.base_height = base_height; 1453 size_hints.base_height = base_height;
1458 size_hints.min_width = base_width + min_cols * FRAME_COLUMN_WIDTH (f); 1454 size_hints.min_width = base_width;
1459 size_hints.min_height = base_height + min_rows * FRAME_LINE_HEIGHT (f); 1455 size_hints.min_height = base_height;
1460 1456
1461 /* These currently have a one to one mapping with the X values, but I 1457 /* These currently have a one to one mapping with the X values, but I
1462 don't think we should rely on that. */ 1458 don't think we should rely on that. */
diff --git a/src/lisp.h b/src/lisp.h
index a0a7cbdf518..681efc3b52b 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -1904,9 +1904,9 @@ memclear (void *p, ptrdiff_t nbytes)
1904 at the end and we need to compute the number of Lisp_Object fields (the 1904 at the end and we need to compute the number of Lisp_Object fields (the
1905 ones that the GC needs to trace). */ 1905 ones that the GC needs to trace). */
1906 1906
1907#define PSEUDOVECSIZE(type, nonlispfield) \ 1907#define PSEUDOVECSIZE(type, lastlispfield) \
1908 (offsetof (type, nonlispfield) < header_size \ 1908 (offsetof (type, lastlispfield) + word_size < header_size \
1909 ? 0 : (offsetof (type, nonlispfield) - header_size) / word_size) 1909 ? 0 : (offsetof (type, lastlispfield) + word_size - header_size) / word_size)
1910 1910
1911/* Compute A OP B, using the unsigned comparison operator OP. A and B 1911/* Compute A OP B, using the unsigned comparison operator OP. A and B
1912 should be integer expressions. This is not the same as 1912 should be integer expressions. This is not the same as
@@ -2109,11 +2109,14 @@ enum char_table_specials
2109 /* This is the number of slots that every char table must have. This 2109 /* This is the number of slots that every char table must have. This
2110 counts the ordinary slots and the top, defalt, parent, and purpose 2110 counts the ordinary slots and the top, defalt, parent, and purpose
2111 slots. */ 2111 slots. */
2112 CHAR_TABLE_STANDARD_SLOTS = PSEUDOVECSIZE (struct Lisp_Char_Table, extras), 2112 CHAR_TABLE_STANDARD_SLOTS
2113 = (PSEUDOVECSIZE (struct Lisp_Char_Table, contents) - 1
2114 + (1 << CHARTAB_SIZE_BITS_0)),
2113 2115
2114 /* This is an index of first Lisp_Object field in Lisp_Sub_Char_Table 2116 /* This is the index of the first Lisp_Object field in Lisp_Sub_Char_Table
2115 when the latter is treated as an ordinary Lisp_Vector. */ 2117 when the latter is treated as an ordinary Lisp_Vector. */
2116 SUB_CHAR_TABLE_OFFSET = PSEUDOVECSIZE (struct Lisp_Sub_Char_Table, contents) 2118 SUB_CHAR_TABLE_OFFSET
2119 = PSEUDOVECSIZE (struct Lisp_Sub_Char_Table, contents) - 1
2117 }; 2120 };
2118 2121
2119/* Sanity-check pseudovector layout. */ 2122/* Sanity-check pseudovector layout. */
@@ -2313,8 +2316,8 @@ struct Lisp_Hash_Table
2313 hash table size to reduce collisions. */ 2316 hash table size to reduce collisions. */
2314 Lisp_Object index; 2317 Lisp_Object index;
2315 2318
2316 /* Only the fields above are traced normally by the GC. The ones below 2319 /* Only the fields above are traced normally by the GC. The ones after
2317 `count' are special and are either ignored by the GC or traced in 2320 'index' are special and are either ignored by the GC or traced in
2318 a special way (e.g. because of weakness). */ 2321 a special way (e.g. because of weakness). */
2319 2322
2320 /* Number of key/value entries in the table. */ 2323 /* Number of key/value entries in the table. */
@@ -3940,6 +3943,11 @@ make_nil_vector (ptrdiff_t size)
3940extern struct Lisp_Vector *allocate_pseudovector (int, int, int, 3943extern struct Lisp_Vector *allocate_pseudovector (int, int, int,
3941 enum pvec_type); 3944 enum pvec_type);
3942 3945
3946/* Allocate uninitialized pseudovector with no Lisp_Object slots. */
3947
3948#define ALLOCATE_PLAIN_PSEUDOVECTOR(type, tag) \
3949 ((type *) allocate_pseudovector (VECSIZE (type), 0, 0, tag))
3950
3943/* Allocate partially initialized pseudovector where all Lisp_Object 3951/* Allocate partially initialized pseudovector where all Lisp_Object
3944 slots are set to Qnil but the rest (if any) is left uninitialized. */ 3952 slots are set to Qnil but the rest (if any) is left uninitialized. */
3945 3953
diff --git a/src/pdumper.c b/src/pdumper.c
index 7fabfa771ce..600c5b3ca3d 100644
--- a/src/pdumper.c
+++ b/src/pdumper.c
@@ -46,7 +46,9 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
46#include "thread.h" 46#include "thread.h"
47#include "bignum.h" 47#include "bignum.h"
48 48
49#include "dmpstruct.h" 49#ifdef CHECK_STRUCTS
50# include "dmpstruct.h"
51#endif
50 52
51/* 53/*
52 TODO: 54 TODO:
@@ -68,16 +70,6 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
68 70
69#ifdef HAVE_PDUMPER 71#ifdef HAVE_PDUMPER
70 72
71/* CHECK_STRUCTS being true makes the build break if we notice
72 changes to the source defining certain Lisp structures we dump. If
73 you change one of these structures, check that the pdumper code is
74 still valid, and update the pertinent hash lower down in this file
75 (pdumper.c) by manually copying the value from the dmpstruct.h
76 generated from your new code. */
77#ifndef CHECK_STRUCTS
78# define CHECK_STRUCTS 1
79#endif
80
81#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7) 73#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7)
82# pragma GCC diagnostic error "-Wconversion" 74# pragma GCC diagnostic error "-Wconversion"
83# pragma GCC diagnostic error "-Wshadow" 75# pragma GCC diagnostic error "-Wshadow"
@@ -135,8 +127,6 @@ verify (sizeof (intptr_t) == sizeof (ptrdiff_t));
135verify (sizeof (void (*)(void)) == sizeof (void *)); 127verify (sizeof (void (*)(void)) == sizeof (void *));
136verify (sizeof (ptrdiff_t) <= sizeof (Lisp_Object)); 128verify (sizeof (ptrdiff_t) <= sizeof (Lisp_Object));
137verify (sizeof (ptrdiff_t) <= sizeof (EMACS_INT)); 129verify (sizeof (ptrdiff_t) <= sizeof (EMACS_INT));
138verify (sizeof (off_t) == sizeof (int32_t)
139 || sizeof (off_t) == sizeof (int64_t));
140verify (CHAR_BIT == 8); 130verify (CHAR_BIT == 8);
141 131
142#define DIVIDE_ROUND_UP(x, y) (((x) + (y) - 1) / (y)) 132#define DIVIDE_ROUND_UP(x, y) (((x) + (y) - 1) / (y))
@@ -157,9 +147,9 @@ static struct
157} remembered_data[32]; 147} remembered_data[32];
158static int nr_remembered_data = 0; 148static int nr_remembered_data = 0;
159 149
160typedef int32_t dump_off; 150typedef int_least32_t dump_off;
161#define DUMP_OFF_MIN INT32_MIN 151#define DUMP_OFF_MIN INT_LEAST32_MIN
162#define DUMP_OFF_MAX INT32_MAX 152#define DUMP_OFF_MAX INT_LEAST32_MAX
163 153
164__attribute__((format (printf,1,2))) 154__attribute__((format (printf,1,2)))
165static void 155static void
@@ -302,10 +292,10 @@ verify (DUMP_ALIGNMENT >= GCALIGNMENT);
302 292
303struct dump_reloc 293struct dump_reloc
304{ 294{
305 uint32_t raw_offset : DUMP_RELOC_OFFSET_BITS; 295 unsigned int raw_offset : DUMP_RELOC_OFFSET_BITS;
306 ENUM_BF (dump_reloc_type) type : DUMP_RELOC_TYPE_BITS; 296 ENUM_BF (dump_reloc_type) type : DUMP_RELOC_TYPE_BITS;
307}; 297};
308verify (sizeof (struct dump_reloc) == sizeof (int32_t)); 298verify (sizeof (struct dump_reloc) == sizeof (dump_off));
309 299
310/* Set the type of a dump relocation. 300/* Set the type of a dump relocation.
311 301
@@ -335,7 +325,7 @@ dump_reloc_set_offset (struct dump_reloc *reloc, dump_off offset)
335} 325}
336 326
337static void 327static void
338dump_fingerprint (const char *label, const uint8_t *xfingerprint) 328dump_fingerprint (const char *label, unsigned char const *xfingerprint)
339{ 329{
340 fprintf (stderr, "%s: ", label); 330 fprintf (stderr, "%s: ", label);
341 for (int i = 0; i < 32; ++i) 331 for (int i = 0; i < 32; ++i)
@@ -366,7 +356,7 @@ struct dump_header
366 char magic[sizeof (dump_magic)]; 356 char magic[sizeof (dump_magic)];
367 357
368 /* Associated Emacs binary. */ 358 /* Associated Emacs binary. */
369 uint8_t fingerprint[32]; 359 unsigned char fingerprint[32];
370 360
371 /* Relocation table for the dump file; each entry is a 361 /* Relocation table for the dump file; each entry is a
372 struct dump_reloc. */ 362 struct dump_reloc. */
@@ -1777,6 +1767,8 @@ dump_roots (struct dump_context *ctx)
1777 visit_static_gc_roots (visitor); 1767 visit_static_gc_roots (visitor);
1778} 1768}
1779 1769
1770#define PDUMPER_MAX_OBJECT_SIZE 2048
1771
1780static dump_off 1772static dump_off
1781field_relpos (const void *in_start, const void *in_field) 1773field_relpos (const void *in_start, const void *in_field)
1782{ 1774{
@@ -1784,7 +1776,15 @@ field_relpos (const void *in_start, const void *in_field)
1784 ptrdiff_t in_field_val = (ptrdiff_t) in_field; 1776 ptrdiff_t in_field_val = (ptrdiff_t) in_field;
1785 eassert (in_start_val <= in_field_val); 1777 eassert (in_start_val <= in_field_val);
1786 ptrdiff_t relpos = in_field_val - in_start_val; 1778 ptrdiff_t relpos = in_field_val - in_start_val;
1787 eassert (relpos < 1024); /* Sanity check. */ 1779 /* The following assertion attempts to detect bugs whereby IN_START
1780 and IN_FIELD don't point to the same object/structure, on the
1781 assumption that a too-large difference between them is
1782 suspicious. As of Apr 2019 the largest object we dump -- 'struct
1783 buffer' -- is slightly smaller than 1KB, and we want to leave
1784 some margin for future extensions. If the assertion below is
1785 ever violated, make sure the two pointers indeed point into the
1786 same object, and if so, enlarge the value of PDUMPER_MAX_OBJECT_SIZE. */
1787 eassert (relpos < PDUMPER_MAX_OBJECT_SIZE);
1788 return (dump_off) relpos; 1788 return (dump_off) relpos;
1789} 1789}
1790 1790
@@ -2692,7 +2692,7 @@ dump_hash_table (struct dump_context *ctx,
2692 Lisp_Object object, 2692 Lisp_Object object,
2693 dump_off offset) 2693 dump_off offset)
2694{ 2694{
2695#if CHECK_STRUCTS && !defined (HASH_Lisp_Hash_Table_73C9BFB7D1) 2695#if CHECK_STRUCTS && !defined HASH_Lisp_Hash_Table_EF95ED06FF
2696# error "Lisp_Hash_Table changed. See CHECK_STRUCTS comment." 2696# error "Lisp_Hash_Table changed. See CHECK_STRUCTS comment."
2697#endif 2697#endif
2698 const struct Lisp_Hash_Table *hash_in = XHASH_TABLE (object); 2698 const struct Lisp_Hash_Table *hash_in = XHASH_TABLE (object);
@@ -2760,7 +2760,7 @@ dump_hash_table (struct dump_context *ctx,
2760static dump_off 2760static dump_off
2761dump_buffer (struct dump_context *ctx, const struct buffer *in_buffer) 2761dump_buffer (struct dump_context *ctx, const struct buffer *in_buffer)
2762{ 2762{
2763#if CHECK_STRUCTS && !defined HASH_buffer_2CEE653E74 2763#if CHECK_STRUCTS && !defined HASH_buffer_E34A11C6B9
2764# error "buffer changed. See CHECK_STRUCTS comment." 2764# error "buffer changed. See CHECK_STRUCTS comment."
2765#endif 2765#endif
2766 struct buffer munged_buffer = *in_buffer; 2766 struct buffer munged_buffer = *in_buffer;
@@ -4309,17 +4309,12 @@ enum dump_memory_protection
4309 DUMP_MEMORY_ACCESS_READWRITE = 3, 4309 DUMP_MEMORY_ACCESS_READWRITE = 3,
4310}; 4310};
4311 4311
4312#if VM_SUPPORTED == VM_MS_WINDOWS
4312static void * 4313static void *
4313dump_anonymous_allocate_w32 (void *base, 4314dump_anonymous_allocate_w32 (void *base,
4314 size_t size, 4315 size_t size,
4315 enum dump_memory_protection protection) 4316 enum dump_memory_protection protection)
4316{ 4317{
4317#if VM_SUPPORTED != VM_MS_WINDOWS
4318 (void) base;
4319 (void) size;
4320 (void) protection;
4321 emacs_abort ();
4322#else
4323 void *ret; 4318 void *ret;
4324 DWORD mem_type; 4319 DWORD mem_type;
4325 DWORD mem_prot; 4320 DWORD mem_prot;
@@ -4348,26 +4343,22 @@ dump_anonymous_allocate_w32 (void *base,
4348 ? EBUSY 4343 ? EBUSY
4349 : EPERM; 4344 : EPERM;
4350 return ret; 4345 return ret;
4351#endif
4352} 4346}
4347#endif
4348
4349#if VM_SUPPORTED == VM_POSIX
4353 4350
4354/* Old versions of macOS only define MAP_ANON, not MAP_ANONYMOUS. 4351/* Old versions of macOS only define MAP_ANON, not MAP_ANONYMOUS.
4355 FIXME: This probably belongs elsewhere (gnulib/autoconf?) */ 4352 FIXME: This probably belongs elsewhere (gnulib/autoconf?) */
4356#ifndef MAP_ANONYMOUS 4353# ifndef MAP_ANONYMOUS
4357#define MAP_ANONYMOUS MAP_ANON 4354# define MAP_ANONYMOUS MAP_ANON
4358#endif 4355# endif
4359 4356
4360static void * 4357static void *
4361dump_anonymous_allocate_posix (void *base, 4358dump_anonymous_allocate_posix (void *base,
4362 size_t size, 4359 size_t size,
4363 enum dump_memory_protection protection) 4360 enum dump_memory_protection protection)
4364{ 4361{
4365#if VM_SUPPORTED != VM_POSIX
4366 (void) base;
4367 (void) size;
4368 (void) protection;
4369 emacs_abort ();
4370#else
4371 void *ret; 4362 void *ret;
4372 int mem_prot; 4363 int mem_prot;
4373 4364
@@ -4412,8 +4403,8 @@ dump_anonymous_allocate_posix (void *base,
4412 if (ret == MAP_FAILED) 4403 if (ret == MAP_FAILED)
4413 ret = NULL; 4404 ret = NULL;
4414 return ret; 4405 return ret;
4415#endif
4416} 4406}
4407#endif
4417 4408
4418/* Perform anonymous memory allocation. */ 4409/* Perform anonymous memory allocation. */
4419static void * 4410static void *
@@ -4421,14 +4412,14 @@ dump_anonymous_allocate (void *base,
4421 const size_t size, 4412 const size_t size,
4422 enum dump_memory_protection protection) 4413 enum dump_memory_protection protection)
4423{ 4414{
4424 void *ret = NULL; 4415#if VM_SUPPORTED == VM_POSIX
4425 if (VM_SUPPORTED == VM_MS_WINDOWS) 4416 return dump_anonymous_allocate_posix (base, size, protection);
4426 ret = dump_anonymous_allocate_w32 (base, size, protection); 4417#elif VM_SUPPORTED == VM_MS_WINDOWS
4427 else if (VM_SUPPORTED == VM_POSIX) 4418 return dump_anonymous_allocate_w32 (base, size, protection);
4428 ret = dump_anonymous_allocate_posix (base, size, protection); 4419#else
4429 else 4420 errno = ENOSYS;
4430 errno = ENOSYS; 4421 return NULL;
4431 return ret; 4422#endif
4432} 4423}
4433 4424
4434/* Undo the effect of dump_reserve_address_space(). */ 4425/* Undo the effect of dump_reserve_address_space(). */
@@ -4450,18 +4441,11 @@ dump_anonymous_release (void *addr, size_t size)
4450#endif 4441#endif
4451} 4442}
4452 4443
4444#if VM_SUPPORTED == VM_MS_WINDOWS
4453static void * 4445static void *
4454dump_map_file_w32 (void *base, int fd, off_t offset, size_t size, 4446dump_map_file_w32 (void *base, int fd, off_t offset, size_t size,
4455 enum dump_memory_protection protection) 4447 enum dump_memory_protection protection)
4456{ 4448{
4457#if VM_SUPPORTED != VM_MS_WINDOWS
4458 (void) base;
4459 (void) fd;
4460 (void) offset;
4461 (void) size;
4462 (void) protection;
4463 emacs_abort ();
4464#else
4465 void *ret = NULL; 4449 void *ret = NULL;
4466 HANDLE section = NULL; 4450 HANDLE section = NULL;
4467 HANDLE file; 4451 HANDLE file;
@@ -4516,21 +4500,14 @@ dump_map_file_w32 (void *base, int fd, off_t offset, size_t size,
4516 if (section && !CloseHandle (section)) 4500 if (section && !CloseHandle (section))
4517 emacs_abort (); 4501 emacs_abort ();
4518 return ret; 4502 return ret;
4519#endif
4520} 4503}
4504#endif
4521 4505
4506#if VM_SUPPORTED == VM_POSIX
4522static void * 4507static void *
4523dump_map_file_posix (void *base, int fd, off_t offset, size_t size, 4508dump_map_file_posix (void *base, int fd, off_t offset, size_t size,
4524 enum dump_memory_protection protection) 4509 enum dump_memory_protection protection)
4525{ 4510{
4526#if VM_SUPPORTED != VM_POSIX
4527 (void) base;
4528 (void) fd;
4529 (void) offset;
4530 (void) size;
4531 (void) protection;
4532 emacs_abort ();
4533#else
4534 void *ret; 4511 void *ret;
4535 int mem_prot; 4512 int mem_prot;
4536 int mem_flags; 4513 int mem_flags;
@@ -4560,22 +4537,22 @@ dump_map_file_posix (void *base, int fd, off_t offset, size_t size,
4560 if (ret == MAP_FAILED) 4537 if (ret == MAP_FAILED)
4561 ret = NULL; 4538 ret = NULL;
4562 return ret; 4539 return ret;
4563#endif
4564} 4540}
4541#endif
4565 4542
4566/* Map a file into memory. */ 4543/* Map a file into memory. */
4567static void * 4544static void *
4568dump_map_file (void *base, int fd, off_t offset, size_t size, 4545dump_map_file (void *base, int fd, off_t offset, size_t size,
4569 enum dump_memory_protection protection) 4546 enum dump_memory_protection protection)
4570{ 4547{
4571 void *ret = NULL; 4548#if VM_SUPPORTED == VM_POSIX
4572 if (VM_SUPPORTED == VM_MS_WINDOWS) 4549 return dump_map_file_posix (base, fd, offset, size, protection);
4573 ret = dump_map_file_w32 (base, fd, offset, size, protection); 4550#elif VM_SUPPORTED == VM_MS_WINDOWS
4574 else if (VM_SUPPORTED == VM_POSIX) 4551 return dump_map_file_w32 (base, fd, offset, size, protection);
4575 ret = dump_map_file_posix (base, fd, offset, size, protection); 4552#else
4576 else 4553 errno = ENOSYS;
4577 errno = ENOSYS;
4578 return ret; 4554 return ret;
4555#endif
4579} 4556}
4580 4557
4581/* Remove a virtual memory mapping. 4558/* Remove a virtual memory mapping.
diff --git a/src/process.c b/src/process.c
index 802ac026249..6770a5ed884 100644
--- a/src/process.c
+++ b/src/process.c
@@ -858,7 +858,8 @@ allocate_pty (char pty_name[PTY_NAME_SIZE])
858static struct Lisp_Process * 858static struct Lisp_Process *
859allocate_process (void) 859allocate_process (void)
860{ 860{
861 return ALLOCATE_ZEROED_PSEUDOVECTOR (struct Lisp_Process, pid, PVEC_PROCESS); 861 return ALLOCATE_ZEROED_PSEUDOVECTOR (struct Lisp_Process, thread,
862 PVEC_PROCESS);
862} 863}
863 864
864static Lisp_Object 865static Lisp_Object
diff --git a/src/process.h b/src/process.h
index d66aa062a54..5e957c4298e 100644
--- a/src/process.h
+++ b/src/process.h
@@ -117,9 +117,7 @@ struct Lisp_Process
117 117
118 /* The thread a process is linked to, or nil for any thread. */ 118 /* The thread a process is linked to, or nil for any thread. */
119 Lisp_Object thread; 119 Lisp_Object thread;
120 120 /* After this point, there are no Lisp_Objects. */
121 /* After this point, there are no Lisp_Objects any more. */
122 /* alloc.c assumes that `pid' is the first such non-Lisp slot. */
123 121
124 /* Process ID. A positive value is a child process ID. 122 /* Process ID. A positive value is a child process ID.
125 Zero is for pseudo-processes such as network or serial connections, 123 Zero is for pseudo-processes such as network or serial connections,
diff --git a/src/termhooks.h b/src/termhooks.h
index ca6782f461b..a92b981110d 100644
--- a/src/termhooks.h
+++ b/src/termhooks.h
@@ -408,7 +408,7 @@ struct terminal
408 whether the mapping is available. */ 408 whether the mapping is available. */
409 Lisp_Object glyph_code_table; 409 Lisp_Object glyph_code_table;
410 410
411 /* All fields before `next_terminal' should be Lisp_Object and are traced 411 /* All earlier fields should be Lisp_Objects and are traced
412 by the GC. All fields afterwards are ignored by the GC. */ 412 by the GC. All fields afterwards are ignored by the GC. */
413 413
414 /* Chain of all terminal devices. */ 414 /* Chain of all terminal devices. */
diff --git a/src/terminal.c b/src/terminal.c
index 1d7a965dd26..0ee0121e35e 100644
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -264,8 +264,8 @@ get_named_terminal (const char *name)
264static struct terminal * 264static struct terminal *
265allocate_terminal (void) 265allocate_terminal (void)
266{ 266{
267 return ALLOCATE_ZEROED_PSEUDOVECTOR 267 return ALLOCATE_ZEROED_PSEUDOVECTOR (struct terminal, glyph_code_table,
268 (struct terminal, next_terminal, PVEC_TERMINAL); 268 PVEC_TERMINAL);
269} 269}
270 270
271/* Create a new terminal object of TYPE and add it to the terminal list. RIF 271/* Create a new terminal object of TYPE and add it to the terminal list. RIF
diff --git a/src/thread.c b/src/thread.c
index e51d6144347..670680f2b0d 100644
--- a/src/thread.c
+++ b/src/thread.c
@@ -267,7 +267,7 @@ informational only. */)
267 if (!NILP (name)) 267 if (!NILP (name))
268 CHECK_STRING (name); 268 CHECK_STRING (name);
269 269
270 mutex = ALLOCATE_PSEUDOVECTOR (struct Lisp_Mutex, mutex, PVEC_MUTEX); 270 mutex = ALLOCATE_PSEUDOVECTOR (struct Lisp_Mutex, name, PVEC_MUTEX);
271 memset ((char *) mutex + offsetof (struct Lisp_Mutex, mutex), 271 memset ((char *) mutex + offsetof (struct Lisp_Mutex, mutex),
272 0, sizeof (struct Lisp_Mutex) - offsetof (struct Lisp_Mutex, 272 0, sizeof (struct Lisp_Mutex) - offsetof (struct Lisp_Mutex,
273 mutex)); 273 mutex));
@@ -386,7 +386,7 @@ informational only. */)
386 if (!NILP (name)) 386 if (!NILP (name))
387 CHECK_STRING (name); 387 CHECK_STRING (name);
388 388
389 condvar = ALLOCATE_PSEUDOVECTOR (struct Lisp_CondVar, cond, PVEC_CONDVAR); 389 condvar = ALLOCATE_PSEUDOVECTOR (struct Lisp_CondVar, name, PVEC_CONDVAR);
390 memset ((char *) condvar + offsetof (struct Lisp_CondVar, cond), 390 memset ((char *) condvar + offsetof (struct Lisp_CondVar, cond),
391 0, sizeof (struct Lisp_CondVar) - offsetof (struct Lisp_CondVar, 391 0, sizeof (struct Lisp_CondVar) - offsetof (struct Lisp_CondVar,
392 cond)); 392 cond));
@@ -805,7 +805,7 @@ If NAME is given, it must be a string; it names the new thread. */)
805 if (!NILP (name)) 805 if (!NILP (name))
806 CHECK_STRING (name); 806 CHECK_STRING (name);
807 807
808 new_thread = ALLOCATE_PSEUDOVECTOR (struct thread_state, m_stack_bottom, 808 new_thread = ALLOCATE_PSEUDOVECTOR (struct thread_state, event_object,
809 PVEC_THREAD); 809 PVEC_THREAD);
810 memset ((char *) new_thread + offset, 0, 810 memset ((char *) new_thread + offset, 0,
811 sizeof (struct thread_state) - offset); 811 sizeof (struct thread_state) - offset);
@@ -1064,7 +1064,7 @@ static void
1064init_main_thread (void) 1064init_main_thread (void)
1065{ 1065{
1066 main_thread.s.header.size 1066 main_thread.s.header.size
1067 = PSEUDOVECSIZE (struct thread_state, m_stack_bottom); 1067 = PSEUDOVECSIZE (struct thread_state, event_object);
1068 XSETPVECTYPE (&main_thread.s, PVEC_THREAD); 1068 XSETPVECTYPE (&main_thread.s, PVEC_THREAD);
1069 main_thread.s.m_last_thing_searched = Qnil; 1069 main_thread.s.m_last_thing_searched = Qnil;
1070 main_thread.s.m_saved_last_thing_searched = Qnil; 1070 main_thread.s.m_saved_last_thing_searched = Qnil;
diff --git a/src/thread.h b/src/thread.h
index 50f8f5cbe0a..0514669a87d 100644
--- a/src/thread.h
+++ b/src/thread.h
@@ -61,8 +61,8 @@ struct thread_state
61 /* If we are waiting for some event, this holds the object we are 61 /* If we are waiting for some event, this holds the object we are
62 waiting on. */ 62 waiting on. */
63 Lisp_Object event_object; 63 Lisp_Object event_object;
64 /* event_object must be the last Lisp field. */
64 65
65 /* m_stack_bottom must be the first non-Lisp field. */
66 /* An address near the bottom of the stack. 66 /* An address near the bottom of the stack.
67 Tells GC how to save a copy of the stack. */ 67 Tells GC how to save a copy of the stack. */
68 char const *m_stack_bottom; 68 char const *m_stack_bottom;
diff --git a/src/w32fns.c b/src/w32fns.c
index 25900c54c88..af82b463059 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -10099,6 +10099,8 @@ It can also be nil, which means try `HKCU', and if that fails, try `HKLM'.
10099 10099
10100KEY and NAME must be strings, and NAME must not include slashes. 10100KEY and NAME must be strings, and NAME must not include slashes.
10101KEY can use either forward- or back-slashes. 10101KEY can use either forward- or back-slashes.
10102To access the default value of KEY (if it is defined), use NAME
10103that is an empty string.
10102 10104
10103If the the named KEY or its subkey called NAME don't exist, or cannot 10105If the the named KEY or its subkey called NAME don't exist, or cannot
10104be accessed by the current user, the function returns nil. Otherwise, 10106be accessed by the current user, the function returns nil. Otherwise,
diff --git a/src/w32term.c b/src/w32term.c
index 7dbeda7a716..bb1f0bad018 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -3896,7 +3896,7 @@ x_scroll_bar_create (struct window *w, int left, int top, int width, int height,
3896 HWND hwnd; 3896 HWND hwnd;
3897 SCROLLINFO si; 3897 SCROLLINFO si;
3898 struct scroll_bar *bar 3898 struct scroll_bar *bar
3899 = ALLOCATE_PSEUDOVECTOR (struct scroll_bar, top, PVEC_OTHER); 3899 = ALLOCATE_PSEUDOVECTOR (struct scroll_bar, w32_widget_high, PVEC_OTHER);
3900 Lisp_Object barobj; 3900 Lisp_Object barobj;
3901 3901
3902 block_input (); 3902 block_input ();
diff --git a/src/widget.c b/src/widget.c
index c695bd5f305..508974dd46f 100644
--- a/src/widget.c
+++ b/src/widget.c
@@ -297,7 +297,6 @@ update_wm_hints (EmacsFrame ew)
297 int char_height; 297 int char_height;
298 int base_width; 298 int base_width;
299 int base_height; 299 int base_height;
300 int min_rows = 0, min_cols = 0;
301 300
302 /* This happens when the frame is just created. */ 301 /* This happens when the frame is just created. */
303 if (! wmshell) return; 302 if (! wmshell) return;
@@ -323,8 +322,8 @@ update_wm_hints (EmacsFrame ew)
323 XtNbaseHeight, (XtArgVal) base_height, 322 XtNbaseHeight, (XtArgVal) base_height,
324 XtNwidthInc, (XtArgVal) (frame_resize_pixelwise ? 1 : cw), 323 XtNwidthInc, (XtArgVal) (frame_resize_pixelwise ? 1 : cw),
325 XtNheightInc, (XtArgVal) (frame_resize_pixelwise ? 1 : ch), 324 XtNheightInc, (XtArgVal) (frame_resize_pixelwise ? 1 : ch),
326 XtNminWidth, (XtArgVal) (base_width + min_cols * cw), 325 XtNminWidth, (XtArgVal) base_width,
327 XtNminHeight, (XtArgVal) (base_height + min_rows * ch), 326 XtNminHeight, (XtArgVal) base_height,
328 NULL); 327 NULL);
329} 328}
330 329
diff --git a/src/window.c b/src/window.c
index be338c2af61..ef2ed638508 100644
--- a/src/window.c
+++ b/src/window.c
@@ -1796,7 +1796,12 @@ DEFUN ("set-window-start", Fset_window_start, Sset_window_start, 2, 3, 0,
1796 doc: /* Make display in WINDOW start at position POS in WINDOW's buffer. 1796 doc: /* Make display in WINDOW start at position POS in WINDOW's buffer.
1797WINDOW must be a live window and defaults to the selected one. Return 1797WINDOW must be a live window and defaults to the selected one. Return
1798POS. Optional third arg NOFORCE non-nil inhibits next redisplay from 1798POS. Optional third arg NOFORCE non-nil inhibits next redisplay from
1799overriding motion of point in order to display at this exact start. */) 1799overriding motion of point in order to display at this exact start.
1800
1801For reliable setting of WINDOW start position, make sure point is
1802at a position that will be visible when that start is in effect,
1803otherwise there's a chance POS will be disregarded, e.g., if point
1804winds up in a partially-visible line. */)
1800 (Lisp_Object window, Lisp_Object pos, Lisp_Object noforce) 1805 (Lisp_Object window, Lisp_Object pos, Lisp_Object noforce)
1801{ 1806{
1802 register struct window *w = decode_live_window (window); 1807 register struct window *w = decode_live_window (window);
@@ -4170,8 +4175,8 @@ temp_output_buffer_show (register Lisp_Object buf)
4170static struct window * 4175static struct window *
4171allocate_window (void) 4176allocate_window (void)
4172{ 4177{
4173 return ALLOCATE_ZEROED_PSEUDOVECTOR 4178 return ALLOCATE_ZEROED_PSEUDOVECTOR (struct window, mode_line_help_echo,
4174 (struct window, current_matrix, PVEC_WINDOW); 4179 PVEC_WINDOW);
4175} 4180}
4176 4181
4177/* Make new window, have it replace WINDOW in window-tree, and make 4182/* Make new window, have it replace WINDOW in window-tree, and make
@@ -6710,7 +6715,8 @@ struct save_window_data
6710 Lisp_Object saved_windows; 6715 Lisp_Object saved_windows;
6711 6716
6712 /* All fields above are traced by the GC. 6717 /* All fields above are traced by the GC.
6713 From `frame-cols' down, the fields are ignored by the GC. */ 6718 After saved_windows, the fields are ignored by the GC. */
6719
6714 /* We should be able to do without the following two. */ 6720 /* We should be able to do without the following two. */
6715 int frame_cols, frame_lines; 6721 int frame_cols, frame_lines;
6716 /* These two should get eventually replaced by their pixel 6722 /* These two should get eventually replaced by their pixel
@@ -7383,15 +7389,11 @@ redirection (see `redirect-frame-focus'). The variable
7383saved by this function. */) 7389saved by this function. */)
7384 (Lisp_Object frame) 7390 (Lisp_Object frame)
7385{ 7391{
7386 Lisp_Object tem;
7387 ptrdiff_t i, n_windows;
7388 struct save_window_data *data;
7389 struct frame *f = decode_live_frame (frame); 7392 struct frame *f = decode_live_frame (frame);
7390 7393 ptrdiff_t n_windows = count_windows (XWINDOW (FRAME_ROOT_WINDOW (f)));
7391 n_windows = count_windows (XWINDOW (FRAME_ROOT_WINDOW (f))); 7394 struct save_window_data *data
7392 data = ALLOCATE_PSEUDOVECTOR (struct save_window_data, frame_cols, 7395 = ALLOCATE_PSEUDOVECTOR (struct save_window_data, saved_windows,
7393 PVEC_WINDOW_CONFIGURATION); 7396 PVEC_WINDOW_CONFIGURATION);
7394
7395 data->frame_cols = FRAME_COLS (f); 7397 data->frame_cols = FRAME_COLS (f);
7396 data->frame_lines = FRAME_LINES (f); 7398 data->frame_lines = FRAME_LINES (f);
7397 data->frame_menu_bar_lines = FRAME_MENU_BAR_LINES (f); 7399 data->frame_menu_bar_lines = FRAME_MENU_BAR_LINES (f);
@@ -7407,9 +7409,9 @@ saved by this function. */)
7407 data->minibuf_selected_window = minibuf_level > 0 ? minibuf_selected_window : Qnil; 7409 data->minibuf_selected_window = minibuf_level > 0 ? minibuf_selected_window : Qnil;
7408 data->root_window = FRAME_ROOT_WINDOW (f); 7410 data->root_window = FRAME_ROOT_WINDOW (f);
7409 data->focus_frame = FRAME_FOCUS_FRAME (f); 7411 data->focus_frame = FRAME_FOCUS_FRAME (f);
7410 tem = make_uninit_vector (n_windows); 7412 Lisp_Object tem = make_uninit_vector (n_windows);
7411 data->saved_windows = tem; 7413 data->saved_windows = tem;
7412 for (i = 0; i < n_windows; i++) 7414 for (ptrdiff_t i = 0; i < n_windows; i++)
7413 ASET (tem, i, make_nil_vector (VECSIZE (struct saved_window))); 7415 ASET (tem, i, make_nil_vector (VECSIZE (struct saved_window)));
7414 save_window_save (FRAME_ROOT_WINDOW (f), XVECTOR (tem), 0); 7416 save_window_save (FRAME_ROOT_WINDOW (f), XVECTOR (tem), 0);
7415 XSETWINDOW_CONFIGURATION (tem, data); 7417 XSETWINDOW_CONFIGURATION (tem, data);
diff --git a/src/window.h b/src/window.h
index 4235a6eade2..fdef407041b 100644
--- a/src/window.h
+++ b/src/window.h
@@ -212,9 +212,8 @@ struct window
212 /* The help echo text for this window. Qnil if there's none. */ 212 /* The help echo text for this window. Qnil if there's none. */
213 Lisp_Object mode_line_help_echo; 213 Lisp_Object mode_line_help_echo;
214 214
215 /* No Lisp data may follow below this point without changing 215 /* No Lisp data may follow this point; mode_line_help_echo must be
216 mark_object in alloc.c. The member current_matrix must be the 216 the last Lisp member. */
217 first non-Lisp member. */
218 217
219 /* Glyph matrices. */ 218 /* Glyph matrices. */
220 struct glyph_matrix *current_matrix; 219 struct glyph_matrix *current_matrix;
diff --git a/src/xfns.c b/src/xfns.c
index f238a3daa15..13f66f07183 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -5030,7 +5030,7 @@ Internal use only, use `display-monitor-attributes-list' instead. */)
5030 mi->mm_height = height_mm; 5030 mi->mm_height = height_mm;
5031 5031
5032#if GTK_CHECK_VERSION (3, 22, 0) 5032#if GTK_CHECK_VERSION (3, 22, 0)
5033 mi->name = g_strdup (gdk_monitor_get_model (monitor)); 5033 mi->name = xstrdup (gdk_monitor_get_model (monitor));
5034#elif GTK_CHECK_VERSION (2, 14, 0) 5034#elif GTK_CHECK_VERSION (2, 14, 0)
5035 mi->name = gdk_screen_get_monitor_plug_name (gscreen, i); 5035 mi->name = gdk_screen_get_monitor_plug_name (gscreen, i);
5036#endif 5036#endif
@@ -5041,6 +5041,11 @@ Internal use only, use `display-monitor-attributes-list' instead. */)
5041 primary_monitor, 5041 primary_monitor,
5042 monitor_frames, 5042 monitor_frames,
5043 source); 5043 source);
5044#if GTK_CHECK_VERSION (2, 14, 0)
5045 free_monitors (monitors, n_monitors);
5046#else
5047 xfree (monitors);
5048#endif
5044 unblock_input (); 5049 unblock_input ();
5045#else /* not USE_GTK */ 5050#else /* not USE_GTK */
5046 5051
diff --git a/src/xsettings.c b/src/xsettings.c
index 0c5e36d9d69..947d5cfb7b6 100644
--- a/src/xsettings.c
+++ b/src/xsettings.c
@@ -393,8 +393,8 @@ parse_settings (unsigned char *prop,
393 unsigned long bytes, 393 unsigned long bytes,
394 struct xsettings *settings) 394 struct xsettings *settings)
395{ 395{
396 Lisp_Object byteorder = Fbyteorder (); 396 int int1 = 1;
397 int my_bo = XFIXNAT (byteorder) == 'B' ? MSBFirst : LSBFirst; 397 int my_bo = *(char *) &int1 == 1 ? LSBFirst : MSBFirst;
398 int that_bo = prop[0]; 398 int that_bo = prop[0];
399 CARD32 n_settings; 399 CARD32 n_settings;
400 int bytes_parsed = 0; 400 int bytes_parsed = 0;
diff --git a/src/xterm.c b/src/xterm.c
index 2f830afe61b..5aa3e3ff25c 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -6611,8 +6611,8 @@ x_scroll_bar_create (struct window *w, int top, int left,
6611 int width, int height, bool horizontal) 6611 int width, int height, bool horizontal)
6612{ 6612{
6613 struct frame *f = XFRAME (w->frame); 6613 struct frame *f = XFRAME (w->frame);
6614 struct scroll_bar *bar 6614 struct scroll_bar *bar = ALLOCATE_PSEUDOVECTOR (struct scroll_bar, prev,
6615 = ALLOCATE_PSEUDOVECTOR (struct scroll_bar, x_window, PVEC_OTHER); 6615 PVEC_OTHER);
6616 Lisp_Object barobj; 6616 Lisp_Object barobj;
6617 6617
6618 block_input (); 6618 block_input ();
diff --git a/src/xterm.h b/src/xterm.h
index 972a10f4d41..c5ad38650c2 100644
--- a/src/xterm.h
+++ b/src/xterm.h
@@ -897,7 +897,7 @@ struct scroll_bar
897 /* The next and previous in the chain of scroll bars in this frame. */ 897 /* The next and previous in the chain of scroll bars in this frame. */
898 Lisp_Object next, prev; 898 Lisp_Object next, prev;
899 899
900 /* Fields from `x_window' down will not be traced by the GC. */ 900 /* Fields after 'prev' are not traced by the GC. */
901 901
902 /* The X window representing this scroll bar. */ 902 /* The X window representing this scroll bar. */
903 Window x_window; 903 Window x_window;
diff --git a/src/xwidget.c b/src/xwidget.c
index c56284928e3..2486a2d4da8 100644
--- a/src/xwidget.c
+++ b/src/xwidget.c
@@ -41,14 +41,13 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
41static struct xwidget * 41static struct xwidget *
42allocate_xwidget (void) 42allocate_xwidget (void)
43{ 43{
44 return ALLOCATE_PSEUDOVECTOR (struct xwidget, height, PVEC_XWIDGET); 44 return ALLOCATE_PSEUDOVECTOR (struct xwidget, script_callbacks, PVEC_XWIDGET);
45} 45}
46 46
47static struct xwidget_view * 47static struct xwidget_view *
48allocate_xwidget_view (void) 48allocate_xwidget_view (void)
49{ 49{
50 return ALLOCATE_PSEUDOVECTOR (struct xwidget_view, redisplayed, 50 return ALLOCATE_PSEUDOVECTOR (struct xwidget_view, w, PVEC_XWIDGET_VIEW);
51 PVEC_XWIDGET_VIEW);
52} 51}
53 52
54#define XSETXWIDGET(a, b) XSETPSEUDOVECTOR (a, b, PVEC_XWIDGET) 53#define XSETXWIDGET(a, b) XSETPSEUDOVECTOR (a, b, PVEC_XWIDGET)
diff --git a/src/xwidget.h b/src/xwidget.h
index 8c598efb2e2..1b6368daabf 100644
--- a/src/xwidget.h
+++ b/src/xwidget.h
@@ -49,8 +49,7 @@ struct xwidget
49 49
50 /* Vector of currently executing scripts with callbacks. */ 50 /* Vector of currently executing scripts with callbacks. */
51 Lisp_Object script_callbacks; 51 Lisp_Object script_callbacks;
52 52 /* Here ends the Lisp part. script_callbacks is the marker field. */
53 /* Here ends the Lisp part. "height" is the marker field. */
54 53
55 int height; 54 int height;
56 int width; 55 int width;
@@ -68,8 +67,7 @@ struct xwidget_view
68 union vectorlike_header header; 67 union vectorlike_header header;
69 Lisp_Object model; 68 Lisp_Object model;
70 Lisp_Object w; 69 Lisp_Object w;
71 70 /* Here ends the lisp part. "w" is the marker field. */
72 /* Here ends the lisp part. "redisplayed" is the marker field. */
73 71
74 /* If touched by redisplay. */ 72 /* If touched by redisplay. */
75 bool redisplayed; 73 bool redisplayed;