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 94be9fa6132..8ebaac74c08 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -478,7 +478,7 @@ static int live_symbol_p P_ ((struct mem_node *, void *)); | |||
| 478 | static int live_float_p P_ ((struct mem_node *, void *)); | 478 | static int live_float_p P_ ((struct mem_node *, void *)); |
| 479 | static int live_misc_p P_ ((struct mem_node *, void *)); | 479 | static int live_misc_p P_ ((struct mem_node *, void *)); |
| 480 | static void mark_maybe_object P_ ((Lisp_Object)); | 480 | static void mark_maybe_object P_ ((Lisp_Object)); |
| 481 | static void mark_memory P_ ((void *, void *)); | 481 | static void mark_memory P_ ((void *, void *, int)); |
| 482 | static void mem_init P_ ((void)); | 482 | static void mem_init P_ ((void)); |
| 483 | static struct mem_node *mem_insert P_ ((void *, void *, enum mem_type)); | 483 | static struct mem_node *mem_insert P_ ((void *, void *, enum mem_type)); |
| 484 | static void mem_insert_fixup P_ ((struct mem_node *)); | 484 | static void mem_insert_fixup P_ ((struct mem_node *)); |
| @@ -4284,11 +4284,13 @@ mark_maybe_pointer (p) | |||
| 4284 | } | 4284 | } |
| 4285 | 4285 | ||
| 4286 | 4286 | ||
| 4287 | /* Mark Lisp objects referenced from the address range START..END. */ | 4287 | /* Mark Lisp objects referenced from the address range START+OFFSET..END |
| 4288 | or END+OFFSET..START. */ | ||
| 4288 | 4289 | ||
| 4289 | static void | 4290 | static void |
| 4290 | mark_memory (start, end) | 4291 | mark_memory (start, end, offset) |
| 4291 | void *start, *end; | 4292 | void *start, *end; |
| 4293 | int offset; | ||
| 4292 | { | 4294 | { |
| 4293 | Lisp_Object *p; | 4295 | Lisp_Object *p; |
| 4294 | void **pp; | 4296 | void **pp; |
| @@ -4307,7 +4309,7 @@ mark_memory (start, end) | |||
| 4307 | } | 4309 | } |
| 4308 | 4310 | ||
| 4309 | /* Mark Lisp_Objects. */ | 4311 | /* Mark Lisp_Objects. */ |
| 4310 | for (p = (Lisp_Object *) start; (void *) p < end; ++p) | 4312 | for (p = (Lisp_Object *) ((char *) start + offset); (void *) p < end; ++p) |
| 4311 | mark_maybe_object (*p); | 4313 | mark_maybe_object (*p); |
| 4312 | 4314 | ||
| 4313 | /* Mark Lisp data pointed to. This is necessary because, in some | 4315 | /* Mark Lisp data pointed to. This is necessary because, in some |
| @@ -4328,7 +4330,7 @@ mark_memory (start, end) | |||
| 4328 | away. The only reference to the life string is through the | 4330 | away. The only reference to the life string is through the |
| 4329 | pointer `s'. */ | 4331 | pointer `s'. */ |
| 4330 | 4332 | ||
| 4331 | for (pp = (void **) start; (void *) pp < end; ++pp) | 4333 | for (pp = (void **) ((char *) start + offset); (void *) pp < end; ++pp) |
| 4332 | mark_maybe_pointer (*pp); | 4334 | mark_maybe_pointer (*pp); |
| 4333 | } | 4335 | } |
| 4334 | 4336 | ||
| @@ -4507,7 +4509,11 @@ static void | |||
| 4507 | mark_stack () | 4509 | mark_stack () |
| 4508 | { | 4510 | { |
| 4509 | int i; | 4511 | int i; |
| 4510 | jmp_buf j; | 4512 | /* jmp_buf may not be aligned enough on darwin-ppc64 */ |
| 4513 | union aligned_jmpbuf { | ||
| 4514 | Lisp_Object o; | ||
| 4515 | jmp_buf j; | ||
| 4516 | } j; | ||
| 4511 | volatile int stack_grows_down_p = (char *) &j > (char *) stack_base; | 4517 | volatile int stack_grows_down_p = (char *) &j > (char *) stack_base; |
| 4512 | void *end; | 4518 | void *end; |
| 4513 | 4519 | ||
| @@ -4538,7 +4544,7 @@ mark_stack () | |||
| 4538 | } | 4544 | } |
| 4539 | #endif /* GC_SETJMP_WORKS */ | 4545 | #endif /* GC_SETJMP_WORKS */ |
| 4540 | 4546 | ||
| 4541 | setjmp (j); | 4547 | setjmp (j.j); |
| 4542 | end = stack_grows_down_p ? (char *) &j + sizeof j : (char *) &j; | 4548 | end = stack_grows_down_p ? (char *) &j + sizeof j : (char *) &j; |
| 4543 | #endif /* not GC_SAVE_REGISTERS_ON_STACK */ | 4549 | #endif /* not GC_SAVE_REGISTERS_ON_STACK */ |
| 4544 | 4550 | ||
| @@ -4553,7 +4559,7 @@ mark_stack () | |||
| 4553 | #endif | 4559 | #endif |
| 4554 | #endif | 4560 | #endif |
| 4555 | for (i = 0; i < sizeof (Lisp_Object); i += GC_LISP_OBJECT_ALIGNMENT) | 4561 | for (i = 0; i < sizeof (Lisp_Object); i += GC_LISP_OBJECT_ALIGNMENT) |
| 4556 | mark_memory ((char *) stack_base + i, end); | 4562 | mark_memory (stack_base, end, i); |
| 4557 | /* Allow for marking a secondary stack, like the register stack on the | 4563 | /* Allow for marking a secondary stack, like the register stack on the |
| 4558 | ia64. */ | 4564 | ia64. */ |
| 4559 | #ifdef GC_MARK_SECONDARY_STACK | 4565 | #ifdef GC_MARK_SECONDARY_STACK |