Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
4e75f29d
Commit
4e75f29d
authored
Apr 16, 2011
by
Paul Eggert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
Define only if needed.
parent
761383f4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
12 deletions
+16
-12
src/ChangeLog
src/ChangeLog
+3
-0
src/alloc.c
src/alloc.c
+13
-12
No files found.
src/ChangeLog
View file @
4e75f29d
2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
* alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
Define only if needed.
* sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
by pacifying GCC about it. Maybe it's time to retire it?
* xfaces.c (USG, __TIMEVAL__): Likewise.
...
...
src/alloc.c
View file @
4e75f29d
...
...
@@ -139,10 +139,6 @@ static pthread_mutex_t alloc_mutex;
#endif
/* ! defined HAVE_GTK_AND_PTHREAD */
#endif
/* ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT */
/* Value of _bytes_used, when spare_memory was freed. */
static
__malloc_size_t
bytes_used_when_full
;
/* Mark, unmark, query mark bit of a Lisp string. S must be a pointer
to a struct Lisp_String. */
...
...
@@ -198,9 +194,11 @@ 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. */
#define SPARE_MEMORY (1 << 14)
#endif
/* Number of extra blocks malloc should get when it needs more core. */
...
...
@@ -469,13 +467,6 @@ display_malloc_warning (void)
intern
(
"emergency"
));
pending_malloc_warning
=
0
;
}
#ifdef DOUG_LEA_MALLOC
# define BYTES_USED (mallinfo ().uordblks)
#else
# define BYTES_USED _bytes_used
#endif
/* Called if we can't allocate relocatable space for a buffer. */
...
...
@@ -1096,8 +1087,18 @@ static void * (*old_malloc_hook) (size_t, const void *);
static
void
*
(
*
old_realloc_hook
)
(
void
*
,
size_t
,
const
void
*
);
static
void
(
*
old_free_hook
)
(
void
*
,
const
void
*
);
#ifdef DOUG_LEA_MALLOC
# define BYTES_USED (mallinfo ().uordblks)
#else
# define BYTES_USED _bytes_used
#endif
static
__malloc_size_t
bytes_used_when_reconsidered
;
/* Value of _bytes_used, when spare_memory was freed. */
static
__malloc_size_t
bytes_used_when_full
;
/* This function is used as the hook for free to call. */
static
void
...
...
@@ -3296,7 +3297,7 @@ memory_full (void)
/* Record the space now used. When it decreases substantially,
we can refill the memory reserve. */
#if
n
def SYSTEM_MALLOC
#if
!
def
ined
SYSTEM_MALLOC
&& !defined SYNC_INPUT
bytes_used_when_full
=
BYTES_USED
;
#endif
...
...
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