diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2019-03-02 13:13:05 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2019-03-02 13:14:26 -0800 |
commit | 284f635da833d2dbf0102af3442197b46adf78c5 (patch) | |
tree | 0985ae494b56041500e13214074e4237ced04385 /src | |
parent | 5f99d515c921ee5546483ddab15e08f9b23280d9 (diff) | |
download | emacs-284f635da833d2dbf0102af3442197b46adf78c5.tar.gz |
memory_full_cons_threshold is a constant
* src/alloc.c (memory_full_cons_threshold): Now const.
(memory_full): Omit no-longer-needed initialization.
Diffstat (limited to 'src')
-rw-r--r-- | src/alloc.c | 12 | ||||
-rw-r--r-- | src/lisp.h | 2 |
2 files changed, 5 insertions, 9 deletions
diff --git a/src/alloc.c b/src/alloc.c index 452d31f9398..9b3dc4be993 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -234,7 +234,7 @@ byte_ct gc_relative_threshold; /* Minimum number of bytes of consing since GC before next GC, when memory is full. */ -byte_ct memory_full_cons_threshold; +byte_ct const memory_full_cons_threshold = sizeof (struct cons_block); #ifdef HAVE_PDUMPER /* Number of finalizers run: used to loop over GC until we stop @@ -4082,7 +4082,7 @@ void memory_full (size_t nbytes) { /* Do not go into hysterics merely because a large request failed. */ - bool enough_free_memory = 0; + bool enough_free_memory = false; if (SPARE_MEMORY < nbytes) { void *p; @@ -4092,21 +4092,17 @@ memory_full (size_t nbytes) if (p) { free (p); - enough_free_memory = 1; + enough_free_memory = true; } MALLOC_UNBLOCK_INPUT; } if (! enough_free_memory) { - int i; - Vmemory_full = Qt; - memory_full_cons_threshold = sizeof (struct cons_block); - /* The first time we get here, free the spare memory. */ - for (i = 0; i < ARRAYELTS (spare_memory); i++) + for (int i = 0; i < ARRAYELTS (spare_memory); i++) if (spare_memory[i]) { if (i == 0) diff --git a/src/lisp.h b/src/lisp.h index 32576930b29..2a3eaf38122 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -3769,7 +3769,7 @@ extern Lisp_Object zero_vector; typedef uintptr_t byte_ct; /* System byte counts reported by GC. */ extern byte_ct consing_since_gc; extern byte_ct gc_relative_threshold; -extern byte_ct memory_full_cons_threshold; +extern byte_ct const memory_full_cons_threshold; #ifdef HAVE_PDUMPER extern int number_finalizers_run; #endif |