diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 3 | ||||
| -rw-r--r-- | src/alloc.c | 25 |
2 files changed, 16 insertions, 12 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 906cde05086..f4a15df66ba 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2011-04-16 Paul Eggert <eggert@cs.ucla.edu> | 1 | 2011-04-16 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 2 | ||
| 3 | * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED): | ||
| 4 | Define only if needed. | ||
| 5 | |||
| 3 | * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier | 6 | * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier |
| 4 | by pacifying GCC about it. Maybe it's time to retire it? | 7 | by pacifying GCC about it. Maybe it's time to retire it? |
| 5 | * xfaces.c (USG, __TIMEVAL__): Likewise. | 8 | * xfaces.c (USG, __TIMEVAL__): Likewise. |
diff --git a/src/alloc.c b/src/alloc.c index 16cd183aaa1..412527b41a0 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -139,10 +139,6 @@ static pthread_mutex_t alloc_mutex; | |||
| 139 | #endif /* ! defined HAVE_GTK_AND_PTHREAD */ | 139 | #endif /* ! defined HAVE_GTK_AND_PTHREAD */ |
| 140 | #endif /* ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT */ | 140 | #endif /* ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT */ |
| 141 | 141 | ||
| 142 | /* Value of _bytes_used, when spare_memory was freed. */ | ||
| 143 | |||
| 144 | static __malloc_size_t bytes_used_when_full; | ||
| 145 | |||
| 146 | /* Mark, unmark, query mark bit of a Lisp string. S must be a pointer | 142 | /* Mark, unmark, query mark bit of a Lisp string. S must be a pointer |
| 147 | to a struct Lisp_String. */ | 143 | to a struct Lisp_String. */ |
| 148 | 144 | ||
| @@ -198,9 +194,11 @@ static int total_free_floats, total_floats; | |||
| 198 | 194 | ||
| 199 | static char *spare_memory[7]; | 195 | static char *spare_memory[7]; |
| 200 | 196 | ||
| 197 | #ifndef SYSTEM_MALLOC | ||
| 201 | /* Amount of spare memory to keep in large reserve block. */ | 198 | /* Amount of spare memory to keep in large reserve block. */ |
| 202 | 199 | ||
| 203 | #define SPARE_MEMORY (1 << 14) | 200 | #define SPARE_MEMORY (1 << 14) |
| 201 | #endif | ||
| 204 | 202 | ||
| 205 | /* Number of extra blocks malloc should get when it needs more core. */ | 203 | /* Number of extra blocks malloc should get when it needs more core. */ |
| 206 | 204 | ||
| @@ -469,13 +467,6 @@ display_malloc_warning (void) | |||
| 469 | intern ("emergency")); | 467 | intern ("emergency")); |
| 470 | pending_malloc_warning = 0; | 468 | pending_malloc_warning = 0; |
| 471 | } | 469 | } |
| 472 | |||
| 473 | |||
| 474 | #ifdef DOUG_LEA_MALLOC | ||
| 475 | # define BYTES_USED (mallinfo ().uordblks) | ||
| 476 | #else | ||
| 477 | # define BYTES_USED _bytes_used | ||
| 478 | #endif | ||
| 479 | 470 | ||
| 480 | /* Called if we can't allocate relocatable space for a buffer. */ | 471 | /* Called if we can't allocate relocatable space for a buffer. */ |
| 481 | 472 | ||
| @@ -1096,8 +1087,18 @@ static void * (*old_malloc_hook) (size_t, const void *); | |||
| 1096 | static void * (*old_realloc_hook) (void *, size_t, const void*); | 1087 | static void * (*old_realloc_hook) (void *, size_t, const void*); |
| 1097 | static void (*old_free_hook) (void*, const void*); | 1088 | static void (*old_free_hook) (void*, const void*); |
| 1098 | 1089 | ||
| 1090 | #ifdef DOUG_LEA_MALLOC | ||
| 1091 | # define BYTES_USED (mallinfo ().uordblks) | ||
| 1092 | #else | ||
| 1093 | # define BYTES_USED _bytes_used | ||
| 1094 | #endif | ||
| 1095 | |||
| 1099 | static __malloc_size_t bytes_used_when_reconsidered; | 1096 | static __malloc_size_t bytes_used_when_reconsidered; |
| 1100 | 1097 | ||
| 1098 | /* Value of _bytes_used, when spare_memory was freed. */ | ||
| 1099 | |||
| 1100 | static __malloc_size_t bytes_used_when_full; | ||
| 1101 | |||
| 1101 | /* This function is used as the hook for free to call. */ | 1102 | /* This function is used as the hook for free to call. */ |
| 1102 | 1103 | ||
| 1103 | static void | 1104 | static void |
| @@ -3296,7 +3297,7 @@ memory_full (void) | |||
| 3296 | 3297 | ||
| 3297 | /* Record the space now used. When it decreases substantially, | 3298 | /* Record the space now used. When it decreases substantially, |
| 3298 | we can refill the memory reserve. */ | 3299 | we can refill the memory reserve. */ |
| 3299 | #ifndef SYSTEM_MALLOC | 3300 | #if !defined SYSTEM_MALLOC && !defined SYNC_INPUT |
| 3300 | bytes_used_when_full = BYTES_USED; | 3301 | bytes_used_when_full = BYTES_USED; |
| 3301 | #endif | 3302 | #endif |
| 3302 | 3303 | ||