Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
4d09bcf6
Commit
4d09bcf6
authored
Jun 05, 2011
by
Paul Eggert
Browse files
* alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacO).
Fixes: debbugs:8800
parent
e7156492
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
6 deletions
+17
-6
src/ChangeLog
src/ChangeLog
+8
-0
src/alloc.c
src/alloc.c
+9
-6
No files found.
src/ChangeLog
View file @
4d09bcf6
2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
* alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
Do not assume that spare memory exists; that assumption is valid
only if SYSTEM_MALLOC.
(LARGE_REQUEST): New macro, so that the issue of large requests
is separated from the issue of spare memory.
2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
* editfns.c (Fformat): Correctly handle zero flag with hexadecimal
...
...
src/alloc.c
View file @
4d09bcf6
...
...
@@ -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 (
SP
ARE_
MEMORY
< nbytes)
if (
L
AR
G
E_
REQUEST
< nbytes)
{
void *p = malloc (
SP
ARE_
MEMORY
);
void *p = malloc (
L
AR
G
E_
REQUEST
);
if (p)
{
if (spare_memory[0])
free (p);
else
spare_memory[0] = p;
free (p);
enough_free_memory = 1;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment