diff options
| author | Paul Eggert | 2019-03-02 13:13:05 -0800 |
|---|---|---|
| committer | Paul Eggert | 2019-03-02 13:14:26 -0800 |
| commit | 284f635da833d2dbf0102af3442197b46adf78c5 (patch) | |
| tree | 0985ae494b56041500e13214074e4237ced04385 /src | |
| parent | 5f99d515c921ee5546483ddab15e08f9b23280d9 (diff) | |
| download | emacs-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.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; | |||
| 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 | ||
| 237 | byte_ct memory_full_cons_threshold; | 237 | byte_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 | |||
| 4082 | memory_full (size_t nbytes) | 4082 | memory_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; | |||
| 3769 | typedef uintptr_t byte_ct; /* System byte counts reported by GC. */ | 3769 | typedef uintptr_t byte_ct; /* System byte counts reported by GC. */ |
| 3770 | extern byte_ct consing_since_gc; | 3770 | extern byte_ct consing_since_gc; |
| 3771 | extern byte_ct gc_relative_threshold; | 3771 | extern byte_ct gc_relative_threshold; |
| 3772 | extern byte_ct memory_full_cons_threshold; | 3772 | extern byte_ct const memory_full_cons_threshold; |
| 3773 | #ifdef HAVE_PDUMPER | 3773 | #ifdef HAVE_PDUMPER |
| 3774 | extern int number_finalizers_run; | 3774 | extern int number_finalizers_run; |
| 3775 | #endif | 3775 | #endif |