diff options
Diffstat (limited to 'src/alloc.c')
| -rw-r--r-- | src/alloc.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/src/alloc.c b/src/alloc.c index 2f186fd3d12..c49d3b5becc 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -480,7 +480,7 @@ static int live_symbol_p P_ ((struct mem_node *, void *)); | |||
| 480 | static int live_float_p P_ ((struct mem_node *, void *)); | 480 | static int live_float_p P_ ((struct mem_node *, void *)); |
| 481 | static int live_misc_p P_ ((struct mem_node *, void *)); | 481 | static int live_misc_p P_ ((struct mem_node *, void *)); |
| 482 | static void mark_maybe_object P_ ((Lisp_Object)); | 482 | static void mark_maybe_object P_ ((Lisp_Object)); |
| 483 | static void mark_memory P_ ((void *, void *)); | 483 | static void mark_memory P_ ((void *, void *, int)); |
| 484 | static void mem_init P_ ((void)); | 484 | static void mem_init P_ ((void)); |
| 485 | static struct mem_node *mem_insert P_ ((void *, void *, enum mem_type)); | 485 | static struct mem_node *mem_insert P_ ((void *, void *, enum mem_type)); |
| 486 | static void mem_insert_fixup P_ ((struct mem_node *)); | 486 | static void mem_insert_fixup P_ ((struct mem_node *)); |
| @@ -4330,11 +4330,13 @@ mark_maybe_pointer (p) | |||
| 4330 | } | 4330 | } |
| 4331 | 4331 | ||
| 4332 | 4332 | ||
| 4333 | /* Mark Lisp objects referenced from the address range START..END. */ | 4333 | /* Mark Lisp objects referenced from the address range START+OFFSET..END |
| 4334 | or END+OFFSET..START. */ | ||
| 4334 | 4335 | ||
| 4335 | static void | 4336 | static void |
| 4336 | mark_memory (start, end) | 4337 | mark_memory (start, end, offset) |
| 4337 | void *start, *end; | 4338 | void *start, *end; |
| 4339 | int offset; | ||
| 4338 | { | 4340 | { |
| 4339 | Lisp_Object *p; | 4341 | Lisp_Object *p; |
| 4340 | void **pp; | 4342 | void **pp; |
| @@ -4353,7 +4355,7 @@ mark_memory (start, end) | |||
| 4353 | } | 4355 | } |
| 4354 | 4356 | ||
| 4355 | /* Mark Lisp_Objects. */ | 4357 | /* Mark Lisp_Objects. */ |
| 4356 | for (p = (Lisp_Object *) start; (void *) p < end; ++p) | 4358 | for (p = (Lisp_Object *) ((char *) start + offset); (void *) p < end; ++p) |
| 4357 | mark_maybe_object (*p); | 4359 | mark_maybe_object (*p); |
| 4358 | 4360 | ||
| 4359 | /* Mark Lisp data pointed to. This is necessary because, in some | 4361 | /* Mark Lisp data pointed to. This is necessary because, in some |
| @@ -4374,7 +4376,7 @@ mark_memory (start, end) | |||
| 4374 | away. The only reference to the life string is through the | 4376 | away. The only reference to the life string is through the |
| 4375 | pointer `s'. */ | 4377 | pointer `s'. */ |
| 4376 | 4378 | ||
| 4377 | for (pp = (void **) start; (void *) pp < end; ++pp) | 4379 | for (pp = (void **) ((char *) start + offset); (void *) pp < end; ++pp) |
| 4378 | mark_maybe_pointer (*pp); | 4380 | mark_maybe_pointer (*pp); |
| 4379 | } | 4381 | } |
| 4380 | 4382 | ||
| @@ -4553,7 +4555,11 @@ static void | |||
| 4553 | mark_stack () | 4555 | mark_stack () |
| 4554 | { | 4556 | { |
| 4555 | int i; | 4557 | int i; |
| 4556 | jmp_buf j; | 4558 | /* jmp_buf may not be aligned enough on darwin-ppc64 */ |
| 4559 | union aligned_jmpbuf { | ||
| 4560 | Lisp_Object o; | ||
| 4561 | jmp_buf j; | ||
| 4562 | } j; | ||
| 4557 | volatile int stack_grows_down_p = (char *) &j > (char *) stack_base; | 4563 | volatile int stack_grows_down_p = (char *) &j > (char *) stack_base; |
| 4558 | void *end; | 4564 | void *end; |
| 4559 | 4565 | ||
| @@ -4584,7 +4590,7 @@ mark_stack () | |||
| 4584 | } | 4590 | } |
| 4585 | #endif /* GC_SETJMP_WORKS */ | 4591 | #endif /* GC_SETJMP_WORKS */ |
| 4586 | 4592 | ||
| 4587 | setjmp (j); | 4593 | setjmp (j.j); |
| 4588 | end = stack_grows_down_p ? (char *) &j + sizeof j : (char *) &j; | 4594 | end = stack_grows_down_p ? (char *) &j + sizeof j : (char *) &j; |
| 4589 | #endif /* not GC_SAVE_REGISTERS_ON_STACK */ | 4595 | #endif /* not GC_SAVE_REGISTERS_ON_STACK */ |
| 4590 | 4596 | ||
| @@ -4599,7 +4605,7 @@ mark_stack () | |||
| 4599 | #endif | 4605 | #endif |
| 4600 | #endif | 4606 | #endif |
| 4601 | for (i = 0; i < sizeof (Lisp_Object); i += GC_LISP_OBJECT_ALIGNMENT) | 4607 | for (i = 0; i < sizeof (Lisp_Object); i += GC_LISP_OBJECT_ALIGNMENT) |
| 4602 | mark_memory ((char *) stack_base + i, end); | 4608 | mark_memory (stack_base, end, i); |
| 4603 | /* Allow for marking a secondary stack, like the register stack on the | 4609 | /* Allow for marking a secondary stack, like the register stack on the |
| 4604 | ia64. */ | 4610 | ia64. */ |
| 4605 | #ifdef GC_MARK_SECONDARY_STACK | 4611 | #ifdef GC_MARK_SECONDARY_STACK |