emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

scratch/pure-overflow-warn def6d57669 2/2: * src/alloc.c (pure_alloc): W


From: Andrea Corallo
Subject: scratch/pure-overflow-warn def6d57669 2/2: * src/alloc.c (pure_alloc): Warn for pure space overflow
Date: Thu, 18 Aug 2022 15:32:13 -0400 (EDT)

branch: scratch/pure-overflow-warn
commit def6d57669cac76ba35595ff5266d6c85a227eee
Author: Andrea Corallo <akrl@sdf.org>
Commit: Andrea Corallo <akrl@sdf.org>

    * src/alloc.c (pure_alloc): Warn for pure space overflow
---
 src/alloc.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/alloc.c b/src/alloc.c
index 2ffee9f729..34bedac36b 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -5314,6 +5314,7 @@ static void *
 pure_alloc (size_t size, int type)
 {
   void *result;
+  static bool pure_overflow_warned = false;
 
  again:
   if (type >= 0)
@@ -5338,6 +5339,12 @@ pure_alloc (size_t size, int type)
   if (pure_bytes_used <= pure_size)
     return result;
 
+  if (!pure_overflow_warned)
+    {
+      message ("Pure Lisp storage overflowed");
+      pure_overflow_warned = true;
+    }
+
   /* Don't allocate a large amount here,
      because it might get mmap'd and then its address
      might not be usable.  */



reply via email to

[Prev in Thread] Current Thread [Next in Thread]