-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrb-8.4.3-svn-diff.patch
5603 lines (5373 loc) · 187 KB
/
rb-8.4.3-svn-diff.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
Index: src/broker/cas_net_buf.h
===================================================================
--- src/broker/cas_net_buf.h (revision 6634)
+++ src/broker/cas_net_buf.h (working copy)
@@ -44,7 +44,7 @@
#if (defined(SOLARIS) && !defined(SOLARIS_X86)) || defined(HPUX) || defined(AIX) || defined(PPC_LINUX)
#define BYTE_ORDER_BIG_ENDIAN
-#elif defined(WINDOWS) || defined(LINUX) || defined(OSF1) || defined(ALPHA_LINUX) || defined(UNIXWARE7) || defined(SOLARIS_X86)
+#elif defined(WINDOWS) || defined(LINUX) || defined(OSF1) || defined(ALPHA_LINUX) || defined(UNIXWARE7) || defined(SOLARIS_X86) || defined(MAC_OS)
#ifdef BYTE_ORDER_BIG_ENDIAN
#error BYTE_ORDER_BIG_ENDIAN defined
#endif
Index: src/cci/cci_net_buf.h
===================================================================
--- src/cci/cci_net_buf.h (revision 6634)
+++ src/cci/cci_net_buf.h (working copy)
@@ -56,7 +56,7 @@
#if (defined(SOLARIS) && !defined(SOLARIS_X86)) || defined(HPUX) || defined(AIX)
#define BYTE_ORDER_BIG_ENDIAN
-#elif defined(WINDOWS) || defined(LINUX) || defined(SOLARIS_X86)
+#elif defined(WINDOWS) || defined(LINUX) || defined(SOLARIS_X86) || defined(MAC_OS)
#ifdef BYTE_ORDER_BIG_ENDIAN
#error BYTE_ORDER_BIG_ENDIAN defined
#endif
Index: src/cci/cci_common.h
===================================================================
--- src/cci/cci_common.h (revision 6634)
+++ src/cci/cci_common.h (working copy)
@@ -68,7 +68,7 @@
#define __func__ __FUNCTION__
#define gettid() GetCurrentThreadId()
#else
-#define gettid() syscall(__NR_gettid)
+#define gettid() getpid()
#endif
#define API_SLOG(con) \
Index: src/base/porting.h
===================================================================
--- src/base/porting.h (revision 6634)
+++ src/base/porting.h (working copy)
@@ -347,7 +347,7 @@
#if !defined(HAVE_DIRNAME)
char *dirname (const char *path);
#endif /* HAVE_DIRNAME */
- extern int basename_r (const char *path, char *pathbuf, size_t buflen);
+ extern int cub_basename_r (const char *path, char *pathbuf, size_t buflen);
#if !defined(HAVE_BASENAME)
extern char *basename (const char *path);
#endif /* HAVE_BASENAME */
@@ -415,7 +415,7 @@
int cub_vsnprintf (char *buffer, size_t count, const char *format,
va_list argptr);
#endif
-#if defined(WINDOWS)
+#if defined(WINDOWS) || defined(MAC_OS)
/* The following structure is used to generate uniformly distributed
* pseudo-random numbers reentrantly.
*/
@@ -433,7 +433,8 @@
extern int srand48_r (long int seedval, struct drand48_data *buffer);
extern int lrand48_r (struct drand48_data *buffer, long int *result);
extern int drand48_r (struct drand48_data *buffer, double *result);
-
+#endif
+#if defined(WINDOWS)
extern double round (double d);
typedef struct
@@ -681,6 +682,14 @@
#endif /* HAVE_GCC_ATOMIC_BUILTINS */
#endif /* WINDOWS */
+#ifndef ETIME /* for FreeBSD */
+#include <sys/timeb.h>
+#include <unistd.h>
+#define ETIME ETIMEDOUT
+#define off64_t off_t
+#define lseek64(filedes, offset, whence) lseek(filedes, offset, whence)
+#endif
+
#ifdef __cplusplus
}
#endif
Index: configure.ac
===================================================================
--- configure.ac (revision 6634)
+++ configure.ac (working copy)
@@ -34,7 +34,36 @@
AC_PROG_CC
AC_PROG_CXX
AM_PROG_CC_C_O
+AC_PROG_LIBTOOL
+AC_PROG_RANLIB
+AC_PROG_INSTALL
+AC_PROG_YACC
+AC_PROG_LEX
+CFLAGS="$remember_CFLAGS"
+CXXFLAGS="$remember_CXXFLAGS"
+LDFLAGS="$remember_LDFLAGS"
+# Patch libtool to not use rpath
+sed < libtool > libtool-2 's/^hardcode_libdir_flag_spec.*$'/'hardcode_libdir_flag_spec=" -D__LIBTOOL_NO_RPATH__ "/'
+mv libtool-2 libtool
+chmod 755 libtool
+
+# System type
+SYSTEM_TYPE="$host_vendor-$host_os"
+MACHINE_TYPE="$host_cpu"
+
+case $SYSTEM_TYPE in
+ *linux*) SYS_DEFS="-DGCC -DLINUX -D_GNU_SOURCE -DI386"
+ SYS_LIBS="" ;;
+ *) SYS_DEFS="-DMAC_OS"
+ SYS_LIBS="" ;;
+esac
+
+case $MACHINE_TYPE in
+ x86*|i*86) SYS_DEFS="$SYS_DEFS -DX86" ;;
+ *) ;;
+esac
+
# Checks bit model feature.
AC_ARG_ENABLE([64bit],
[AS_HELP_STRING([--enable-64bit],
@@ -64,39 +93,8 @@
fi
AM_CONDITIONAL([BUILD_64], [test "$enable_64bit" = "yes"])
-export BIT_MODEL CC CXX
+export BIT_MODEL SYSTEM_TYPE MACHINE_TYPE CC CXX
-AC_PROG_LIBTOOL
-AC_PROG_RANLIB
-AC_PROG_INSTALL
-AC_PROG_YACC
-AC_PROG_LEX
-CFLAGS="$remember_CFLAGS"
-CXXFLAGS="$remember_CXXFLAGS"
-LDFLAGS="$remember_LDFLAGS"
-
-# Patch libtool to not use rpath
-sed < libtool > libtool-2 's/^hardcode_libdir_flag_spec.*$'/'hardcode_libdir_flag_spec=" -D__LIBTOOL_NO_RPATH__ "/'
-mv libtool-2 libtool
-chmod 755 libtool
-
-# System type
-SYSTEM_TYPE="$host_vendor-$host_os"
-MACHINE_TYPE="$host_cpu"
-export SYSTEM_TYPE MACHINE_TYPE
-
-case $SYSTEM_TYPE in
- *linux*) SYS_DEFS="-DGCC -DLINUX -D_GNU_SOURCE -DI386"
- SYS_LIBS="" ;;
- *) SYS_DEFS=""
- SYS_LIBS="" ;;
-esac
-
-case $MACHINE_TYPE in
- x86*|i*86) SYS_DEFS="$SYS_DEFS -DX86" ;;
- *) ;;
-esac
-
# Checks for libraries.
AC_CHECK_LIB([m], [main])
#AC_CHECK_LIB([rt], [main])
@@ -350,7 +348,7 @@
[build as dbgw lib to use cci mock @<:@default=no@:>@])],
[enable_mock=$enableval],
[enable_mock=no])
-
+
if test "$enable_mock" = "yes"
then
DBGW_DEFS="$DBGW_DEFS -DBUILD_MOCK"
Index: external/gc6.7/darwin_stop_world.c
===================================================================
--- external/gc6.7/darwin_stop_world.c (revision 6634)
+++ external/gc6.7/darwin_stop_world.c (working copy)
@@ -10,7 +10,7 @@
be allocated, is called the red zone. This area as shown in Figure 3-2 may
be used for any purpose as long as a new stack frame does not need to be
added to the stack."
-
+
Page 50: "If a leaf procedure's red zone usage would exceed 224 bytes, then
it must set up a stack frame just like routines that call other routines."
*/
@@ -32,7 +32,7 @@
unsigned long FindTopOfStack(unsigned int stack_start) {
StackFrame *frame;
-
+
if (stack_start == 0) {
# ifdef POWERPC
# if CPP_WORDSZ == 32
@@ -59,14 +59,14 @@
is not set up on purpose, so we shouldn't check it. */
if ((frame->savedLR & ~3) == 0) break; /* if the next LR is bogus, stop */
if ((~(frame->savedLR) & ~3) == 0) break; /* ditto */
- } while (1);
+ } while (1);
# ifdef DEBUG_THREADS
/* GC_printf1("FindTopOfStack finish at sp = %p\n", frame); */
# endif
return (unsigned long)frame;
-}
+}
#ifdef DARWIN_DONT_PARSE_STACK
void GC_push_all_stacks() {
@@ -79,14 +79,16 @@
ppc_thread_state_t state;
#elif defined(I386)
i386_thread_state_t state;
+#elif defined(X86_64)
+ x86_thread_state64_t state;
#else
# error FIXME for non-x86 || ppc architectures
#endif
mach_msg_type_number_t thread_state_count = MACHINE_THREAD_STATE_COUNT;
-
+
me = pthread_self();
if (!GC_thr_initialized) GC_thr_init();
-
+
for(i=0;i<THREAD_TABLE_SZ;i++) {
for(p=GC_threads[i];p!=0;p=p->next) {
if(p -> flags & FINISHED) continue;
@@ -100,50 +102,71 @@
(natural_t*)&state,
&thread_state_count);
if(r != KERN_SUCCESS) ABORT("thread_get_state failed");
-
+
#if defined(I386)
- lo = state.esp;
+ lo = state.__esp;
- GC_push_one(state.eax);
- GC_push_one(state.ebx);
- GC_push_one(state.ecx);
- GC_push_one(state.edx);
- GC_push_one(state.edi);
- GC_push_one(state.esi);
- GC_push_one(state.ebp);
+ GC_push_one(state.__eax);
+ GC_push_one(state.__ebx);
+ GC_push_one(state.__ecx);
+ GC_push_one(state.__edx);
+ GC_push_one(state.__edi);
+ GC_push_one(state.__esi);
+ GC_push_one(state.__ebp);
+#elif defined(X86_64)
+ lo = (void *)state.THREAD_FLD(rsp);
+# ifndef DARWIN_DONT_PARSE_STACK
+ *phi = GC_FindTopOfStack(state.THREAD_FLD(rsp));
+# endif
+ GC_push_one(state.THREAD_FLD(rax));
+ GC_push_one(state.THREAD_FLD(rbx));
+ GC_push_one(state.THREAD_FLD(rcx));
+ GC_push_one(state.THREAD_FLD(rdx));
+ GC_push_one(state.THREAD_FLD(rdi));
+ GC_push_one(state.THREAD_FLD(rsi));
+ GC_push_one(state.THREAD_FLD(rbp));
+ /* GC_push_one(state.THREAD_FLD(rsp)); */
+ GC_push_one(state.THREAD_FLD(r8));
+ GC_push_one(state.THREAD_FLD(r9));
+ GC_push_one(state.THREAD_FLD(r10));
+ GC_push_one(state.THREAD_FLD(r11));
+ GC_push_one(state.THREAD_FLD(r12));
+ GC_push_one(state.THREAD_FLD(r13));
+ GC_push_one(state.THREAD_FLD(r14));
+ GC_push_one(state.THREAD_FLD(r15));
#elif defined(POWERPC)
lo = (void*)(state.r1 - PPC_RED_ZONE_SIZE);
-
- GC_push_one(state.r0);
- GC_push_one(state.r2);
- GC_push_one(state.r3);
- GC_push_one(state.r4);
- GC_push_one(state.r5);
- GC_push_one(state.r6);
- GC_push_one(state.r7);
- GC_push_one(state.r8);
- GC_push_one(state.r9);
- GC_push_one(state.r10);
- GC_push_one(state.r11);
- GC_push_one(state.r12);
- GC_push_one(state.r13);
- GC_push_one(state.r14);
- GC_push_one(state.r15);
- GC_push_one(state.r16);
- GC_push_one(state.r17);
- GC_push_one(state.r18);
- GC_push_one(state.r19);
- GC_push_one(state.r20);
- GC_push_one(state.r21);
- GC_push_one(state.r22);
- GC_push_one(state.r23);
- GC_push_one(state.r24);
- GC_push_one(state.r25);
- GC_push_one(state.r26);
- GC_push_one(state.r27);
- GC_push_one(state.r28);
- GC_push_one(state.r29);
- GC_push_one(state.r30);
+
+ GC_push_one(state.r0);
+ GC_push_one(state.r2);
+ GC_push_one(state.r3);
+ GC_push_one(state.r4);
+ GC_push_one(state.r5);
+ GC_push_one(state.r6);
+ GC_push_one(state.r7);
+ GC_push_one(state.r8);
+ GC_push_one(state.r9);
+ GC_push_one(state.r10);
+ GC_push_one(state.r11);
+ GC_push_one(state.r12);
+ GC_push_one(state.r13);
+ GC_push_one(state.r14);
+ GC_push_one(state.r15);
+ GC_push_one(state.r16);
+ GC_push_one(state.r17);
+ GC_push_one(state.r18);
+ GC_push_one(state.r19);
+ GC_push_one(state.r20);
+ GC_push_one(state.r21);
+ GC_push_one(state.r22);
+ GC_push_one(state.r23);
+ GC_push_one(state.r24);
+ GC_push_one(state.r25);
+ GC_push_one(state.r26);
+ GC_push_one(state.r27);
+ GC_push_one(state.r28);
+ GC_push_one(state.r29);
+ GC_push_one(state.r30);
GC_push_one(state.r31);
#else
# error FIXME for non-x86 || ppc architectures
@@ -177,7 +200,7 @@
me = mach_thread_self();
if (!GC_thr_initialized) GC_thr_init();
-
+
r = task_threads(current_task(), &act_list, &listcount);
if(r != KERN_SUCCESS) ABORT("task_threads failed");
for(i = 0; i < listcount; i++) {
@@ -200,36 +223,36 @@
lo = (void*)(info.r1 - PPC_RED_ZONE_SIZE);
hi = (ptr_t)FindTopOfStack(info.r1);
- GC_push_one(info.r0);
- GC_push_one(info.r2);
- GC_push_one(info.r3);
- GC_push_one(info.r4);
- GC_push_one(info.r5);
- GC_push_one(info.r6);
- GC_push_one(info.r7);
- GC_push_one(info.r8);
- GC_push_one(info.r9);
- GC_push_one(info.r10);
- GC_push_one(info.r11);
- GC_push_one(info.r12);
- GC_push_one(info.r13);
- GC_push_one(info.r14);
- GC_push_one(info.r15);
- GC_push_one(info.r16);
- GC_push_one(info.r17);
- GC_push_one(info.r18);
- GC_push_one(info.r19);
- GC_push_one(info.r20);
- GC_push_one(info.r21);
- GC_push_one(info.r22);
- GC_push_one(info.r23);
- GC_push_one(info.r24);
- GC_push_one(info.r25);
- GC_push_one(info.r26);
- GC_push_one(info.r27);
- GC_push_one(info.r28);
- GC_push_one(info.r29);
- GC_push_one(info.r30);
+ GC_push_one(info.r0);
+ GC_push_one(info.r2);
+ GC_push_one(info.r3);
+ GC_push_one(info.r4);
+ GC_push_one(info.r5);
+ GC_push_one(info.r6);
+ GC_push_one(info.r7);
+ GC_push_one(info.r8);
+ GC_push_one(info.r9);
+ GC_push_one(info.r10);
+ GC_push_one(info.r11);
+ GC_push_one(info.r12);
+ GC_push_one(info.r13);
+ GC_push_one(info.r14);
+ GC_push_one(info.r15);
+ GC_push_one(info.r16);
+ GC_push_one(info.r17);
+ GC_push_one(info.r18);
+ GC_push_one(info.r19);
+ GC_push_one(info.r20);
+ GC_push_one(info.r21);
+ GC_push_one(info.r22);
+ GC_push_one(info.r23);
+ GC_push_one(info.r24);
+ GC_push_one(info.r25);
+ GC_push_one(info.r26);
+ GC_push_one(info.r27);
+ GC_push_one(info.r28);
+ GC_push_one(info.r29);
+ GC_push_one(info.r30);
GC_push_one(info.r31);
# else
/* FIXME: Remove after testing: */
@@ -243,21 +266,21 @@
lo = (void*)info.esp;
hi = (ptr_t)FindTopOfStack(info.esp);
- GC_push_one(info.eax);
- GC_push_one(info.ebx);
- GC_push_one(info.ecx);
- GC_push_one(info.edx);
- GC_push_one(info.edi);
- GC_push_one(info.esi);
+ GC_push_one(info.eax);
+ GC_push_one(info.ebx);
+ GC_push_one(info.ecx);
+ GC_push_one(info.edx);
+ GC_push_one(info.edi);
+ GC_push_one(info.esi);
/* GC_push_one(info.ebp); */
/* GC_push_one(info.esp); */
- GC_push_one(info.ss);
- GC_push_one(info.eip);
- GC_push_one(info.cs);
- GC_push_one(info.ds);
- GC_push_one(info.es);
- GC_push_one(info.fs);
- GC_push_one(info.gs);
+ GC_push_one(info.ss);
+ GC_push_one(info.eip);
+ GC_push_one(info.cs);
+ GC_push_one(info.ds);
+ GC_push_one(info.es);
+ GC_push_one(info.fs);
+ GC_push_one(info.gs);
# endif /* !POWERPC */
}
# if DEBUG_THREADS
@@ -267,7 +290,7 @@
(unsigned long) hi
);
# endif
- GC_push_all_stack(lo, hi);
+ GC_push_all_stack(lo, hi);
} /* for(p=GC_threads[i]...) */
vm_deallocate(current_task(), (vm_address_t)act_list, sizeof(thread_t) * listcount);
}
@@ -290,7 +313,7 @@
}
/* returns true if there's a thread in act_list that wasn't in old_list */
-int GC_suspend_thread_list(thread_act_array_t act_list, int count,
+int GC_suspend_thread_list(thread_act_array_t act_list, int count,
thread_act_array_t old_list, int old_count) {
mach_port_t my_thread = mach_thread_self();
int i, j;
@@ -299,7 +322,7 @@
for(i = 0; i < count; i++) {
thread_act_t thread = act_list[i];
-# if DEBUG_THREADS
+# if DEBUG_THREADS
GC_printf1("Attempting to suspend thread %p\n", thread);
# endif
/* find the current thread in the old list */
@@ -317,7 +340,7 @@
/* default is not suspended */
GC_mach_threads[GC_mach_threads_count].already_suspended = 0;
changed = 1;
- }
+ }
if (thread != my_thread &&
(!GC_use_mach_handler_thread
@@ -328,7 +351,7 @@
kern_return_t kern_result = thread_info(thread, THREAD_BASIC_INFO,
(thread_info_t)&info, &outCount);
if(kern_result != KERN_SUCCESS) {
- /* the thread may have quit since the thread_threads () call
+ /* the thread may have quit since the thread_threads () call
* we mark already_suspended so it's not dealt with anymore later
*/
if (!found) {
@@ -344,14 +367,14 @@
GC_mach_threads[GC_mach_threads_count].already_suspended = info.suspend_count;
}
if (info.suspend_count) continue;
-
+
# if DEBUG_THREADS
GC_printf1("Suspending 0x%lx\n", thread);
# endif
/* Suspend the thread */
kern_result = thread_suspend(thread);
if(kern_result != KERN_SUCCESS) {
- /* the thread may have quit since the thread_threads () call
+ /* the thread may have quit since the thread_threads () call
* we mark already_suspended so it's not dealt with anymore later
*/
if (!found) {
@@ -360,7 +383,7 @@
}
continue;
}
- }
+ }
if (!found) GC_mach_threads_count++;
}
return changed;
@@ -376,14 +399,14 @@
kern_return_t kern_result;
thread_act_array_t act_list, prev_list;
mach_msg_type_number_t listcount, prevcount;
-
+
# if DEBUG_THREADS
GC_printf1("Stopping the world from 0x%lx\n", mach_thread_self());
# endif
/* clear out the mach threads list table */
- GC_stop_init();
-
+ GC_stop_init();
+
/* Make sure all free list construction has stopped before we start. */
/* No new construction can start, since free list construction is */
/* required to acquire and release the GC lock before it starts, */
@@ -401,7 +424,7 @@
thread, recognise it is stopped, but then have a new thread
it created before stopping show up later.
*/
-
+
changes = 1;
prev_list = NULL;
prevcount = 0;
@@ -415,15 +438,15 @@
prevcount = listcount;
vm_deallocate(current_task(), (vm_address_t)act_list, sizeof(thread_t) * listcount);
} while (changes);
-
-
+
+
# ifdef MPROTECT_VDB
if(GC_incremental) {
extern void GC_mprotect_stop();
GC_mprotect_stop();
}
# endif
-
+
# ifdef PARALLEL_MARK
GC_release_mark_lock();
# endif
@@ -444,7 +467,7 @@
mach_msg_type_number_t listcount;
struct thread_basic_info info;
mach_msg_type_number_t outCount = THREAD_INFO_MAX;
-
+
# if DEBUG_THREADS
GC_printf0("World starting\n");
# endif
@@ -481,7 +504,7 @@
/* Resume the thread */
kern_result = thread_resume(thread);
if(kern_result != KERN_SUCCESS) ABORT("thread_resume failed");
- }
+ }
}
}
}
Index: external/gc6.7/include/private/gc_priv.h
===================================================================
--- external/gc6.7/include/private/gc_priv.h (revision 6634)
+++ external/gc6.7/include/private/gc_priv.h (working copy)
@@ -1,4 +1,4 @@
-/*
+/*
* Copyright 1988, 1989 Hans-J. Boehm, Alan J. Demers
* Copyright (c) 1991-1994 by Xerox Corporation. All rights reserved.
* Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved.
@@ -14,8 +14,8 @@
* provided the above notices are retained, and a notice that the code was
* modified is included with the above copyright notice.
*/
-
+
# ifndef GC_PRIVATE_H
# define GC_PRIVATE_H
@@ -61,7 +61,7 @@
/* byte displacements. */
/* Preferably identical to caddr_t, if it */
/* exists. */
-
+
# ifndef GCCONFIG_H
# include "gcconfig.h"
# endif
@@ -158,7 +158,7 @@
/* If not, try to keep individual objects small. */
/* This is now really controlled at startup, */
/* through GC_all_interior_pointers. */
-
+
#define PRINTSTATS /* Print garbage collection statistics */
/* For less verbose output, undefine in reclaim.c */
@@ -276,7 +276,7 @@
/* Fill in the pc and argument information for up to NFRAMES of my */
/* callers. Ignore my frame and my callers frame. */
void GC_save_callers GC_PROTO((struct callinfo info[NFRAMES]));
-
+
void GC_print_callers GC_PROTO((struct callinfo info[NFRAMES]));
#endif
@@ -383,7 +383,7 @@
# else
# if defined(THREADS) || defined(AMIGA) \
|| defined(MSWIN32) || defined(MSWINCE) || defined(MACOS) \
- || defined(DJGPP) || defined(NO_SIGNALS)
+ || defined(DJGPP) || defined(NO_SIGNALS)
/* Also useful for debugging. */
/* Should probably use thr_sigsetmask for GC_SOLARIS_THREADS. */
# define DISABLE_SIGNALS()
@@ -464,6 +464,60 @@
# define GETENV(name) 0
#endif
+
+#if defined(DARWIN)
+# if defined(POWERPC)
+# if CPP_WORDSZ == 32
+# define GC_THREAD_STATE_T ppc_thread_state_t
+# define GC_MACH_THREAD_STATE PPC_THREAD_STATE
+# define GC_MACH_THREAD_STATE_COUNT PPC_THREAD_STATE_COUNT
+# else
+# define GC_THREAD_STATE_T ppc_thread_state64_t
+# define GC_MACH_THREAD_STATE PPC_THREAD_STATE64
+# define GC_MACH_THREAD_STATE_COUNT PPC_THREAD_STATE64_COUNT
+# endif
+# elif defined(I386) || defined(X86_64)
+# if CPP_WORDSZ == 32
+# define GC_THREAD_STATE_T x86_thread_state32_t
+# define GC_MACH_THREAD_STATE x86_THREAD_STATE32
+# define GC_MACH_THREAD_STATE_COUNT x86_THREAD_STATE32_COUNT
+# else
+# define GC_THREAD_STATE_T x86_thread_state64_t
+# define GC_MACH_THREAD_STATE x86_THREAD_STATE64
+# define GC_MACH_THREAD_STATE_COUNT x86_THREAD_STATE64_COUNT
+# endif
+# else
+# if defined(ARM32)
+# define GC_THREAD_STATE_T arm_thread_state_t
+# else
+# error define GC_THREAD_STATE_T
+# endif
+# define GC_MACH_THREAD_STATE MACHINE_THREAD_STATE
+# define GC_MACH_THREAD_STATE_COUNT MACHINE_THREAD_STATE_COUNT
+# endif
+
+# if CPP_WORDSZ == 32
+# define GC_MACH_HEADER mach_header
+# define GC_MACH_SECTION section
+# define GC_GETSECTBYNAME getsectbynamefromheader
+# else
+# define GC_MACH_HEADER mach_header_64
+# define GC_MACH_SECTION section_64
+# define GC_GETSECTBYNAME getsectbynamefromheader_64
+# endif
+
+ /* Try to work out the right way to access thread state structure */
+ /* members. The structure has changed its definition in different */
+ /* Darwin versions. This now defaults to the (older) names */
+ /* without __, thus hopefully, not breaking any existing */
+ /* Makefile.direct builds. */
+# if __DARWIN_UNIX03
+# define THREAD_FLD(x) __ ## x
+# else
+# define THREAD_FLD(x) x
+# endif
+#endif /* DARWIN */
+
/*********************************/
/* */
/* Word-size-dependent defines */
@@ -551,7 +605,7 @@
#define MAXOBJBYTES ((word)CPP_MAXOBJBYTES)
#define CPP_MAXOBJSZ BYTES_TO_WORDS(CPP_MAXOBJBYTES)
#define MAXOBJSZ ((word)CPP_MAXOBJSZ)
-
+
# define divHBLKSZ(n) ((n) >> LOG_HBLKSIZE)
# define HBLK_PTR_DIFF(p,q) divHBLKSZ((ptr_t)p - (ptr_t)q)
@@ -561,9 +615,9 @@
/* instead of a shift. The bundled SunOS 4.1 */
/* o.w. sometimes pessimizes the subtraction to */
/* involve a call to .div. */
-
+
# define modHBLKSZ(n) ((n) & (HBLKSIZE-1))
-
+
# define HBLKPTR(objptr) ((struct hblk *)(((word) (objptr)) & ~(HBLKSIZE-1)))
# define HBLKDISPL(objptr) (((word) (objptr)) & (HBLKSIZE-1))
@@ -599,7 +653,7 @@
* OK to add spurious entries to sets.
* Used by black-listing code, and perhaps by dirty bit maintenance code.
*/
-
+
# ifdef LARGE_CONFIG
# define LOG_PHT_ENTRIES 20 /* Collisions likely at 1M blocks, */
/* which is >= 4GB. Each table takes */
@@ -636,9 +690,9 @@
/* This sets (many) extra bits. */
# define set_pht_entry_from_index_safe(bl, index) \
(bl)[divWORDSZ(index)] = ONES
-
+
/********************************************/
/* */
/* H e a p B l o c k s */
@@ -680,7 +734,7 @@
struct hblk * hb_prev; /* Backwards link for free list. */
word hb_descr; /* object descriptor for marking. See */
/* mark.h. */
- map_entry_type * hb_map;
+ map_entry_type * hb_map;
/* A pointer to a pointer validity map of the block. */
/* See GC_obj_map. */
/* Valid for all blocks with headers. */
@@ -756,7 +810,7 @@
# define MAX_ROOT_SETS 4096
# else
/* GCJ LOCAL: MAX_ROOT_SETS increased to permit more shared */
- /* libraries to be loaded. */
+ /* libraries to be loaded. */
# define MAX_ROOT_SETS 1024
# endif
@@ -894,7 +948,7 @@
unsigned _size_map[WORDS_TO_BYTES(MAXOBJSZ+1)];
/* Number of words to allocate for a given allocation request in */
/* bytes. */
-# endif
+# endif
# ifdef STUBBORN_ALLOC
ptr_t _sobjfreelist[MAXOBJSZ+1];
@@ -919,7 +973,7 @@
# define MAP_ENTRY(map, bytes) (map)[bytes]
# define MAP_ENTRIES HBLKSIZE
# define MAP_SIZE MAP_ENTRIES
-# define CPP_MAX_OFFSET (OFFSET_TOO_BIG - 1)
+# define CPP_MAX_OFFSET (OFFSET_TOO_BIG - 1)
# define MAX_OFFSET ((word)CPP_MAX_OFFSET)
/* The following are used only if GC_all_interior_ptrs != 0 */
# define VALID_OFFSET_SZ \
@@ -947,7 +1001,7 @@
/* GC_read_dirty. */
# endif
# ifdef MPROTECT_VDB
- VOLATILE page_hash_table _dirty_pages;
+ VOLATILE page_hash_table _dirty_pages;
/* Pages dirtied since last GC_read_dirty. */
# endif
# ifdef PROC_VDB
@@ -995,7 +1049,7 @@
#endif
};
-GC_API GC_FAR struct _GC_arrays GC_arrays;
+GC_API GC_FAR struct _GC_arrays GC_arrays;
# ifndef SEPARATE_GLOBALS
# define GC_objfreelist GC_arrays._objfreelist
@@ -1180,7 +1234,7 @@
extern word GC_root_size; /* Total size of registered root sections */
-extern GC_bool GC_debugging_started; /* GC_debug_malloc has been called. */
+extern GC_bool GC_debugging_started; /* GC_debug_malloc has been called. */
extern long GC_large_alloc_warn_interval;
/* Interval between unsuppressed warnings. */
@@ -1258,9 +1312,9 @@
/* Important internal collector routines */
ptr_t GC_approx_sp GC_PROTO((void));
-
+
GC_bool GC_should_collect GC_PROTO((void));
-
+
void GC_apply_to_all_blocks GC_PROTO(( \
void (*fn) GC_PROTO((struct hblk *h, word client_data)), \
word client_data));
@@ -1436,7 +1490,7 @@
/* We need to register the main data segment. Returns */
/* TRUE unless this is done implicitly as part of */
/* dynamic library registration. */
-
+
/* Machine dependent startup routines */
ptr_t GC_get_stack_base GC_PROTO((void)); /* Cold end of stack */
#ifdef IA64
@@ -1444,7 +1498,7 @@
/* Cold end of register stack. */
#endif
void GC_register_data_segments GC_PROTO((void));
-
+
/* Black listing: */
void GC_bl_init GC_PROTO((void));
# ifdef PRINT_BLACK_LIST
@@ -1489,13 +1543,13 @@
/* Return the number of (stack) blacklisted */
/* blocks in the range for statistical */
/* purposes. */
-
+
ptr_t GC_scratch_alloc GC_PROTO((word bytes));
/* GC internal memory allocation for */
/* small objects. Deallocation is not */
/* possible. */
-
-/* Heap block layout maps: */
+
+/* Heap block layout maps: */
void GC_invalidate_map GC_PROTO((hdr * hhdr));
/* Remove the object map associated */
/* with the block. This identifies */
@@ -1509,11 +1563,11 @@
/* Version of GC_register_displacement */
/* that assumes lock is already held */
/* and signals are already disabled. */
-
-/* hblk allocation: */
+
+/* hblk allocation: */
void GC_new_hblk GC_PROTO((word size_in_words, int kind));
/* Allocate a new heap block, and build */
- /* a free list in it. */
+ /* a free list in it. */
ptr_t GC_build_fl GC_PROTO((struct hblk *h, word sz,
GC_bool clear, ptr_t list));
@@ -1547,7 +1601,7 @@
void GC_freehblk GC_PROTO((struct hblk * p));
/* Deallocate a heap block and mark it */
/* as invalid. */
-
+
/* Misc GC: */
void GC_init_inner GC_PROTO((void));
GC_bool GC_expand_hp_inner GC_PROTO((word n));
@@ -1643,7 +1697,7 @@
/* head. */
void GC_free_inner(GC_PTR p);
-
+
void GC_init_headers GC_PROTO((void));
struct hblkhdr * GC_install_header GC_PROTO((struct hblk *h));
/* Install a header for block h. */
@@ -1658,7 +1712,7 @@
void GC_remove_counts GC_PROTO((struct hblk * h, word sz));
/* Remove forwarding counts for h. */
hdr * GC_find_header GC_PROTO((ptr_t h)); /* Debugging only. */
-
+
void GC_finalize GC_PROTO((void));
/* Perform all indicated finalization actions */
/* on unmarked objects. */
@@ -1678,10 +1732,10 @@
/* Auxiliary fns to make finalization work */
/* correctly with displaced pointers introduced */
/* by the debugging allocators. */
-
+
void GC_add_to_heap GC_PROTO((struct hblk *p, word bytes));
/* Add a HBLKSIZE aligned chunk to the heap. */
-
+
void GC_print_obj GC_PROTO((ptr_t p));
/* P points to somewhere inside an object with */
/* debugging info. Print a human readable */
@@ -1779,14 +1833,14 @@
/* h is about to be writteni or allocated. Ensure */
/* that it's not write protected by the virtual */
/* dirty bit implementation. */
-
+
void GC_dirty_init GC_PROTO((void));
-
+
/* Slow/general mark bit manipulation: */
GC_API GC_bool GC_is_marked GC_PROTO((ptr_t p));
void GC_clear_mark_bit GC_PROTO((ptr_t p));
void GC_set_mark_bit GC_PROTO((ptr_t p));
-
+
/* Stubborn objects: */
void GC_read_changed GC_PROTO((void)); /* Analogous to GC_read_dirty */
GC_bool GC_page_was_changed GC_PROTO((struct hblk * h));
@@ -1794,7 +1848,7 @@
void GC_clean_changing_list GC_PROTO((void));
/* Collect obsolete changing list entries */
void GC_stubborn_init GC_PROTO((void));
-
+
/* Debugging print routines: */
void GC_print_block_list GC_PROTO((void));
void GC_print_hblkfreelist GC_PROTO((void));
@@ -1809,7 +1863,7 @@
# define GC_STORE_BACK_PTR(source, dest) GC_store_back_pointer(source, dest)
# define GC_MARKED_FOR_FINALIZATION(dest) GC_marked_for_finalization(dest)
#else
-# define GC_STORE_BACK_PTR(source, dest)
+# define GC_STORE_BACK_PTR(source, dest)
# define GC_MARKED_FOR_FINALIZATION(dest)
#endif
@@ -1861,7 +1915,7 @@
(long)c, (long)d, \
(long)e, (long)g)
/* Ditto, writes to stderr. */
-
+
void GC_err_puts GC_PROTO((GC_CONST char *s));
/* Write s to stderr, don't buffer, don't add */
/* newlines, don't ... */
@@ -1878,14 +1932,14 @@
GC_err_printf2("Assertion failure: %s:%ld\n", \
__FILE__, (unsigned long)__LINE__); \
ABORT("assertion failure"); }
-# else
+# else
# define GC_ASSERT(expr)
# endif
/* Check a compile time assertion at compile time. The error */
/* message for failure is a bit baroque, but ... */
#if defined(mips) && !defined(__GNUC__)
-/* DOB: MIPSPro C gets an internal error taking the sizeof an array type.
+/* DOB: MIPSPro C gets an internal error taking the sizeof an array type.
This code works correctly (ugliness is to avoid "unused var" warnings) */
# define GC_STATIC_ASSERT(expr) do { if (0) { char j[(expr)? 1 : -1]; j[0]='\0'; j[0]=j[0]; } } while(0)
#else
@@ -1902,7 +1956,7 @@
/* acquired, the GC lock must be acquired first. The mark lock is */
/* used to both protect some variables used by the parallel */
/* marker, and to protect GC_fl_builder_count, below. */
- /* GC_notify_all_marker() is called when */
+ /* GC_notify_all_marker() is called when */
/* the state of the parallel marker changes */
/* in some significant way (see gc_mark.h for details). The */
/* latter set of events includes incrementing GC_mark_no. */
@@ -1951,10 +2005,10 @@
# define SIG_SUSPEND _SIGRTMIN + 6
# else
# define SIG_SUSPEND SIGRTMIN + 6
-# endif
+# endif
# endif
# endif /* !SIG_SUSPEND */
-
+
# endif
# endif /* GC_PRIVATE_H */