diff options
| author | Stephen Leake | 2019-04-11 14:00:02 -0700 |
|---|---|---|
| committer | Stephen Leake | 2019-04-11 14:00:02 -0700 |
| commit | 7ba7def5caf7ec9d9bebffff489f0a658229fbda (patch) | |
| tree | e0cfcb59937ca0528fb81769d7d48a904a91f5dc /src | |
| parent | 7768581172e11be52b1fcd8224f4594e126bbdb7 (diff) | |
| parent | de238b39e335c6814283faa171b35145f124edf2 (diff) | |
| download | emacs-7ba7def5caf7ec9d9bebffff489f0a658229fbda.tar.gz emacs-7ba7def5caf7ec9d9bebffff489f0a658229fbda.zip | |
Merge commit 'de238b39e335c6814283faa171b35145f124edf2'
Diffstat (limited to 'src')
| -rw-r--r-- | src/Makefile.in | 54 | ||||
| -rw-r--r-- | src/alloc.c | 20 | ||||
| -rw-r--r-- | src/bignum.c | 8 | ||||
| -rw-r--r-- | src/buffer.c | 8 | ||||
| -rw-r--r-- | src/buffer.h | 14 | ||||
| -rw-r--r-- | src/composite.c | 25 | ||||
| -rw-r--r--[-rwxr-xr-x] | src/dmpstruct.awk | 0 | ||||
| -rw-r--r-- | src/editfns.c | 5 | ||||
| -rw-r--r-- | src/emacs-module.c | 2 | ||||
| -rw-r--r-- | src/filelock.c | 1 | ||||
| -rw-r--r-- | src/fingerprint-dummy.c | 23 | ||||
| -rw-r--r-- | src/fingerprint.h | 4 | ||||
| -rw-r--r-- | src/fns.c | 2 | ||||
| -rw-r--r-- | src/fontset.c | 2 | ||||
| -rw-r--r-- | src/frame.c | 7 | ||||
| -rw-r--r-- | src/frame.h | 7 | ||||
| -rw-r--r-- | src/gtkutil.c | 8 | ||||
| -rw-r--r-- | src/lisp.h | 24 | ||||
| -rw-r--r-- | src/pdumper.c | 123 | ||||
| -rw-r--r-- | src/process.c | 3 | ||||
| -rw-r--r-- | src/process.h | 4 | ||||
| -rw-r--r-- | src/termhooks.h | 2 | ||||
| -rw-r--r-- | src/terminal.c | 4 | ||||
| -rw-r--r-- | src/thread.c | 8 | ||||
| -rw-r--r-- | src/thread.h | 2 | ||||
| -rw-r--r-- | src/w32fns.c | 2 | ||||
| -rw-r--r-- | src/w32term.c | 2 | ||||
| -rw-r--r-- | src/widget.c | 5 | ||||
| -rw-r--r-- | src/window.c | 30 | ||||
| -rw-r--r-- | src/window.h | 5 | ||||
| -rw-r--r-- | src/xfns.c | 7 | ||||
| -rw-r--r-- | src/xsettings.c | 4 | ||||
| -rw-r--r-- | src/xterm.c | 4 | ||||
| -rw-r--r-- | src/xterm.h | 2 | ||||
| -rw-r--r-- | src/xwidget.c | 5 | ||||
| -rw-r--r-- | src/xwidget.h | 6 |
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@ | |||
| 331 | UNEXEC_OBJ = @UNEXEC_OBJ@ | 331 | UNEXEC_OBJ = @UNEXEC_OBJ@ |
| 332 | 332 | ||
| 333 | DUMPING=@DUMPING@ | 333 | DUMPING=@DUMPING@ |
| 334 | CHECK_STRUCTS = @CHECK_STRUCTS@ | ||
| 334 | 335 | ||
| 335 | # 'make' verbosity. | 336 | # 'make' verbosity. |
| 336 | AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ | 337 | AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ |
| @@ -458,7 +459,9 @@ all: emacs$(EXEEXT) $(pdmp) $(OTHER_FILES) | |||
| 458 | 459 | ||
| 459 | dmpstruct_headers=$(srcdir)/lisp.h $(srcdir)/buffer.h \ | 460 | dmpstruct_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 |
| 462 | ifeq ($(CHECK_STRUCTS),true) | ||
| 461 | pdumper.o: dmpstruct.h | 463 | pdumper.o: dmpstruct.h |
| 464 | endif | ||
| 462 | dmpstruct.h: $(srcdir)/dmpstruct.awk | 465 | dmpstruct.h: $(srcdir)/dmpstruct.awk |
| 463 | dmpstruct.h: $(libsrc)/make-fingerprint$(EXEEXT) $(dmpstruct_headers) | 466 | dmpstruct.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 | ||
| 542 | charsets = ${top_srcdir}/admin/charsets/charsets.stamp | 545 | charsets = ${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 | ||
| 546 | charscript = ${lispintdir}/charscript.el | 549 | charscript = ${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 | ||
| 598 | buildobj.h: Makefile | 602 | buildobj.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 | |||
| 621 | LIBEGNU_ARCHIVE = $(lib)/lib$(if $(HYBRID_MALLOC),e)gnu.a | 625 | LIBEGNU_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 | |||
| 626 | EMACS_DEPS_PRE=$(LIBXMENU) $(ALLOBJS) | ||
| 627 | EMACS_DEPS_POST=$(LIBEGNU_ARCHIVE) $(EMACSRES) ${charsets} ${charscript} | ||
| 628 | BUILD_EMACS_PRE=$(AM_V_CCLD)$(CC) $(ALL_CFLAGS) $(TEMACS_LDFLAGS) $(LDFLAGS) \ | ||
| 629 | -o $@ $(ALLOBJS) | ||
| 630 | BUILD_EMACS_POST=$(LIBEGNU_ARCHIVE) $(W32_RES_LINK) $(LIBES) | ||
| 631 | |||
| 632 | ## We hash this file to generate the build fingerprint | ||
| 633 | temacs.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 | 630 | FINGERPRINTED = $(LIBXMENU) $(ALLOBJS) $(LIBEGNU_ARCHIVE) $(EMACSRES) |
| 637 | $(MAKE) -C $(libsrc) make-fingerprint$(EXEEXT) | 631 | fingerprint.c: $(FINGERPRINTED) $(libsrc)/make-fingerprint$(EXEEXT) |
| 638 | 632 | $(AM_V_GEN)$(libsrc)/make-fingerprint$(EXEEXT) $(FINGERPRINTED) >$@.tmp | |
| 639 | fingerprint.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. |
| 646 | temacs$(EXEEXT): $(EMACS_DEPS_PRE) fingerprint.o $(EMACS_DEPS_POST) | 639 | temacs$(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) |
| 649 | ifeq ($(DUMPING),unexec) | 644 | ifeq ($(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 $@) |
| 661 | FORCE: | 656 | FORCE: |
| 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 $@) |
| 667 | Makefile: ../config.status $(srcdir)/Makefile.in | 662 | Makefile: ../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 | ||
| 682 | mostlyclean: | 677 | mostlyclean: |
| 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 | |||
| 719 | ETAGS = ../lib-src/etags${EXEEXT} | 714 | ETAGS = ../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 | ||
| 753 | tags: TAGS ../lisp/TAGS $(lwlibdir)/TAGS | 745 | tags: 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. */) | |||
| 3718 | Lisp_Object | 3718 | Lisp_Object |
| 3719 | make_misc_ptr (void *a) | 3719 | make_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) | |||
| 3729 | Lisp_Object | 3729 | Lisp_Object |
| 3730 | build_overlay (Lisp_Object start, Lisp_Object end, Lisp_Object plist) | 3730 | build_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) | |||
| 3821 | Lisp_Object | 3821 | Lisp_Object |
| 3822 | make_user_ptr (void (*finalizer) (void *), void *p) | 3822 | make_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) | |||
| 342 | Lisp_Object | 342 | Lisp_Object |
| 343 | make_bignum_str (char const *num, int base) | 343 | make_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; | |||
| 787 | static Lisp_Object gstring_work_headers; | 787 | static Lisp_Object gstring_work_headers; |
| 788 | 788 | ||
| 789 | static Lisp_Object | 789 | static Lisp_Object |
| 790 | fill_gstring_header (Lisp_Object header, ptrdiff_t from, ptrdiff_t from_byte, | 790 | fill_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 | |||
| 2686 | text is included in the file. \\[widen] makes all visible again. | 2686 | text is included in the file. \\[widen] makes all visible again. |
| 2687 | See also `save-restriction'. | 2687 | See also `save-restriction'. |
| 2688 | 2688 | ||
| 2689 | When calling from a program, pass two arguments; positions (integers | 2689 | When calling from Lisp, pass two arguments START and END: |
| 2690 | or markers) bounding the text that should remain visible. */) | 2690 | positions (integers or markers) bounding the text that should |
| 2691 | remain 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 * | |||
| 427 | allocate_module_function (void) | 427 | allocate_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 | |||
| 3 | Copyright (C) 2016, 2018-2019 Free Software Foundation, Inc. | ||
| 4 | |||
| 5 | This file is part of GNU Emacs. | ||
| 6 | |||
| 7 | GNU Emacs is free software: you can redistribute it and/or modify | ||
| 8 | it under the terms of the GNU General Public License as published by | ||
| 9 | the Free Software Foundation, either version 3 of the License, or (at | ||
| 10 | your option) any later version. | ||
| 11 | |||
| 12 | GNU Emacs is distributed in the hope that it will be useful, | ||
| 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | GNU General Public License for more details. | ||
| 16 | |||
| 17 | You should have received a copy of the GNU General Public License | ||
| 18 | along 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. */ | ||
| 23 | const 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. */ |
| 29 | extern const uint8_t fingerprint[32]; | 27 | extern unsigned char const fingerprint[32]; |
| 30 | 28 | ||
| 31 | #endif | 29 | #endif |
| @@ -3904,7 +3904,7 @@ static struct Lisp_Hash_Table * | |||
| 3904 | allocate_hash_table (void) | 3904 | allocate_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 | ||
| 1445 | TARGET may be a single character to use FONT-SPEC for. | 1445 | TARGET may be a single character to use FONT-SPEC for. |
| 1446 | 1446 | ||
| 1447 | Target may be a cons (FROM . TO), where FROM and TO are characters. | 1447 | TARGET may be a cons (FROM . TO), where FROM and TO are characters. |
| 1448 | In that case, use FONT-SPEC for all the characters in the range | 1448 | In that case, use FONT-SPEC for all the characters in the range |
| 1449 | between FROM and TO (inclusive). | 1449 | between 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, | |||
| 798 | static struct frame * | 798 | static struct frame * |
| 799 | allocate_frame (void) | 799 | allocate_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 | ||
| 804 | struct frame * | 805 | struct 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) |
| 5667 | void | 5668 | void |
| 5668 | free_monitors (struct MonitorInfo *monitors, int n_monitors) | 5669 | free_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) | |||
| 3940 | extern struct Lisp_Vector *allocate_pseudovector (int, int, int, | 3943 | extern 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)); | |||
| 135 | verify (sizeof (void (*)(void)) == sizeof (void *)); | 127 | verify (sizeof (void (*)(void)) == sizeof (void *)); |
| 136 | verify (sizeof (ptrdiff_t) <= sizeof (Lisp_Object)); | 128 | verify (sizeof (ptrdiff_t) <= sizeof (Lisp_Object)); |
| 137 | verify (sizeof (ptrdiff_t) <= sizeof (EMACS_INT)); | 129 | verify (sizeof (ptrdiff_t) <= sizeof (EMACS_INT)); |
| 138 | verify (sizeof (off_t) == sizeof (int32_t) | ||
| 139 | || sizeof (off_t) == sizeof (int64_t)); | ||
| 140 | verify (CHAR_BIT == 8); | 130 | verify (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]; |
| 158 | static int nr_remembered_data = 0; | 148 | static int nr_remembered_data = 0; |
| 159 | 149 | ||
| 160 | typedef int32_t dump_off; | 150 | typedef 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))) |
| 165 | static void | 155 | static void |
| @@ -302,10 +292,10 @@ verify (DUMP_ALIGNMENT >= GCALIGNMENT); | |||
| 302 | 292 | ||
| 303 | struct dump_reloc | 293 | struct 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 | }; |
| 308 | verify (sizeof (struct dump_reloc) == sizeof (int32_t)); | 298 | verify (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 | ||
| 337 | static void | 327 | static void |
| 338 | dump_fingerprint (const char *label, const uint8_t *xfingerprint) | 328 | dump_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 | |||
| 1780 | static dump_off | 1772 | static dump_off |
| 1781 | field_relpos (const void *in_start, const void *in_field) | 1773 | field_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, | |||
| 2760 | static dump_off | 2760 | static dump_off |
| 2761 | dump_buffer (struct dump_context *ctx, const struct buffer *in_buffer) | 2761 | dump_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 | ||
| 4312 | static void * | 4313 | static void * |
| 4313 | dump_anonymous_allocate_w32 (void *base, | 4314 | dump_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 | ||
| 4360 | static void * | 4357 | static void * |
| 4361 | dump_anonymous_allocate_posix (void *base, | 4358 | dump_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. */ |
| 4419 | static void * | 4410 | static 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 | ||
| 4453 | static void * | 4445 | static void * |
| 4454 | dump_map_file_w32 (void *base, int fd, off_t offset, size_t size, | 4446 | dump_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 | ||
| 4522 | static void * | 4507 | static void * |
| 4523 | dump_map_file_posix (void *base, int fd, off_t offset, size_t size, | 4508 | dump_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. */ |
| 4567 | static void * | 4544 | static void * |
| 4568 | dump_map_file (void *base, int fd, off_t offset, size_t size, | 4545 | dump_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]) | |||
| 858 | static struct Lisp_Process * | 858 | static struct Lisp_Process * |
| 859 | allocate_process (void) | 859 | allocate_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 | ||
| 864 | static Lisp_Object | 865 | static 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) | |||
| 264 | static struct terminal * | 264 | static struct terminal * |
| 265 | allocate_terminal (void) | 265 | allocate_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 | |||
| 1064 | init_main_thread (void) | 1064 | init_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 | ||
| 10100 | KEY and NAME must be strings, and NAME must not include slashes. | 10100 | KEY and NAME must be strings, and NAME must not include slashes. |
| 10101 | KEY can use either forward- or back-slashes. | 10101 | KEY can use either forward- or back-slashes. |
| 10102 | To access the default value of KEY (if it is defined), use NAME | ||
| 10103 | that is an empty string. | ||
| 10102 | 10104 | ||
| 10103 | If the the named KEY or its subkey called NAME don't exist, or cannot | 10105 | If the the named KEY or its subkey called NAME don't exist, or cannot |
| 10104 | be accessed by the current user, the function returns nil. Otherwise, | 10106 | be 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. |
| 1797 | WINDOW must be a live window and defaults to the selected one. Return | 1797 | WINDOW must be a live window and defaults to the selected one. Return |
| 1798 | POS. Optional third arg NOFORCE non-nil inhibits next redisplay from | 1798 | POS. Optional third arg NOFORCE non-nil inhibits next redisplay from |
| 1799 | overriding motion of point in order to display at this exact start. */) | 1799 | overriding motion of point in order to display at this exact start. |
| 1800 | |||
| 1801 | For reliable setting of WINDOW start position, make sure point is | ||
| 1802 | at a position that will be visible when that start is in effect, | ||
| 1803 | otherwise there's a chance POS will be disregarded, e.g., if point | ||
| 1804 | winds 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) | |||
| 4170 | static struct window * | 4175 | static struct window * |
| 4171 | allocate_window (void) | 4176 | allocate_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 | |||
| 7383 | saved by this function. */) | 7389 | saved 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/>. */ | |||
| 41 | static struct xwidget * | 41 | static struct xwidget * |
| 42 | allocate_xwidget (void) | 42 | allocate_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 | ||
| 47 | static struct xwidget_view * | 47 | static struct xwidget_view * |
| 48 | allocate_xwidget_view (void) | 48 | allocate_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; |