Commit 2b6148e4 authored by Paul Eggert's avatar Paul Eggert

* alloc.c: Simplify handling of large-request failures (Bug#8800).

(SPARE_MEMORY): Always define.
(LARGE_REQUEST): Remove.
(memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
parent 85cc1f11
2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
* alloc.c: Simplify handling of large-request failures (Bug#8800).
(SPARE_MEMORY): Always define.
(LARGE_REQUEST): Remove.
(memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
2011-06-06 Martin Rudalics <rudalics@gmx.at>
* lisp.h: Move EXFUNS for Fframe_root_window,
......
......@@ -190,17 +190,10 @@ static int total_free_floats, total_floats;
static char *spare_memory[7];
#ifndef SYSTEM_MALLOC
/* Amount of spare memory to keep in large reserve block. */
/* Amount of spare memory to keep in large reserve block, or to see
whether this much is available when malloc fails on a larger request. */
#define SPARE_MEMORY (1 << 14)
#endif
#ifdef SYSTEM_MALLOC
# define LARGE_REQUEST (1 << 14)
#else
# define LARGE_REQUEST SPARE_MEMORY
#endif
/* Number of extra blocks malloc should get when it needs more core. */
......@@ -3289,9 +3282,9 @@ memory_full (size_t nbytes)
{
/* Do not go into hysterics merely because a large request failed. */
int enough_free_memory = 0;
if (LARGE_REQUEST < nbytes)
if (SPARE_MEMORY < nbytes)
{
void *p = malloc (LARGE_REQUEST);
void *p = malloc (SPARE_MEMORY);
if (p)
{
free (p);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment