diff options
Diffstat (limited to 'src/alloc.c')
| -rw-r--r-- | src/alloc.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/alloc.c b/src/alloc.c index 8d0fdd125dc..453286836fd 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -190,17 +190,10 @@ static int total_free_floats, total_floats; | |||
| 190 | 190 | ||
| 191 | static char *spare_memory[7]; | 191 | static char *spare_memory[7]; |
| 192 | 192 | ||
| 193 | #ifndef SYSTEM_MALLOC | 193 | /* Amount of spare memory to keep in large reserve block, or to see |
| 194 | /* Amount of spare memory to keep in large reserve block. */ | 194 | whether this much is available when malloc fails on a larger request. */ |
| 195 | 195 | ||
| 196 | #define SPARE_MEMORY (1 << 14) | 196 | #define SPARE_MEMORY (1 << 14) |
| 197 | #endif | ||
| 198 | |||
| 199 | #ifdef SYSTEM_MALLOC | ||
| 200 | # define LARGE_REQUEST (1 << 14) | ||
| 201 | #else | ||
| 202 | # define LARGE_REQUEST SPARE_MEMORY | ||
| 203 | #endif | ||
| 204 | 197 | ||
| 205 | /* Number of extra blocks malloc should get when it needs more core. */ | 198 | /* Number of extra blocks malloc should get when it needs more core. */ |
| 206 | 199 | ||
| @@ -3289,9 +3282,9 @@ memory_full (size_t nbytes) | |||
| 3289 | { | 3282 | { |
| 3290 | /* Do not go into hysterics merely because a large request failed. */ | 3283 | /* Do not go into hysterics merely because a large request failed. */ |
| 3291 | int enough_free_memory = 0; | 3284 | int enough_free_memory = 0; |
| 3292 | if (LARGE_REQUEST < nbytes) | 3285 | if (SPARE_MEMORY < nbytes) |
| 3293 | { | 3286 | { |
| 3294 | void *p = malloc (LARGE_REQUEST); | 3287 | void *p = malloc (SPARE_MEMORY); |
| 3295 | if (p) | 3288 | if (p) |
| 3296 | { | 3289 | { |
| 3297 | free (p); | 3290 | free (p); |