Compare commits

...

2 commits

Author SHA1 Message Date
Andrea Corallo
def6d57669 * src/alloc.c (pure_alloc): Warn for pure space overflow 2022-08-18 17:11:59 +02:00
Andrea Corallo
a7abd8f235 * src/pdumper.c (Fdump_emacs_portable): Check and warn for pure space overflow 2022-08-18 17:11:59 +02:00
2 changed files with 9 additions and 5 deletions

View file

@ -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. */
@ -5355,9 +5362,6 @@ pure_alloc (size_t size, int type)
goto again;
}
#ifdef HAVE_UNEXEC
/* Print a warning if PURESIZE is too small. */
void
@ -5368,8 +5372,6 @@ check_pure_size (void)
" bytes needed)"),
pure_bytes_used + pure_bytes_used_before_overflow);
}
#endif
/* Find the byte sequence {DATA[0], ..., DATA[NBYTES-1], '\0'} from
the non-Lisp data pool of the pure storage, and return its start

View file

@ -4040,6 +4040,8 @@ types. */)
if (!NILP (XCDR (Fall_threads ())))
error ("No other Lisp threads can be running when this function is called");
check_pure_size ();
/* Clear out any detritus in memory. */
do
{