diff options
| author | Andrea Corallo | 2022-08-18 16:41:26 +0200 |
|---|---|---|
| committer | Andrea Corallo | 2022-08-18 17:11:59 +0200 |
| commit | def6d57669cac76ba35595ff5266d6c85a227eee (patch) | |
| tree | b47fdf94765ec4b2d33ed664ca59131f60d5f1c7 | |
| parent | a7abd8f235cf25d7a8362ac1de3b6a16d25afe33 (diff) | |
| download | emacs-def6d57669cac76ba35595ff5266d6c85a227eee.tar.gz emacs-def6d57669cac76ba35595ff5266d6c85a227eee.zip | |
* src/alloc.c (pure_alloc): Warn for pure space overflowscratch/pure-overflow-warn
| -rw-r--r-- | src/alloc.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/alloc.c b/src/alloc.c index 2ffee9f729d..34bedac36ba 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -5314,6 +5314,7 @@ static void * | |||
| 5314 | pure_alloc (size_t size, int type) | 5314 | pure_alloc (size_t size, int type) |
| 5315 | { | 5315 | { |
| 5316 | void *result; | 5316 | void *result; |
| 5317 | static bool pure_overflow_warned = false; | ||
| 5317 | 5318 | ||
| 5318 | again: | 5319 | again: |
| 5319 | if (type >= 0) | 5320 | if (type >= 0) |
| @@ -5338,6 +5339,12 @@ pure_alloc (size_t size, int type) | |||
| 5338 | if (pure_bytes_used <= pure_size) | 5339 | if (pure_bytes_used <= pure_size) |
| 5339 | return result; | 5340 | return result; |
| 5340 | 5341 | ||
| 5342 | if (!pure_overflow_warned) | ||
| 5343 | { | ||
| 5344 | message ("Pure Lisp storage overflowed"); | ||
| 5345 | pure_overflow_warned = true; | ||
| 5346 | } | ||
| 5347 | |||
| 5341 | /* Don't allocate a large amount here, | 5348 | /* Don't allocate a large amount here, |
| 5342 | because it might get mmap'd and then its address | 5349 | because it might get mmap'd and then its address |
| 5343 | might not be usable. */ | 5350 | might not be usable. */ |