aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2019-03-02 13:13:05 -0800
committerPaul Eggert2019-03-02 13:14:26 -0800
commit284f635da833d2dbf0102af3442197b46adf78c5 (patch)
tree0985ae494b56041500e13214074e4237ced04385 /src
parent5f99d515c921ee5546483ddab15e08f9b23280d9 (diff)
downloademacs-284f635da833d2dbf0102af3442197b46adf78c5.tar.gz
emacs-284f635da833d2dbf0102af3442197b46adf78c5.zip
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.c12
-rw-r--r--src/lisp.h2
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;
234/* Minimum number of bytes of consing since GC before next GC, 234/* Minimum number of bytes of consing since GC before next GC,
235 when memory is full. */ 235 when memory is full. */
236 236
237byte_ct memory_full_cons_threshold; 237byte_ct const memory_full_cons_threshold = sizeof (struct cons_block);
238 238
239#ifdef HAVE_PDUMPER 239#ifdef HAVE_PDUMPER
240/* Number of finalizers run: used to loop over GC until we stop 240/* Number of finalizers run: used to loop over GC until we stop
@@ -4082,7 +4082,7 @@ void
4082memory_full (size_t nbytes) 4082memory_full (size_t nbytes)
4083{ 4083{
4084 /* Do not go into hysterics merely because a large request failed. */ 4084 /* Do not go into hysterics merely because a large request failed. */
4085 bool enough_free_memory = 0; 4085 bool enough_free_memory = false;
4086 if (SPARE_MEMORY < nbytes) 4086 if (SPARE_MEMORY < nbytes)
4087 { 4087 {
4088 void *p; 4088 void *p;
@@ -4092,21 +4092,17 @@ memory_full (size_t nbytes)
4092 if (p) 4092 if (p)
4093 { 4093 {
4094 free (p); 4094 free (p);
4095 enough_free_memory = 1; 4095 enough_free_memory = true;
4096 } 4096 }
4097 MALLOC_UNBLOCK_INPUT; 4097 MALLOC_UNBLOCK_INPUT;
4098 } 4098 }
4099 4099
4100 if (! enough_free_memory) 4100 if (! enough_free_memory)
4101 { 4101 {
4102 int i;
4103
4104 Vmemory_full = Qt; 4102 Vmemory_full = Qt;
4105 4103
4106 memory_full_cons_threshold = sizeof (struct cons_block);
4107
4108 /* The first time we get here, free the spare memory. */ 4104 /* The first time we get here, free the spare memory. */
4109 for (i = 0; i < ARRAYELTS (spare_memory); i++) 4105 for (int i = 0; i < ARRAYELTS (spare_memory); i++)
4110 if (spare_memory[i]) 4106 if (spare_memory[i])
4111 { 4107 {
4112 if (i == 0) 4108 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;
3769typedef uintptr_t byte_ct; /* System byte counts reported by GC. */ 3769typedef uintptr_t byte_ct; /* System byte counts reported by GC. */
3770extern byte_ct consing_since_gc; 3770extern byte_ct consing_since_gc;
3771extern byte_ct gc_relative_threshold; 3771extern byte_ct gc_relative_threshold;
3772extern byte_ct memory_full_cons_threshold; 3772extern byte_ct const memory_full_cons_threshold;
3773#ifdef HAVE_PDUMPER 3773#ifdef HAVE_PDUMPER
3774extern int number_finalizers_run; 3774extern int number_finalizers_run;
3775#endif 3775#endif