* src/alloc.c (pure_alloc): Warn for pure space overflow

This commit is contained in:
Andrea Corallo 2022-08-18 16:41:26 +02:00
parent a7abd8f235
commit def6d57669

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. */