summaryrefslogtreecommitdiff
path: root/src/alloc.c
diff options
context:
space:
mode:
authorMartin Rudalics <rudalics@gmx.at>2011-06-06 08:57:59 +0200
committerMartin Rudalics <rudalics@gmx.at>2011-06-06 08:57:59 +0200
commit1d00388aae9e39ceb8e520b5f227c21fdd219a20 (patch)
tree0fae32c463f63162d608b9038dd63fe73b9dfb59 /src/alloc.c
parent348f5121cd84ade8ce29d557e7f1215694027b05 (diff)
parent4d09bcf621ec32e17fdb8dd2ea08344486f7aeef (diff)
downloademacs-old-branches/window-pub.tar.gz
Merge from trunkold-branches/window-pub
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/alloc.c b/src/alloc.c
index 0c18fca1755..8d0fdd125dc 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -196,6 +196,12 @@ static char *spare_memory[7];
#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. */
static int malloc_hysteresis;
@@ -3283,15 +3289,12 @@ memory_full (size_t nbytes)
{
/* Do not go into hysterics merely because a large request failed. */
int enough_free_memory = 0;
- if (SPARE_MEMORY < nbytes)
+ if (LARGE_REQUEST < nbytes)
{
- void *p = malloc (SPARE_MEMORY);
+ void *p = malloc (LARGE_REQUEST);
if (p)
{
- if (spare_memory[0])
- free (p);
- else
- spare_memory[0] = p;
+ free (p);
enough_free_memory = 1;
}
}