all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Mattias Engdegård" <mattiase@acm.org>
To: Lynn Winebarger <owinebar@gmail.com>
Cc: 55972@debbugs.gnu.org, Stefan Monnier <monnier@iro.umontreal.ca>
Subject: bug#55972: 28.1; Package quickstart generated for large number of packages generates byte-code string larger than 64K, triggering bytecode overflow error
Date: Tue, 14 Jun 2022 18:29:32 +0200	[thread overview]
Message-ID: <1058D1B4-9A9F-41D9-BE59-55BFA2A69A10@acm.org> (raw)
In-Reply-To: <CAM=F=bAb=d=J_-E-B+PfrjnzUKmaA4kGdTUOWnx=H_RDSS+N+w@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 318 bytes --]

If, as seems to be the case, byte-compile-keep-pending is only used for top-level forms, then this patch may even be correct. Does it solve your problems?
It still seems to generate far bigger bytecode chunks than the 300 cutoff would imply but that's perhaps just a matter of calling the function in more places.


[-- Attachment #2: bytecomp-flush-big.diff --]
[-- Type: application/octet-stream, Size: 924 bytes --]

diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index ab21fba8a2..156a38ec2d 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -2521,13 +2521,12 @@ byte-compile-output-docform
 (defun byte-compile-keep-pending (form &optional handler)
   (if (memq byte-optimize '(t source))
       (setq form (byte-optimize-one-form form t)))
+  ;; To avoid consing up monstrously large forms at load time, we split
+  ;; the output regularly.
+  (when (nthcdr 300 byte-compile-output)
+    (byte-compile-flush-pending))
   (if handler
       (let ((byte-compile--for-effect t))
-	;; To avoid consing up monstrously large forms at load time, we split
-	;; the output regularly.
-	(and (memq (car-safe form) '(fset defalias))
-	     (nthcdr 300 byte-compile-output)
-	     (byte-compile-flush-pending))
 	(funcall handler form)
 	(if byte-compile--for-effect
 	    (byte-compile-discard)))

  reply	other threads:[~2022-06-14 16:29 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-14 14:51 bug#55972: 28.1; Package quickstart generated for large number of packages generates byte-code string larger than 64K, triggering bytecode overflow error Lynn Winebarger
2022-06-14 16:29 ` Mattias Engdegård [this message]
2022-06-15  9:31   ` Mattias Engdegård
2022-06-17 20:06   ` Lynn Winebarger
2022-06-17 21:27     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-06-18 10:45       ` Mattias Engdegård
2022-06-18 12:59         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-06-18 13:53           ` Mattias Engdegård
2022-06-18 14:53             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-13  1:37               ` Stefan Kangas
2023-09-13 14:52                 ` Jonas Bernoulli via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-13 14:58                   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1058D1B4-9A9F-41D9-BE59-55BFA2A69A10@acm.org \
    --to=mattiase@acm.org \
    --cc=55972@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=owinebar@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.