diff options
| author | Daniel Colascione | 2012-09-17 04:07:36 -0800 |
|---|---|---|
| committer | Daniel Colascione | 2012-09-17 04:07:36 -0800 |
| commit | 2ab329f3b5d52a39f0a45c3d9c129f1c19560142 (patch) | |
| tree | 6dd6784d63e54cb18071df8e28fbdbc27d418728 /src/ralloc.c | |
| parent | f701ab72dd55460d23c8b029550aa4d7ecef3cfa (diff) | |
| parent | bb7dce392f6d9d5fc4b9d7de09ff920a52f07669 (diff) | |
| download | emacs-2ab329f3b5d52a39f0a45c3d9c129f1c19560142.tar.gz emacs-2ab329f3b5d52a39f0a45c3d9c129f1c19560142.zip | |
Merge from trunk
Diffstat (limited to 'src/ralloc.c')
| -rw-r--r-- | src/ralloc.c | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/src/ralloc.c b/src/ralloc.c index 3877e21d4f6..9a4b1ada229 100644 --- a/src/ralloc.c +++ b/src/ralloc.c | |||
| @@ -25,7 +25,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 25 | #ifdef emacs | 25 | #ifdef emacs |
| 26 | 26 | ||
| 27 | #include <config.h> | 27 | #include <config.h> |
| 28 | #include <setjmp.h> | 28 | |
| 29 | #include "lisp.h" /* Needed for VALBITS. */ | 29 | #include "lisp.h" /* Needed for VALBITS. */ |
| 30 | #include "blockinput.h" | 30 | #include "blockinput.h" |
| 31 | 31 | ||
| @@ -237,7 +237,7 @@ obtain (POINTER address, SIZE size) | |||
| 237 | } | 237 | } |
| 238 | 238 | ||
| 239 | if (! heap) | 239 | if (! heap) |
| 240 | abort (); | 240 | emacs_abort (); |
| 241 | 241 | ||
| 242 | /* If we can't fit SIZE bytes in that heap, | 242 | /* If we can't fit SIZE bytes in that heap, |
| 243 | try successive later heaps. */ | 243 | try successive later heaps. */ |
| @@ -330,7 +330,7 @@ relinquish (void) | |||
| 330 | /* This heap should have no blocs in it. */ | 330 | /* This heap should have no blocs in it. */ |
| 331 | if (last_heap->first_bloc != NIL_BLOC | 331 | if (last_heap->first_bloc != NIL_BLOC |
| 332 | || last_heap->last_bloc != NIL_BLOC) | 332 | || last_heap->last_bloc != NIL_BLOC) |
| 333 | abort (); | 333 | emacs_abort (); |
| 334 | 334 | ||
| 335 | /* Return the last heap, with its header, to the system. */ | 335 | /* Return the last heap, with its header, to the system. */ |
| 336 | excess = (char *)last_heap->end - (char *)last_heap->start; | 336 | excess = (char *)last_heap->end - (char *)last_heap->start; |
| @@ -355,7 +355,7 @@ relinquish (void) | |||
| 355 | which returns the entire last heap to the system, seems | 355 | which returns the entire last heap to the system, seems |
| 356 | unlikely to trigger this mode of failure. */ | 356 | unlikely to trigger this mode of failure. */ |
| 357 | if (last_heap->end != (*real_morecore) (0)) | 357 | if (last_heap->end != (*real_morecore) (0)) |
| 358 | abort (); | 358 | emacs_abort (); |
| 359 | } | 359 | } |
| 360 | } | 360 | } |
| 361 | } | 361 | } |
| @@ -452,7 +452,7 @@ relocate_blocs (bloc_ptr bloc, heap_ptr heap, POINTER address) | |||
| 452 | 452 | ||
| 453 | /* No need to ever call this if arena is frozen, bug somewhere! */ | 453 | /* No need to ever call this if arena is frozen, bug somewhere! */ |
| 454 | if (r_alloc_freeze_level) | 454 | if (r_alloc_freeze_level) |
| 455 | abort (); | 455 | emacs_abort (); |
| 456 | 456 | ||
| 457 | while (b) | 457 | while (b) |
| 458 | { | 458 | { |
| @@ -576,7 +576,7 @@ resize_bloc (bloc_ptr bloc, SIZE size) | |||
| 576 | 576 | ||
| 577 | /* No need to ever call this if arena is frozen, bug somewhere! */ | 577 | /* No need to ever call this if arena is frozen, bug somewhere! */ |
| 578 | if (r_alloc_freeze_level) | 578 | if (r_alloc_freeze_level) |
| 579 | abort (); | 579 | emacs_abort (); |
| 580 | 580 | ||
| 581 | if (bloc == NIL_BLOC || size == bloc->size) | 581 | if (bloc == NIL_BLOC || size == bloc->size) |
| 582 | return 1; | 582 | return 1; |
| @@ -588,7 +588,7 @@ resize_bloc (bloc_ptr bloc, SIZE size) | |||
| 588 | } | 588 | } |
| 589 | 589 | ||
| 590 | if (heap == NIL_HEAP) | 590 | if (heap == NIL_HEAP) |
| 591 | abort (); | 591 | emacs_abort (); |
| 592 | 592 | ||
| 593 | old_size = bloc->size; | 593 | old_size = bloc->size; |
| 594 | bloc->size = size; | 594 | bloc->size = size; |
| @@ -937,7 +937,7 @@ r_alloc_free (register POINTER *ptr) | |||
| 937 | 937 | ||
| 938 | dead_bloc = find_bloc (ptr); | 938 | dead_bloc = find_bloc (ptr); |
| 939 | if (dead_bloc == NIL_BLOC) | 939 | if (dead_bloc == NIL_BLOC) |
| 940 | abort (); /* Double free? PTR not originally used to allocate? */ | 940 | emacs_abort (); /* Double free? PTR not originally used to allocate? */ |
| 941 | 941 | ||
| 942 | free_bloc (dead_bloc); | 942 | free_bloc (dead_bloc); |
| 943 | *ptr = 0; | 943 | *ptr = 0; |
| @@ -979,7 +979,7 @@ r_re_alloc (POINTER *ptr, SIZE size) | |||
| 979 | 979 | ||
| 980 | bloc = find_bloc (ptr); | 980 | bloc = find_bloc (ptr); |
| 981 | if (bloc == NIL_BLOC) | 981 | if (bloc == NIL_BLOC) |
| 982 | abort (); /* Already freed? PTR not originally used to allocate? */ | 982 | emacs_abort (); /* Already freed? PTR not originally used to allocate? */ |
| 983 | 983 | ||
| 984 | if (size < bloc->size) | 984 | if (size < bloc->size) |
| 985 | { | 985 | { |
| @@ -1152,7 +1152,7 @@ r_alloc_reset_variable (POINTER *old, POINTER *new) | |||
| 1152 | } | 1152 | } |
| 1153 | 1153 | ||
| 1154 | if (bloc == NIL_BLOC || bloc->variable != old) | 1154 | if (bloc == NIL_BLOC || bloc->variable != old) |
| 1155 | abort (); /* Already freed? OLD not originally used to allocate? */ | 1155 | emacs_abort (); /* Already freed? OLD not originally used to allocate? */ |
| 1156 | 1156 | ||
| 1157 | /* Update variable to point to the new location. */ | 1157 | /* Update variable to point to the new location. */ |
| 1158 | bloc->variable = new; | 1158 | bloc->variable = new; |
| @@ -1193,7 +1193,7 @@ r_alloc_init (void) | |||
| 1193 | first_heap->start = first_heap->bloc_start | 1193 | first_heap->start = first_heap->bloc_start |
| 1194 | = virtual_break_value = break_value = (*real_morecore) (0); | 1194 | = virtual_break_value = break_value = (*real_morecore) (0); |
| 1195 | if (break_value == NIL) | 1195 | if (break_value == NIL) |
| 1196 | abort (); | 1196 | emacs_abort (); |
| 1197 | 1197 | ||
| 1198 | extra_bytes = ROUNDUP (50000); | 1198 | extra_bytes = ROUNDUP (50000); |
| 1199 | #endif | 1199 | #endif |
| @@ -1204,9 +1204,15 @@ r_alloc_init (void) | |||
| 1204 | UNBLOCK_INPUT; | 1204 | UNBLOCK_INPUT; |
| 1205 | #else | 1205 | #else |
| 1206 | #ifndef SYSTEM_MALLOC | 1206 | #ifndef SYSTEM_MALLOC |
| 1207 | /* Give GNU malloc's morecore some hysteresis | 1207 | /* Give GNU malloc's morecore some hysteresis so that we move all |
| 1208 | so that we move all the relocatable blocks much less often. */ | 1208 | the relocatable blocks much less often. The number used to be |
| 1209 | __malloc_extra_blocks = 64; | 1209 | 64, but alloc.c would override that with 32 in code that was |
| 1210 | removed when SYNC_INPUT became the only input handling mode. | ||
| 1211 | That code was conditioned on !DOUG_LEA_MALLOC, so the call to | ||
| 1212 | mallopt above is left unchanged. (Actually, I think there's no | ||
| 1213 | system nowadays that uses DOUG_LEA_MALLOC and also uses | ||
| 1214 | REL_ALLOC.) */ | ||
| 1215 | __malloc_extra_blocks = 32; | ||
| 1210 | #endif | 1216 | #endif |
| 1211 | #endif | 1217 | #endif |
| 1212 | 1218 | ||