Commit 61569968 authored by John van Groningen's avatar John van Groningen

use addresses relative to __ARRAY__ on Mac OS X

parent 8c6df0b7
......@@ -61,7 +61,11 @@ Int *copy_graph_to_string (Int *node_p,void *begin_free_heap,void *end_free_heap
if (((unsigned Int)node_p-(unsigned Int)begin_heap)>=heap_size){
if (heap_p>=(Int*)stack_begin)
return NULL;
# ifdef MACH_O64
heap_p[0]=3+(Int)node_p-(Int)&__ARRAY__;
# else
heap_p[0]=3+(Int)node_p;
# endif
++heap_p;
break;
}
......@@ -74,8 +78,11 @@ Int *copy_graph_to_string (Int *node_p,void *begin_free_heap,void *end_free_heap
if (!(desc & 1)){
*node_p=1+(Int)heap_p;
#ifdef MACH_O64
*heap_p++=desc-(Int)&__ARRAY__;
#else
*heap_p++=desc;
#endif
if (desc & 2){
unsigned Int arity;
......@@ -474,8 +481,12 @@ void remove_forwarding_pointers_from_graph (Int *node_p,Int **stack_end)
forwarding_pointer=*node_p;
if ((forwarding_pointer & 1)==0)
break;
#ifdef MACH_O64
desc = (Int)&__ARRAY__ + *((Int*)(forwarding_pointer-1));
#else
desc = *((Int*)(forwarding_pointer-1));
#endif
*node_p=desc;
if (desc & 2){
......
......@@ -62,6 +62,9 @@ Int *copy_string_to_graph (Int *string_p,void *begin_free_heap,void *end_free_he
if (!(desc & 1)){
*string_p=(Int)heap_p;
*arg_a=heap_p;
#ifdef MACH_O64
desc+=(Int)&__ARRAY__;
#endif
*heap_p=desc;
if (desc & 2){
unsigned Int arity;
......@@ -647,7 +650,11 @@ Int *copy_string_to_graph (Int *string_p,void *begin_free_heap,void *end_free_he
#ifdef THREAD
if (desc & 2){
# ifdef MACH_O64
node_p=(Int*)(desc-3)+(Int)&__ARRAY__;
# else
node_p=(Int*)(desc-3);
# endif
*arg_a=node_p;
++string_p;
break;
......@@ -683,7 +690,11 @@ void remove_forwarding_pointers_from_string (Int *string_p,Int *end_forwarding_p
Int desc;
desc=*(Int*)forwarding_pointer;
#ifdef MACH_O64
*string_p=desc-(Int)&__ARRAY__;
#else
*string_p=desc;
#endif
if (desc & 2){
unsigned Int arity;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment