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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980
7981
7982
7983
7984
7985
7986
7987
7988
7989
7990
7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
|
== [7.3alpha2] (development) ==
* Abort in GC_thr_init on pthread_atfork failure (POSIX threads).
* Add 'const' qualifier to pointer argument of some API functions.
* Add GC_UNDERSCORE_STDCALL, UNICODE macro templates to configure (Win32).
* Add GC_get_thr_restart_signal, GC_thread_is_registered to GC API.
* Add GC_is_heap_ptr, GC_move_disappearing_link to GC API.
* Add SHORT_DBG_HDRS macro template to configure.
* Add TODO file.
* Add assertion ensuring proper alignment of 'pushed' GC symbols.
* Add assertion to GC_incremental_protection_needs, refine documentation.
* Add assertion to check GC_large_free_bytes by GC_finish_collection.
* Add configure option to compile all library .c files into single gc.o.
* Add cordtest to make check.
* Add disclaim callbacks for efficient finalization (ENABLE_DISCLAIM).
* Add finalization.html to 'doc' folder.
* Add javaxfc.h to the installation set of GC header files (configure).
* Add on-heap-resize event notification to API.
* Adjust GC_log_printf format specifiers (regarding signed/unsigned long).
* Adjust GC_requested_heapsize on GC_init if GC_INITIAL_HEAP_SIZE given.
* Allow GC_exclude_static_roots() region start to be unaligned.
* Allow Win32 DllMain chaining on the client side.
* Allow to exclude finalization support by GC_NO_FINALIZATION macro.
* Allow to get memory via Win32 VirtualAlloc (USE_WINALLOC) on Cygwin.
* Avoid unnecessary GC_find_limit invocation if GC_no_dls.
* Avoid use of deprecated GC_dont_gc and GC_stackbottom in gctest.
* Changed the order in autogen.sh so ltmain exists in time for automake.
* Declare privately and use handy GC_base_C() for constant object pointers.
* Define GC_READ_ENV_FILE in configure for WinCE unless gc-debug is off.
* Do not compile pthread_stop_world.c for Cygwin/Darwin (configure).
* Do not install ancient new_gc_alloc.h broken for modern STL (configure).
* Enable GC_MIN_MARKERS to set minimal number of pthread-based markers.
* Enable PARALLEL_MARK and THREAD_LOCAL_ALLOC for FreeBSD in configure.
* Enable parallel mark by default in configure (Darwin/Linux/Solaris/Win32).
* Export GC_is_marked, GC_clear/set_mark_bit (for mark-bit manipulation).
* Extend thread-related debug messages.
* Fix compiler warning in cordtest.
* Fix minor warnings reported by GCC with '-pedantic' option.
* Fix static data roots registration on Android (if GC is shared).
* Implement GC_get_stack_base for Darwin for single-threaded mode.
* Improve GC_allochblk algorithm of block splitting when unmapping enabled.
* Improve GC_collect_or_expand algorithm for many finalizers registered case.
* In tests, print a message in case a test is a no-op.
* Instruct configure to hide internal libgc.so symbols if supported by GCC.
* Log amount of unmapped memory (if enabled) on marking-for-collection.
* Move "cord" library tests to "cord/tests" folder.
* Move asm machine-dependent files to "src" folder.
* Move build tools sources to "tools" folder.
* Move cord_pos.h to public headers folder.
* Open log file in APPEND mode on Win32 (similar that on Unix/Cygwin).
* Optimize some functions by moving pthread_self calls out of LOCK section.
* Place only major per-release changes description to ChangeLog (this file).
* Prevent compiler warnings in GC_FindTopOfStack and GC_ports (Darwin).
* Recognize GC_LOG_TO_FILE_ALWAYS macro to log to 'gc.log' by default.
* Remove all auto-generated files from the repo.
* Remove binary icon file for de_win.
* Remove cordtest from "cord" library.
* Remove duplicate MacOS_Test_config.h file.
* Remove gc_amiga_redirects.h (included internally) from public headers.
* Remove obsolete Makefile.DLL (superseded by Cygwin/MinGW configure).
* Remove obsolete unused asm files for ALPHA, HPUX, SGI, RS6000, ULTRIX.
* Remove unsupported MMAP_STACKS (specific to Solaris threads).
* Remove unused ancient SILENT, __STDC__, NO_SIGNALS macros.
* Replace ARGSUSED comment-based annotation with GCC 'unused' attribute.
* Replace long GC_markers global variable with int GC_markers_m1.
* Replace printf PRIxMAX specifier with '%p' for thread id debug output.
* Require automake 2.63 instead of v2.64.
* Simplify autogen.sh (use autoreconf).
* Split GC_abort with GC_on_abort and abort() invoked from ABORT.
* Support GC_ATTR_MALLOC for MS VisualStudio.
* Tag auxiliary malloc-like API functions with 'malloc' attribute.
* Tag deprecated variables in GC API.
* Tag must-be-non-null arguments of GC API functions.
* Turn on "extra" GCC warnings.
* Turn on unused-parameter checking for GCC.
* Update AUTHORS file.
* Use EXPECT for checking various 'initialized' boolean variables.
* Use union of AO_t and word to favor strict-aliasing compiler optimization.
== [7.2] (candidate) ==
* Add GC_WIN32_PTHREADS target in configure.
* Add GC_is_disabled new function to GC API.
* Add info that getcontext() resets FPE mask no longer on Linux/x86_64.
* Add realloc_test.c test.
* Add support for Hexagon target.
* Add thread-safe GC_get_heap_usage_safe to GC API.
* Check pthread_create/join result in test.
* Define GC_DLL (in configure) if building only dynamic libraries.
* Define NO_DEBUGGING (in configure) if "--disable-gc-debug" is set.
* Enable parallel marker in configure for Solaris.
* Fix "comparison of signed and unsigned values" compiler warnings.
* Fix 'volatile' keyword placement in GC_SysVGetDataStart.
* Fix GC_add_roots_inner for Mac OS X (align segment start).
* Fix GC_finalizer_nested size to workaround alignment problem in Watcom.
* Fix GC_find_limit_with_bound to always reset fault handler on return.
* Fix GC_init[_lib_bounds] and GC_get_main_stack_base for malloc redirection.
* Fix GC_push_all/selected boundaries check.
* Fix GC_register_my_thread marking thread as detached (Cygwin/pthreads-w32).
* Fix GC_restart_handler to preserve errno if needed.
* Fix GC_root_size update in GC_add_roots_inner (Win32).
* Fix GC_unregister_my_thread to ensure no ongoing incremental GC (Win32).
* Fix compiler warning in GC_dyld_image_add/remove (Darwin).
* Fix configure --enable-cplusplus make install.
* Fix configure to disable GCC aliasing optimization unless forced to.
* Fix duplicate definitions in gcconfig.h for NetBSD.
* Fix fork() support on Cygwin and Darwin targets.
* Fix gc_cpp.cc for Cygwin (remove duplicate function definition).
* Fix gcconfig.h to define USE_GET_STACKBASE_FOR_MAIN for Android.
* Fix gcconfig.h to handle mips64-linux target.
* Fix gcconfig.h to turn on POSIX fork() support by default.
* Fix mach_dep.c to include sys/ucontext.h on Mac OS X 10.6.
* Fix tests to check GC_malloc result for NULL (out-of-memory).
* Fix thread model in configure for MinGW ("win32" instead of "posix").
* Fix various warnings reported by LINT-like tools.
* Port some thread tests to Win32.
* Refine API GC setters and getter comments regarding locking.
* Refine GC_stackbottom description in gc.h.
* Remove duplicate calls in GC_register_dynamic_libraries.
* Remove locking in API GC_get_bytes_since_gc and friends.
* Remove newly-added GC_get_heap_size/free_bytes_inner from API.
* Remove some local variables that are unused.
* Support multi-threading for RTEMS target.
* Use global GC_noop_sink variable in GC_noop1 to suppress compiler warning.
* Use pkg-config to pick up libatomic_ops, etc.
* Workaround some Linux/arm kernels bug to get correct GC_nprocs value.
== [7.2alpha6] 2011-06-14 ==
* configure_atomic_ops.sh: Remove.
* Makefile.direct (dist gc.tar): Remove configure_atomic_ops.sh.
* Makefile.am (EXTRA_DIST): Add autogen.sh.
* NT_STATIC_THREADS_MAKEFILE (.cpp.obj): Remove duplicate .cpp
filename passed.
* NT_X64_THREADS_MAKEFILE (.cpp.obj): Use lowercase file
extension.
* NT_X64_STATIC_THREADS_MAKEFILE (.cpp.obj): Likewise.
* NT_MAKEFILE (.cpp.obj): Likewise.
* alloc.c (GC_add_current_malloc_heap, GC_build_back_graph,
GC_traverse_back_graph): Move prototype to gc_priv.h.
* checksums.c (GC_page_was_ever_dirty): Likewise.
* dbg_mlc.c (GC_default_print_heap_obj_proc): Likewise.
* dyn_load.c (GC_parse_map_entry, GC_get_maps,
GC_segment_is_thread_stack, GC_roots_present, GC_is_heap_base,
GC_get_next_stack): Likewise.
* finalize.c (GC_reset_finalizer_nested,
GC_check_finalizer_nested): Likewise.
* gcj_mlc.c (GC_start_debugging, GC_store_debug_info): Likewise.
* malloc.c (GC_extend_size_map, GC_text_mapping): Likewise.
* mark_rts.c (GC_mark_thread_local_free_lists): Likewise.
* misc.c (GC_register_main_static_data, GC_init_win32,
GC_setpagesize, GC_init_linux_data_start,
GC_set_and_save_fault_handler, GC_init_dyld, GC_init_netbsd_elf,
GC_initialize_offsets, GC_bl_init, GC_do_blocking_inner,
GC_bl_init_no_interiors): Likewise.
* os_dep.c (GC_greatest_stack_base_below, GC_push_all_stacks):
Likewise.
* reclaim.c (GC_check_leaked): Likewise.
* win32_threads.c (GC_gww_dirty_init): Likewise.
* darwin_stop_world.c (GC_is_mach_marker, GC_mprotect_stop,
GC_mprotect_resume): Move prototype to darwin_stop_world.h.
* pthread_support.c (GC_FindTopOfStack): Likewise.
* dyn_load.c (GC_cond_add_roots): Merge adjacent definitions.
* mark.c (GC_page_was_ever_dirty): Remove (as already declared).
* mark_rts.c (GC_roots_present): Change return type to void
pointer (to match the prototype); return NULL instead of FALSE.
* mark_rts.c (GC_add_roots_inner): Cast GC_roots_present() result.
* os_dep.c (NEED_PROC_MAPS): Move definition to gcconfig.h.
* os_dep.c (GC_write_fault_handler): Make STATIC.
* os_dep.c (GC_set_write_fault_handler): New function (only if
GC_WIN32_THREADS).
* pthread_start.c (GC_start_rtn_prepare_thread,
GC_thread_exit_proc): Move prototype to pthread_support.h.
* pthread_support.c (GC_nacl_initialize_gc_thread,
GC_nacl_shutdown_gc_thread, GC_unblock_gc_signals):
Likewise.
* pthread_support.c (GC_stop_init): Move prototype to
pthread_stop_world.h.
* win32_threads.c (GC_write_fault_handler): Remove prototype.
* win32_threads.c (GC_register_my_thread_inner): Call
GC_set_write_fault_handler instead of SetUnhandledExceptionFilter
(only if MPROTECT_VDB).
* doc/README.win32: Add information about DMC.
* include/private/gc_priv.h (GC_set_write_fault_handler): New
prototype (only if GC_WIN32_THREADS and MPROTECT_VDB).
* misc.c (vsnprintf): Redirect to vsprintf() if NO_VSNPRINTF.
* win32_threads.c (GC_unregister_my_thread): Use KNOWN_FINISHED()
instead of FINISHED macro.
* tests/test.c (check_heap_stats): Round up max_heap_sz value for
Win32 (same as for USE_MMAP).
* tests/test.c (check_heap_stats): Adjust printf format specifier
for max_heap_sz; cast max_heap_sz accordingly.
* doc/README.solaris2: Add note.
* configure.ac (SOLARIS25_PROC_VDB_BUG_FIXED): Don't define for
Solaris/x86 2.10+.
* tests/threadkey_test.c (SKIP_THREADKEY_TEST): Skip the test if
defined; explicitly define for some targets.
* mark.c (GC_dirty): Add prototype (only if MANUAL_VDB).
* stubborn.c (GC_dirty): Likewise.
* include/private/gcconfig.h (GWW_VDB, MPROTECT_VDB, PCR_VDB,
PROC_VDB): Undefine if MANUAL_VDB.
* include/private/gcconfig.h (DEFAULT_VDB): Don't define if
MANUAL_VDB.
* os_dep.c (async_set_pht_entry_from_index): Define for
MANUAL_VDB.
* os_dep.c (GC_read_dirty): Set GC_dirty_maintained only if
success; if ioctl() failed then just print warning instead of
aborting.
* include/private/gc_priv.h (GC_ASSERT): Use "%d" (instead of %ld)
for line number printing.
* os_dep.c (GC_read_dirty): Add debug logging if DEBUG_DIRTY_BITS
(for PROC_VDB only); print errors via GC_err_printf; rename "ps"
and "np" local variables to npages and pagesize, respectively;
remove "current_addr" local variable.
* os_dep.c (GC_get_main_stack_base): Convert to GC_get_stack_base
for BeOS and OS/2; define HAVE_GET_STACK_BASE.
* os_dep.c (GET_MAIN_STACKBASE_SPECIAL): Define when a specific
GC_get_main_stack_base implementation is defined.
* os_dep.c (GC_get_main_stack_base): Define that based on
GC_get_stack_base() in a single place (only if
GET_MAIN_STACKBASE_SPECIAL is unset); check GC_get_stack_base()
result.
* mark.c (GC_push_selected): Remove "push_fn" argument (use
GC_push_all directly); update the documentation.
* mark.c (GC_push_conditional): Simplify the code (for better
readability).
* mark.c (alloc_mark_stack): Use FALSE/TRUE (instead of 0/1) for
boolean local variables.
* doc/README.macros (GC_PREFER_MPROTECT_VDB): Update.
* os_dep.c (GC_page_was_dirty, GC_page_was_ever_dirty,
GC_remove_protection): Define for GWW_VDB and PROC_VDB in a single
place.
* os_dep.c (GC_page_was_dirty, GC_page_was_ever_dirty): Compute
PHT_HASH(h) only once (store result to a local variable).
* doc/README.solaris2: Update.
* include/private/gcconfig.h (end, InitStackBottom): Declare
extern variable for RTEMS.
* include/private/gcconfig.h (DATASTART, DATAEND, STACKBOTTOM):
Update (for RTEMS).
* include/private/gcconfig.h (DATAEND): Fix a typo in the macro
name (for RTEMS).
* tests/test.c (CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER):
Replace with CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER (for RTEMS).
* include/private/gcconfig.h (MPROTECT_VDB): Enable for Solaris in
single-threaded environment.
* include/private/gcconfig.h (MPROTECT_VDB): Undefine if PROC_VDB.
* tests/test.c (NUMBER_ROUND_UP): New macro.
* tests/test.c (check_heap_stats): Round up total expected heap
size to the nearest 4 MiB bound.
* tests/test.c (check_heap_stats): Print the current and expected
heap sizes in case of failure.
* checksums.c (GC_check_blocks, GC_check_dirty): Do log printing
only if GC_print_stats; print errors using GC_err_printf.
* checksums.c (GC_check_blocks): Join adjacent printf() calls into
a single one.
* pthread_support.c (pthread_join): Add assertion (check thread is
finished).
* pthread_support.c (GC_register_my_thread): Don't detach the
thread if invoked from the thread destructor.
* win32_threads.c (GC_register_my_thread): Likewise.
* win32_threads.c (GC_unregister_my_thread): Don't delete the
thread (just set FINISHED) if the thread is not detached (only if
GC_PTHREADS); add assertion (check the thread is not finished).
* tests/threadkey_test.c (main): Join some created threads.
* pthread_support.c (GC_delete_gc_thread): Rename "gc_id" local
variable to "t".
* win32_threads.c (GC_delete_gc_thread): Likewise.
* pthread_support.c (pthread_join, pthread_detach,
pthread_cancel): Rename "thread_gc_id" local variable to "t".
* win32_threads.c (GC_pthread_detach): Likewise.
* win32_threads.c (GC_delete_gc_thread): Remove "gc_nvid" local
variable.
* win32_threads.c (GC_pthread_join): Rename "joinee" local
variable to "t".
* pthread_stop_world.c (pthread_sigmask): Undefine even if not
DEBUG_THREADS.
* pthread_stop_world.c (GC_unblock_gc_signals): New function (only
if GC_EXPLICIT_SIGNALS_UNBLOCK).
* pthread_support.c (GC_unblock_gc_signals): New prototype.
* pthread_support.c (GC_register_my_thread_inner,
GC_register_my_thread): Call GC_unblock_gc_signals (only if
GC_EXPLICIT_SIGNALS_UNBLOCK); add comment.
* include/private/gcconfig.h (GC_EXPLICIT_SIGNALS_UNBLOCK): New
macro.
* pthread_stop_world.c (GC_suspend_handler_inner): Remove "dummy",
"sig" local variables; rename my_thread local variable to "self".
* tests/threadkey_test.c (LIMIT): Use smaller value (don't create
more than 30 in parallel by default).
* tests/threadkey_test.c (key_once, main): Work around for Solaris
PTHREAD_ONCE_INIT.
* tests/threadkey_test.c (LIMIT): Use smaller value for Solaris.
* dyn_load.c (GC_FirstDLOpenedLinkMap): Remove unused "r" local
variable.
* pthread_support.c (GC_unregister_my_thread_inner): Revert back
GC_remove_specific invocation; add a comment.
* include/private/thread_local_alloc.h (GC_remove_specific):
Revert back.
* specific.c (slow_getspecific): Cast qtid to AO_t.
* include/private/specific.h (key_create, setspecific,
remove_specific): Remove "extern" keyword.
* include/private/specific.h (getspecific): Change type of "qtid"
local variable to unsigned long.
* pthread_support.c (GC_check_tls): Fix "#endif" comment.
* include/gc.h (GC_REDIRECT_TO_LOCAL): Remove deprecated comment.
* include/private/thread_local_alloc.h (THREAD_LOCAL_ALLOC):
Remove redundant test of the macro.
* backgraph.c (add_edge): Recognize DEBUG_PRINT_BIG_N_EDGES macro.
* os_dep.c (GC_set_and_save_fault_handler): Recognize
SIGACTION_FLAGS_NODEFER_HACK macro.
* pthread_support.c (mark_mutex): Recognize GLIBC_2_1_MUTEX_HACK
macro.
* pthread_support.c (GC_acquire_mark_lock): Remove commented out
code.
* include/private/gc_priv.h (SUNOS5SIGS): Don't include
sys/siginfo.h on Linux.
* include/private/gcconfig.h (FORCE_WRITE_PREFETCH): New macro
recognized, force PREFETCH_FOR_WRITE to be defined on x86.
* include/private/gcconfig.h (USE_HPUX_FIXED_STACKBOTTOM): New
macro recognized (for HP/UX).
* os_dep.c (GC_gww_page_was_ever_dirty): Fix comment (for
GWW_VDB).
* os_dep.c (GC_dirty_init): Use memset() for GC_written_pages
resetting (for PROC_VDB).
* tests/threadkey_test.c: New file.
* tests/tests.am (TESTS, check_PROGRAMS): Add 'threadkey_test'.
* tests/tests.am (threadkey_test_SOURCES, threadkey_test_LDADD):
New variable.
* pthread_support.c (GC_unregister_my_thread_inner): Don't call
GC_remove_specific.
* include/private/thread_local_alloc.h (GC_remove_specific):
Remove (since it is empty for all targets).
* pthread_support.c (GC_record_stack_base): New inline function.
* win32_threads.c (GC_record_stack_base): Likewise.
* pthread_support.c (GC_register_my_thread_inner): Invoke
GC_record_stack_base.
* win32_threads.c (GC_register_my_thread_inner): Likewise.
* pthread_support.c (GC_register_my_thread): If thread is FINISHED
then call GC_record_stack_base, clear FINISHED, initialize
thread-local list and return success.
* win32_threads.c (GC_register_my_thread): Likewise.
* include/gc.h (GC_register_my_thread): Update documentation.
* include/private/thread_local_alloc.h (GC_thread_key): Likewise.
* thread_local_alloc.c (GC_malloc, GC_malloc_atomic): Join
adjacent "#ifdef".
* thread_local_alloc.c (GC_malloc_atomic): Call
GC_core_malloc_atomic (instead of GC_core_malloc).
* pthread_start.c (GC_start_rtn_prepare_thread): Change return
type to GC_thread.
* pthread_start.c (GC_inner_start_routine): Pass the current
thread descriptor to pthread_cleanup_push (same as in
win32_threads.c).
* pthread_stop_world.c (GC_push_all_stacks): Rename "me" local
variable to "self".
* win32_threads.c (GC_push_all_stacks): Likewise.
* pthread_stop_world.c (GC_suspend_all, GC_start_world): Rename
"my_thread" local variable to "self".
* pthread_support.c (GC_unregister_my_thread_inner): New static
function.
* pthread_support.c (GC_unregister_my_thread,
GC_thread_exit_proc): Use GC_unregister_my_thread_inner.
* win32_threads.c (GC_register_my_thread, GC_unregister_my_thread,
GC_do_blocking_inner): Rename "t" local variable to "thread_id".
* win32_threads.c (GC_wait_marker, GC_notify_all_marker): Rename
"id" local variable to "thread_id".
* pthread_support.c (GC_unregister_my_thread): Call pthread_self
only once.
* win32_threads.c (GC_pthread_start_inner): Likewise.
* pthread_support.c (GC_unregister_my_thread): Add debug output.
* win32_threads.c (GC_unregister_my_thread): Likewise.
* pthread_support.c (GC_register_my_thread,
GC_start_rtn_prepare_thread): Rename "my_pthread" local variable
to "self".
* include/gc.h (GC_HIDE_POINTER, GC_REVEAL_POINTER): Define
unconditionally (do not test GC_I_HIDE_POINTERS); update the
comment.
* include/gc.h (HIDE_POINTER, REVEAL_POINTER): Define as alias to
GC_HIDE/REVEAL_POINTER, respectively.
* include/private/gc_pmark.h (GC_I_HIDE_POINTERS): Do not define.
* include/private/gc_priv.h (GC_I_HIDE_POINTERS): Likewise.
* include/gc.h (GC_register_my_thread): Refine the comment.
* include/gc_inline.h (GC_MALLOC_WORDS, GC_CONS): Add missing
parentheses.
* include/gc_typed.h (GC_get_bit, GC_set_bit,
GC_CALLOC_EXPLICITLY_TYPED): Likewise.
* include/private/gcconfig.h (NO_GETCONTEXT): Add missing ')'.
* include/private/gcconfig.h (NO_GETCONTEXT): Do not use
getcontext(2) on m68k because it is not implemented there.
* alloc.c (GC_clear_a_few_frames): Use BZERO().
* mark_rts.c (GC_clear_roots, GC_rebuild_root_index): Likewise.
* reclaim.c (GC_start_reclaim): Likewise.
* blacklst.c (total_stack_black_listed): Remove "len" local
variable.
* dbg_mlc.c (GC_generate_random_valid_address): Replace "for"
statement with "do-while" one.
* dyn_load.c (GC_register_dynamic_libraries,
GC_register_dynlib_callback): Remove redundant parentheses.
* cord/cordxtra.c (CORD_from_file_lazy_inner): Suppress
"unused result" compiler warning for fread().
* os_dep.c (GC_write_fault_handler): Break when in_allocd_block
is set to true.
* dbg_mlc.c (GC_has_other_debug_info): Change return type to int;
return -1 if the object has (or had) debugging info but was
marked deallocated.
* include/private/dbg_mlc.h (GC_has_other_debug_info): Likewise.
* dbg_mlc.c (GC_has_other_debug_info): Update documentation;
remove "ohdr" local variable.
* dbg_mlc.c (GC_debug_free): Don't call GC_free if the object has
probably been deallocated.
* dbg_mlc.c (GC_debug_free): Don't actually free the object even
in the leak-finding mode if GC_findleak_delay_free.
* dbg_mlc.c (GC_check_leaked): New function (only unless
SHORT_DBG_HDRS).
* doc/README.environment (GC_FINDLEAK_DELAY_FREE): Document.
* doc/README.macros (GC_FINDLEAK_DELAY_FREE): Likewise.
* include/private/dbg_mlc.h (START_FLAG, END_FLAG): Use GC_WORD_C
on 64-bit architectures.
* include/private/dbg_mlc.h (NOT_MARKED): Remove redundant
parentheses.
* include/private/dbg_mlc.h (GC_HAS_DEBUG_INFO): Update (due to
GC_has_other_debug_info change).
* include/private/gc_priv.h (GC_findleak_delay_free): New global
variable declaration (unless SHORT_DBG_HDRS).
* misc.c (GC_findleak_delay_free): New global variable; recognize
GC_FINDLEAK_DELAY_FREE.
* misc.c (GC_init): Recognize GC_FINDLEAK_DELAY_FREE environment
variable (unless SHORT_DBG_HDRS).
* reclaim.c (GC_check_leaked): Declare (unless SHORT_DBG_HDRS).
* reclaim.c (GC_add_leaked): Don't add the object to leaked list
if marked as deallocated.
* dbg_mlc.c (GC_has_other_debug_info): Fix punctuation in the
comment.
* dbg_mlc.c (GC_FREED_MEM_MARKER): New macro.
* dbg_mlc.c (GC_debug_free): Use GC_FREED_MEM_MARKER.
* dbg_mlc.c (GC_smashed): Refine documentation.
* mark.c (GC_push_selected): Change dirty_fn return type to
GC_bool.
* os_dep.c (GC_page_was_ever_dirty): Make GC_INNER.
* reclaim.c (GC_reclaim_small_nonempty_block): Remove "kind"
local variable.
* reclaim.c (GC_reclaim_block): Pass true constant to
GC_reclaim_small_nonempty_block (instead of report_if_found).
* doc/README.autoconf: Update; fix a typo.
* include/private/gcconfig.h (GC_WORD_C): New macro.
* dbg_mlc.c (GC_store_debug_info_inner): Cast "linenum".
* dbg_mlc.c (GC_check_annotated_obj): Fix punctuation in the
comment.
* dbg_mlc.c (GC_print_smashed_obj): Add (and print) "msg"
argument.
* dbg_mlc.c (GC_debug_free, GC_print_all_smashed_proc): Pass
message to GC_print_smashed_obj.
* dbg_mlc.c (GC_debug_free): Call GC_size once.
* dbg_mlc.c (GC_debug_realloc): Calculate old_sz only if
allocation succeeded; remove unnecessary check for object is
smashed (since this is done in GC_debug_free); remove "clobbered"
local variable.
* dbg_mlc.c (GC_store_debug_info_inner, GC_store_debug_info):
Rename "integer" argument to "linenum"; change the type of the
argument to int.
* gcj_mlc.c (GC_store_debug_info): Likewise.
* dbg_mlc.c (GET_OH_LINENUM): New macro.
* dbg_mlc.c (GC_print_obj, GC_print_smashed_obj): Use
GET_OH_LINENUM; adjust print format specifier.
* dbg_mlc.c (GC_debug_malloc, GC_debug_malloc_ignore_off_page,
GC_debug_malloc_atomic_ignore_off_page,
GC_debug_generic_malloc_inner,
GC_debug_generic_malloc_inner_ignore_off_page,
GC_debug_malloc_stubborn, GC_debug_malloc_atomic,
GC_debug_malloc_uncollectable,
GC_debug_malloc_atomic_uncollectable): Remove unnecessary cast of
"i".
* gcj_mlc.c (GC_debug_gcj_malloc): Likewise.
* os_dep.c (GC_linux_stack_base): Rename to
GC_linux_main_stack_base.
* os_dep.c (GC_freebsd_stack_base): Rename to
GC_freebsd_main_stack_base; adjust error message.
* pthread_stop_world.c (GC_stop_init): Use GC_SEM_INIT_PSHARED
as an argument for sem_init().
* pthread_support.c (pthread_create): Likewise.
* pthread_support.c (pthread_create): Abort in case sem_init()
fails.
* include/private/gc_priv.h (GC_SEM_INIT_PSHARED): Define.
* tests/initsecondarythread.c: Include gcconfig.h; call GC_INIT
from main() if it should be done from the primordial thread only.
* alloc.c: Don't include sys/types.h for ArmCC.
* dyn_load.c: Likewise.
* os_dep.c: Likewise.
* mach_dep.c (_setjmp, _longjmp): Redirect to setjmp/longjmp for
ArmCC.
* mark.c (GC_noop): Define specially for ArmCC.
* include/private/gc_priv.h (GC_noop): Likewise.
* misc.c (GC_init): Don't test pointers comparison for ArmCC.
* misc.c: Don't include unistd.h for ArmCC.
* os_dep.c (pages_executable): Rename to GC_pages_executable;
make STATIC.
* os_dep.c (GC_unix_mmap_get_mem): Don't define for ArmCC.
* ptr_chck.c (GC_is_visible): Explicitly cast
(GC_DS_PER_OBJECT-GC_INDIR_PER_OBJ_BIAS) to word (to suppress
a compiler warning).
* include/private/gcconfig.h: Recognize __arm.
* include/private/gcconfig.h (HBLKPTR): Define for ArmCC.
* include/private/gcconfig.h (HBLKPTR): Add parentheses for
"bytes" argument.
* pthread_support.c (GC_get_nprocs): Don't define for Android.
* pthread_support.c (GC_dummy_thread_local): Don't test
GC_LINUX_THREADS.
* include/gc_config_macros.h (GC_ADD_CALLER, GC_RETURN_ADDR):
Define for Android.
* mach_dep.c (NO_GETCONTEXT): Move to gcconfig.h.
* os_dep.c (GC_write_fault_handler): Don't include ucontext.h if
NO_GETCONTEXT.
* include/private/gcconfig.h (GETPAGESIZE): Define as a sysconf
call for Android.
* include/private/gc_locks.h (WIN32_LEAN_AND_MEAN, NOSERVICE):
Define before including windows.h.
* include/private/gc_priv.h (WIN32_LEAN_AND_MEAN, NOSERVICE):
Likewise.
* include/private/thread_local_alloc.h (WIN32_LEAN_AND_MEAN,
NOSERVICE): Likewise.
* include/private/gc_priv.h (MS_TIME_DIFF): Avoid floating-point
arithmetics; add a comment.
* mark.c (GC_clear_hdr_marks): Don't test USE_MARK_BYTES.
* extra/setjmp_t.c (main): Don't test USE_MARK_BITS.
* include/private/gc_pmark.h (SET_MARK_BIT_EXIT_IF_SET): Likewise.
* include/private/gc_pmark.h (SET_MARK_BIT_EXIT_IF_SET): Remove
"mark_byte" local variable.
* include/private/gc_pmark.h (OR_WORD_EXIT_IF_SET): Add a comment
about that AO_or() is not used by GC unless USE_MARK_BITS
explicitly set.
* include/private/gc_priv.h (OR_WORD): Likewise.
* include/private/gc_pmark.h (INCR_MARKS): Remove trailing ';',
add parentheses.
* include/private/gc_priv.h (ONES): Define before use by
MAKE_COOLER.
* include/private/gc_priv.h (MARK_BITS_SZ): Define where used.
* include/private/gc_priv.h (OR_WORD): Don't define if
USE_MARK_BYTES.
* include/private/gcconfig.h (USE_MARK_BYTES); Remove duplicate
definition; simplify expression.
* os_dep.c (GC_get_maps): Always close the file.
* pthread_support.c (GC_get_nprocs): Likewise.
* os_dep.c (READ): Define similarly across the file (without
parameters).
* pthread_support.c (GC_get_nprocs): Use signed int type for "i"
and "len" local variables (since read() may return -1).
* include/private/gc_pmark.h (LONG_MULT): Add prefix/suffix
double underscore; add "volatile" for asm.
* include/private/gc_pmark.h (LONG_MULT): Add missing
parentheses.
* include/private/gc_priv.h (OR_WORD): Likewise.
* include/private/gc_priv.h (OR_WORD): Remove unnecessary brackets
and ';' symbol.
* os_dep.c (GC_get_stack_base): Implement for Android (same as
for Linux).
* pthread_support.c (GC_get_nprocs): Return 1 (instead of -1) if
failed to open "stat" file (not to issue a warning twice); update
the comment.
* pthread_support.c (GC_thr_init): Call sysconf() on Android to
get the number of CPUs.
* include/private/gc_priv.h (_GNU_SOURCE): Revert one of the
recent patches regarding this macro as the macro should be set
(to 1) before including any other system header.
* doc/README.environment (GC_INITIAL_HEAP_SIZE,
GC_MAXIMUM_HEAP_SIZE): Update.
* misc.c (GC_parse_mem_size_arg): Allow 'k', 'M', 'G' suffixes in
heap size specifier; return 0 if not a valid one.
* include/gc_cpp.h: Explicitly define inline one-argument delete
operator for Cygwin (as a workaround).
* tests/test_cpp.cc (main): Suppress compiler warnings about
"assigned value is unused".
* misc.c (GC_parse_mem_size_arg): New function.
* misc.c (GC_init): Use GC_parse_mem_size_arg().
* pthread_stop_world.c (tkill): Declare for Android.
* include/private/gc_priv.h (_GNU_SOURCE): Include features.h
first (except for NaCl) and then define the macro to 1 if not yet.
* tests/tests.am (TESTS, check_PROGRAMS): Add
'initsecondarythread'.
* tests/tests.am (initsecondarythread_SOURCES,
initsecondarythread_LDADD): New variable.
* dbg_mlc.c (GC_store_debug_info_inner): Always define; add
"const" to its string argument.
* dbg_mlc.c (GC_store_debug_info): Call GC_store_debug_info_inner.
* dbg_mlc.c (GC_debug_free): Set GC_have_errors in case of
smashed or previously deallocated found.
* dbg_mlc.c (GC_check_heap_block): Replace while loop with a for
one.
* reclaim.c (GC_reclaim_check): Likewise.
* dbg_mlc.c (GC_check_heap_proc): Remove redundant cast to word.
* os_dep.c (GC_get_stack_base): Don't initialize
stackbase_main_self/ss_sp on Solaris if thr_main() is zero (thus
calling GC_INIT() from a non-primordial thread is possible now).
* reclaim.c (GC_add_leaked): Turn into an inline one.
* reclaim.c (GC_reclaim_small_nonempty_block):
Change report_if_found type from int/word to boolean.
* include/private/gc_priv.h (GC_start_reclaim): Likewise.
* include/private/gc_priv.h (set_mark_bit_from_hdr,
clear_mark_bit_from_hdr): Place closing parenthesis properly.
* os_dep.c (GC_get_main_stack_base): Try to use
pthread_attr_getstack first for Linux if THREADS.
* doc/README.macros (USE_GET_STACKBASE_FOR_MAIN): Adjust text
alignment.
* dbg_mlc.c (GC_generate_random_backtrace_no_gc): Fix a message
typo.
* dbg_mlc.c (GC_debug_malloc): Add a comment (about zero size).
* dbg_mlc.c (GC_strdup): Call GC_err_printf instead of WARN (in
case of NULL argument).
* dbg_mlc.c (GC_free): In case of NULL argument, just return
(without any warning printed); eliminate "uncollectable" local
variable.
* configure.ac (THREADDLLIBS): Use alternate thread library on
Solaris 8.
* configure.ac (need_atomic_ops_asm): Set to true only for Sparc
Solaris.
* configure.ac: Don't use libdl on mips-sgi-irix6.
* mach_dep.c (NO_GETCONTEXT); Define for RTEMS.
* mach_dep.c (GC_with_callee_saves_pushed): Don't call
__builtin_unwind_init() for RTEMS; use setjmp() without the
leading underscore (for RTEMS).
* tests/test.c (BIG): Use smaller value for RTEMS.
* tests/test.c (main): Customize for RTEMS.
* configure.host: Remove doubled words in comments.
* os_dep.c: Likewise.
* doc/README: Likewise.
* extra/setjmp_t.c: Likewise.
* tests/huge_test.c: Likewise.
* extra/setjmp_t.c (getpagesize, nested_sp, main, g): Replace the
K&R-style function definition with the ANSI C one.
* extra/setjmp_t.c (nested_sp): Implement in the same way as
GC_approx_sp.
* dyn_load.c (GC_dyld_sections): Add more sctions.
* dyn_load.c (GC_dyld_add_sect_fmts): New static varaible.
* dyn_load.c (L2_MAX_OFILE_ALIGNMENT): New macro.
* dyn_load.c (GC_dyld_image_add, GC_dyld_image_remove): Improve
logging; add support for on-demand sections.
* gcj_mlc.c (GC_gcj_malloc_initialized): Use STATIC unless
GC_ASSERTIONS.
* include/private/gc_priv.h (GC_gcj_malloc_initialized): Don't
declare (as external) unless GC_ASSERTIONS.
* os_dep.c (GC_win32_free_heap): Clear GC_heap_bases[] also for
Cygwin; add FIXME.
* include/private/gcconfig.h: Include <sys/unistd.h> for RTEMS.
* include/private/gcconfig.h: Add "#error" for every "-->" mark.
* include/private/gcconfig.h (CLEAR_DOUBLE): Turn the code into
an expression.
* include/private/pthread_support.h (SUSPENDED_EXT): Add new flag
(which existed previously as SUSPENDED and still exists in GCJ).
* include/private/pthread_support.h (DISABLED_GC): Change the
value (as it is already used by SUSPENDED_EXT).
* tests/test.c (reverse_test): Modify count (BIG) for
ppc64-darwin.
* reclaim.c (GC_print_all_errors): Recognize new GC_ABORT_ON_LEAK
macro and environment variable; abort if any error has been
printed provided the environment variable (or macro) is set.
* doc/README.environment (GC_ABORT_ON_LEAK): Document.
* doc/README.macros (GC_ABORT_ON_LEAK): Likewise.
* os_dep.c (GC_unix_sbrk_get_mem, GC_unix_get_mem): Don't define
for RTEMS.
* include/private/gcconfig.h (RTEMS): Add support for.
* include/private/gcconfig.h (GET_MEM): Use calloc() for RTEMS.
* mallocx.c (GC_malloc_uncollectable): Move to malloc.c (since
it is used internally in some places).
* dbg_mlc.c (GC_register_finalizer_no_order): Remove redundant
declaration.
* dbg_mlc.c (GC_debug_malloc_replacement,
GC_debug_realloc_replacement): Rename RA to GC_DBG_RA.
* malloc.c (GC_debug_malloc_replacement): Likewise.
* mallocx.c (GC_debug_realloc_replacement): Likewise.
* dbg_mlc.c (GC_store_debug_info): Move proto from dbg_mlc.h.
* malloc.c (GC_strdup, GC_strndup, GC_wcsdup): Move to mallocx.c.
* malloc.c: Include errno.h only REDIRECT_MALLOC; remove redundant
includes of string.h.
* mallocx.c: Include string.h (for GC_strdup).
* include/private/dbg_mlc.h (GC_store_debug_info): Move declaration
to dbg_mlc.c.
* include/private/gc_locks.h (UNCOND_LOCK, UNCOND_UNLOCK): Remove
redundant trailing ';'.
* include/private/gc_priv.h (START_WORLD, COND_DUMP): Likewise.
* include/private/gc_locks.h (LOCK, UNLOCK): Place opening '{'
properly.
* include/private/gc_priv.h (GC_DBG_RA): Move from dbg_mlc.c,
malloc.c, mallocx.c.
* alloc.c (GC_check_heap, GC_print_all_smashed): Move the
definition from misc.c.
* dbg_mlc.c (GC_debug_malloc_atomic_uncollectable): Define as
public.
* include/gc.h (GC_debug_malloc_atomic_uncollectable): Declare.
* include/gc.h (GC_MALLOC_ATOMIC_UNCOLLECTABLE): Define new public
macro.
* dbg_mlc.c (MAX_SMASHED): Don't define if already set.
* reclaim.c (MAX_LEAKED): Likewise.
* dbg_mlc.c (GC_add_smashed): Add FIXME about the concurrent
access to the global array.
* reclaim.c (GC_add_leaked): Likewise.
* misc.c (GC_print_back_height): Set on if GC_PRINT_BACK_HEIGHT
(new macro) is defined.
* doc/README.macros (GC_PRINT_BACK_HEIGHT): Document.
* misc.c (GC_dump_regularly, GC_init): Replace 0/1 for
GC_dump_regularly and GC_print_back_height variables with
FALSE/TRUE.
* reclaim.c (GC_print_all_errors): Refine the comment.
* tests/test.c (reverse_test_inner): Undo one of the previous
patches which shifts "c" and "d" pointers only if
ALL_INTERIOR_POINTERS (since interior pointers are always
recognized in stacks).
* misc.c (GC_stdout, GC_stderr): Move the definition to the place
where GC_log is defined (Unix only).
* misc.c (GC_init): Recognize "GC_ONLY_LOG_TO_FILE" environment
variable and the similar macro; redirect GC_stdout and GC_stderr
to GC_log if "GC_LOG_FILE" environment variable is set unless
prohibited by GC_ONLY_LOG_TO_FILE (Unix only).
* doc/README.environment (GC_ONLY_LOG_TO_FILE): Document.
* doc/README.macros (GC_ONLY_LOG_TO_FILE): Likewise.
* misc.c (GC_stdout, GC_write): Rename GC_stdout to GC_log (Win32
only).
* misc.c (GC_write): Add for MacOS (and OS/2); change WRITE()
accordingly.
* misc.c (GC_printf): Check GC_quiet before va_start().
* allchblk.c (GC_freehblk): Use GC_log_printf instead of GC_printf
inside "if (GC_print_stats)" branch.
* alloc.c (GC_collect_or_expand): Likewise.
* dyn_load.c (GC_register_dynamic_libraries): Likewise.
* headers.c (GC_scratch_alloc): Likewise.
* os_dep.c (GC_get_maps, GC_remap, PROTECT,
GC_write_fault_handler, GC_dirty_init, GC_mprotect_thread): Likewise.
* alloc.c (min_bytes_allocd): Use GC_log_printf instead of
GC_printf for DEBUG_THREADS output.
* darwin_stop_world.c (GC_stack_range_for, GC_suspend_thread_list,
GC_stop_world, GC_thread_resume, GC_start_world): Likewise.
* pthread_start.c (GC_inner_start_routine): Likewise.
* pthread_stop_world.c (GC_suspend_handler, GC_restart_handler,
GC_push_all_stacks, GC_suspend_all, GC_stop_world,
GC_start_world): Likewise.
* pthread_support.c (GC_mark_thread, GC_get_nprocs,
GC_start_rtn_prepare_thread, pthread_create): Likewise.
* checksums.c (GC_update_check_page): Use GC_printf() instead of
GC_err_printf() for error printing.
* checksums.c (GC_check_blocks, GC_check_dirty): Use GC_log_printf
instead of GC_printf for logging purposes.
* dyn_load.c (sys_errlist, sys_nerr, errno): Move declaration of
external variable outside from GC_register_dynamic_libraries.
* dyn_load.c (GC_register_dynamic_libraries): Don't use
sys_errlist value if errno equals to sys_nerr.
* dyn_load.c (GC_register_dynamic_libraries): Use GC_log_printf
instead of GC_printf for DL_VERBOSE output.
* dyn_load.c (GC_dyld_image_add, GC_dyld_image_remove,
GC_init_dyld): Use GC_log_printf instead of GC_printf for
DARWIN_DEBUG output.
* os_dep.c (catch_exception_raise): Use GC_log_printf
instead of GC_printf for DEBUG_EXCEPTION_HANDLING output.
* reclaim.c (GC_print_free_list): Move "n" increment out of
GC_printf() call.
* win32_threads.c (DEBUG_CYGWIN_THREADS, DEBUG_WIN32_PTHREADS,
DEBUG_WIN32_THREADS): Remove.
* win32_threads.c (GC_register_my_thread_inner,
GC_win32_start_inner): Use GC_log_printf instead of GC_printf
inside "if (GC_print_stats)" branch.
* win32_threads.c (GC_PTHREAD_PTRVAL): New macro (defined only if
GC_PTHREADS).
* win32_threads.c (GC_delete_gc_thread, NUMERIC_THREAD_ID,
GC_pthread_join, GC_pthread_create): Use GC_PTHREAD_PTRVAL
macro.
* win32_threads.c (GC_push_stack_for, GC_mark_thread,
GC_CreateThread, GC_beginthreadex, GC_pthread_join,
GC_pthread_create, GC_pthread_start_inner, GC_thread_exit_proc,
GC_mark_thread_local_free_lists): Use GC_log_printf instead of
GC_printf for DEBUG_THREADS output.
* win32_threads.c (GC_win32_start_inner, GC_CreateThread,
GC_beginthreadex, GC_pthread_join, GC_pthread_create,
GC_pthread_start_inner, GC_thread_exit_proc): Cast
GetCurrentThreadId result to long; don't cast value of pthread_t
type to int; adjust printf format specifiers.
* doc/README.win32 (DEBUG_WIN32_PTHREADS): Remove obsolete
information.
* tests/test.c (cons, small_cons, gcj_cons, check_ints,
check_uncollectable_ints, print_int_list, check_marks_int_list,
fork_a_thread, finalizer, mktree, chktree, alloc8bytes,
alloc_small, tree_test, typed_test, check_heap_stats, WinMain,
test, main): Remove unnecessary casts of GC_printf calls to void.
* allchblk.c (GC_print_hblkfreelist): Adjust (make uniform across
BDWGC) printed message (adjust letters case, terminating dot and
new line symbols).
* alloc.c (GC_check_fl_marks): Likewise.
* backgraph.c (new_back_edges): Likewise.
* checksums.c (GC_check_dirty): Likewise.
* darwin_stop_world.c (GC_push_all_stacks,
GC_suspend_thread_list): Likewise.
* dbg_mlc.c (GC_print_type, GC_debug_free, GC_debug_realloc,
store_old): Likewise.
* dyn_load.c (GC_register_dynamic_libraries): Likewise.
* mark.c (GC_initiate_gc, GC_mark_some, GC_mark_from, GC_push_all,
GC_push_selected, GC_push_next_marked_dirty): Likewise.
* mark_rts.c (GC_exclude_static_roots_inner): Likewise.
* os_dep.c (GC_remap, GC_default_push_other_roots,
GC_push_thread_structures, GC_dirty_init, GC_read_dirty,
catch_exception_raise_state, catch_exception_raise_state_identity,
GC_mprotect_thread_notify, GC_mprotect_thread,
catch_exception_raise): Likewise.
* pthread_stop_world.c (GC_print_sig_mask, GC_push_all_stacks,
GC_stop_world, GC_stop_init): Likewise.
* pthread_support.c (GC_thr_init, GC_register_my_thread_inner,
GC_start_routine): Likewise.
* win32_threads.c (GC_register_my_thread_inner,
GC_push_all_stacks, GC_win32_start_inner, GC_pthread_join,
GC_pthread_start_inner): Likewise.
* alloc.c (GC_expand_hp_inner): Realign the code.
* mark.c (GC_mark_from, GC_mark_local, GC_do_parallel_mark):
Likewise.
* misc.c (GC_init): Likewise.
* os_dep.c (GC_dirty_init, GC_read_dirty): Likewise.
* include/private/gc_pmark.h (PUSH_CONTENTS_HDR): Likewise.
* tests/test.c (run_one_test): Likewise.
* misc.c (GC_err_puts): Document.
* misc.c (GC_err_write): Remove.
* os_dep.c (dump_maps): Likewise.
* include/private/gc_priv.h (GC_err_write): Likewise.
* os_dep.c (GC_print_address_map): Call GC_err_puts() instead of
dump_maps() and GC_err_write().
* os_dep.c (GC_read_dirty): Remove redundant brackets.
* tests/test.c (reverse_test_inner): Test interior pointer
recognition only if ALL_INTERIOR_POINTERS.
* tests/test.c (run_one_test): Replace GC_all_interior_pointers
with GC_get_all_interior_pointers(); simplify the expression.
* tests/test.c (check_heap_stats): Replace GC_bytes_allocd and
GC_bytes_allocd_before_gc with GC_get_total_bytes().
* tests/test.c (main): Replace GC_gc_no with GC_get_gc_no().
* dbg_mlc.c (GC_debug_strdup, GC_debug_free): Output a portability
warning if the argument is NULL and GC is in leaks detection mode.
* dbg_mlc.c (GC_debug_strndup, GC_debug_wcsdup): New public
function definition.
* malloc.c (GC_strndup, GC_wcsdup, strndup): Likewise.
* mallocx.c (GC_posix_memalign): Likewise.
* malloc.c (strdup): Fix string size value; rename "len" to "lb".
* mallocx.c: Include errno.h unless WinCE (otherwise include
windows.h for Win32 error constants).
* win32_threads.c: Define WIN32_LEAN_AND_MEAN and NOSERVICE before
windows.h inclusion.
* misc.c (GC_init): Register at-exit callback if GC_find_leak
(even if GC_FIND_LEAK macro is unset).
* pthread_stop_world.c (NACL_STORE_REGS,
__nacl_suspend_thread_if_needed, GC_nacl_initialize_gc_thread):
Use BCOPY() instead of memcpy().
* pthread_support.c (GC_init_real_syms): Likewise.
* doc/README.macros (GC_DEBUG_REPLACEMENT, GC_REQUIRE_WCSDUP):
Document new macro.
* doc/README.macros (REDIRECT_MALLOC): Update documentation.
* include/gc.h (GC_strndup, GC_posix_memalign, GC_debug_strndup):
New API function prototype.
* include/gc.h (GC_MALLOC, GC_REALLOC): Redirect to
GC_debug_malloc/realloc_replacement() if GC_DEBUG_REPLACEMENT.
* include/gc.h (GC_STRDUP): Remove redundant parentheses.
* include/leak_detector.h (realloc, strdup): Likewise.
* include/gc.h (GC_STRNDUP): New API macro.
* include/gc.h (GC_NEW, GC_NEW_ATOMIC, GC_NEW_STUBBORN,
GC_NEW_UNCOLLECTABLE): Add missing parentheses.
* include/gc.h (GC_wcsdup, GC_debug_wcsdup): New API function
prototype (only if GC_REQUIRE_WCSDUP).
* include/gc.h (GC_WCSDUP): New API macro (only if
GC_REQUIRE_WCSDUP).
* include/leak_detector.h: Include stdlib.h and string.h after gc.h (unless
GC_DONT_INCLUDE_STDLIB).
* include/leak_detector.h (malloc, calloc, free, realloc):
Undefine symbol before its redefinition.
* include/leak_detector.h (strndup, memalign, posix_memalign):
Redefine to the corresponding GC function.
* include/leak_detector.h (wcsdup): Redefine to GC_WCSDUP (only
if GC_REQUIRE_WCSDUP).
* include/leak_detector.h (CHECK_LEAKS): Add comment; don't define
the macro if already defined.
* misc.c (GC_abort): Use _exit() (instead of DebugBreak) on Win32
when doing code static analysis (to inform the tool that the
function is a no-return one).
* os_dep.c (GC_linux_stack_base): Remove a duplicate validation
of the length of "stat" file; use signed int type for "i",
"buf_offset" and "len" local variables (since read() may
return -1).
* blacklst.c (GC_bl_init_no_interiors): New function (the code
moved from GC_bl_init).
* blacklst.c (GC_bl_init): Invoke GC_bl_init_no_interiors unless
GC_all_interior_pointers mode; remove unnecessarily parameter cast
for GC_scratch_alloc call.
* include/private/gc_priv.h (GC_bl_init): Move the function
declaration to misc.c file.
* misc.c (GC_bl_init_no_interiors): Add a prototype.
* misc.c (GC_set_all_interior_pointers): Allow values other than 0
and 1; allow altering GC_set_all_interior_pointers value even
after GC initialization.
* obj_map.c (GC_initialize_offsets): Clear GC_valid_offsets and
GC_modws_valid_offsets if GC_all_interior_pointers is off.
* misc.c (GC_init): Don't call GC_initialize_offsets() unless
GC_all_interior_pointers mode.
* alloc.c (GC_finish_collection): Remove redundant brackets;
adjust code indentation.
* blacklst.c (GC_add_to_black_list_normal): Simplify expression
(to improve code readability).
* blacklst.c (GC_is_black_listed): Join nested "if" (into a single
conditional expression); initialize "nblocks" just before the loop
beginning.
* misc.c (GC_init): Don't compute initial_heap_sz if GC is already
initialized.
* include/private/gc_priv.h (GC_initialize_offsets): Move the
function declaration to misc.c file.
* obj_map.c (GC_initialize_offsets): Remove offsets_initialized
static variable since the function is called only once.
* tests/middle.c (main): Use setter for GC_all_interior_pointers;
adjust printf format specifier (and cast the value passed to).
* doc/README.macros (SMALL_CONFIG, LARGE_CONFIG): Refine the
documentation.
* include/private/gc_hdrs.h (LOG_BOTTOM_SZ): Ignore SMALL_CONFIG
if LARGE_CONFIG is defined.
* include/private/gc_priv.h (CPP_LOG_HBLKSIZE): Likewise.
* alloc.c (GC_finish_collection): Replace "#else #ifdef" with
"#elif".
* include/private/gc_priv.h (CPP_LOG_HBLKSIZE, LOG_PHT_ENTRIES,
MAX_ROOT_SETS, MAX_HEAP_SECTS): Likewise.
* alloc.c (GC_expand_hp_inner): Check for GC_collect_at_heapsize
overflow even if not LARGE_CONFIG.
* dbg_mlc.c (GC_check_heap_proc): Check "oh" size even if
SMALL_CONFIG.
* finalize.c (GC_print_finalization_stats): Fix "#endif" comment.
* doc/README.environment (GC_LOG_FILE, GC_PRINT_VERBOSE_STATS,
GC_FULL_FREQUENCY): Refine the documentation.
* extra/msvc_dbg.c: Test _MSC_VER macro; include "gc.h" (for
GC_word).
* extra/msvc_dbg.c (ULONG_PTR): Replace with GC_ULONG_PTR; define
as word.
* dbg_mlc.c (GC_get_back_ptr_info, GC_print_obj,
GC_print_smashed_obj, GC_debug_free_inner): Add a code for a
LINT-like tool to instruct it that the function is invoked only
with valid parameters (otherwise a SEGV is ok); recognize LINT2
new macro.
* misc.c (GC_abort): Instruct a LINT-like tool that the function
never returns in fact.
* os_dep.c (GC_linux_stack_base): Check for read buffer overflow;
close the file immediately after read; use STRTOULL() instead of
decoding the address number manually.
* include/private/gc_priv.h (EXPECT): Don't specify outcome for a
LINT-like tool.
* include/private/gc_priv.h (GC_all_interior_pointers): Instruct a
LINT-like tool that the value is restricted to zero and one only
(required since the variable is global and its value is used as a
part of array index expression is some places).
* dbg_mlc.c (GC_make_closure): Fix SEGV in case GC_malloc returns
NULL.
* dbg_mlc.c (GC_debug_register_finalizer,
GC_debug_register_finalizer_no_order,
GC_debug_register_finalizer_unreachable,
GC_debug_register_finalizer_ignore_self): Handle out of memory
case properly (similar to GC_register_finalizer_inner).
* headers.c (GC_install_header): Handle the case when alloc_hdr()
returns NULL.
* os_dep.c (GC_get_maps_len): Defend against missing "maps" file.
* pthread_support.c (GC_mark_thread): Place a dummy return
statement (which uses "id" argument) before the actual use of "id"
as an array index (to suppress a warning produced by some static
code analysis tools).
* win32_threads.c (GC_mark_thread): Likewise.
* pthread_support.c (GC_thr_init): Abort (with the appropriate
message) if out of memory.
* finalize.c (GC_register_finalizer_inner): Fix a typo in a
comment.
*include/private/gcconfig.h (STACKBOTTOM): Likewise.
* gcj_mlc.c (GC_core_gcj_malloc): Replace 0/1 with TRUE/FALSE in
EXPECT (the 2nd argument).
* malloc.c (GC_core_malloc_atomic, GC_core_malloc, GC_free):
Likewise.
* mark.c (GC_mark_and_push, GC_mark_and_push_stack): Likewise.
* thread_local_alloc.c (GC_malloc, GC_malloc_atomic): Likewise.
* include/private/gc_hdrs.h (HC_GET_HDR): Likewise.
* include/private/gc_priv.h (SMALL_OBJ): Likewise.
* include/private/specific.h (getspecific): Likewise.
* pthread_support.c (LOCK_STATS): Add a comment.
* include/gc_pthread_redirects.h (GC_NO_DLOPEN,
GC_NO_PTHREAD_SIGMASK, GC_PTHREAD_CREATE_CONST,
GC_PTHREAD_EXIT_ATTRIBUTE, GC_NO_PTHREAD_CANCEL): Move the
definition to gc_config_macros.
* pthread_support.c (pthread_cancel, GC_pthread_cancel_t,
GC_pthread_cancel): Test GC_NO_PTHREAD_CANCEL (instead of NACL and
GC_PTHREAD_EXIT_ATTRIBUTE).
* include/gc_pthread_redirects.h (GC_pthread_cancel,
pthread_cancel): Likewise.
* pthread_support.c (GC_pthread_create, GC_pthread_sigmask,
GC_pthread_join, GC_pthread_detach, GC_pthread_cancel): Realign
code.
* include/gc_pthread_redirects.h (GC_PTHREAD_EXIT_ATTRIBUTE):
Define as empty for NaCl.
* include/gc_pthread_redirects.h (GC_NO_PTHREAD_CANCEL): New macro
defined.
* dyn_load.c (GC_init_dyld): Do not invoke
_dyld_bind_fully_image_containing_address() if GC_no_dls (as it is
not required to register the main data segment in that case).
* include/gc.h (GC_no_dls): Adjust the comment.
* dyn_load.c (GC_MUST_RESTORE_REDEFINED_DLOPEN): Test
GC_NO_DLOPEN.
* gc_dlopen.c: Likewise.
* include/gc_pthread_redirects.h (GC_dlopen, dlopen): Likewise.
* gc_dlopen.c: Don't include dlfcn.h (as it is included in
gc_pthread_redirects.h).
* pthread_support.c (pthread_sigmask, GC_pthread_sigmask_t,
GC_pthread_sigmask): Test GC_NO_PTHREAD_SIGMASK (instead of
GC_DARWIN_THREADS, GC_OPENBSD_THREADS and NACL).
* include/gc_pthread_redirects.h (GC_pthread_sigmask,
pthread_sigmask): Likewise.
* win32_threads.c (pthread_sigmask, GC_pthread_sigmask): Test
GC_NO_PTHREAD_SIGMASK (instead of GC_WIN32_PTHREADS).
* pthread_support.c (pthread_create, GC_pthread_create_t,
GC_pthread_create): Rename GC_PTHREAD_CONST to
GC_PTHREAD_CREATE_CONST.
* win32_threads.c (GC_pthread_create): Likewise.
* include/gc_pthread_redirects.h: Likewise.
* include/gc_pthread_redirects.h (GC_NO_DLOPEN,
GC_NO_PTHREAD_SIGMASK): New macro defined.
* include/gc_pthread_redirects.h (GC_PTHREAD_CREATE_CONST): Set to
empty for NaCl.
* include/gc_pthread_redirects.h (GC_PTHREAD_EXIT_ATTRIBUTE): Do
not define for Android (as CANCEL_SAFE is not defined).
* include/gc.h (GC_ADD_CALLER, GC_RETURN_ADDR,
GC_HAVE_BUILTIN_BACKTRACE, GC_CAN_SAVE_CALL_STACKS): Move
definition to gc_config_macros.h file.
* include/gc_config_macros.h: Check the file is included from gc.h
file.
* include/gc_version.h: Likewise.
* gc_dlopen.c: Empty unit for NaCl.
* os_dep.c: Include fcntl.h for NaCl.
* os_dep.c (GC_get_main_stack_base): Ignore
USE_GET_STACKBASE_FOR_MAIN macro for NaCl.
* os_dep.c (GC_get_stack_base): Return GC_UNIMPLEMENTED for NaCl.
* os_dep.c (GC_remap): Use mmap (instead of mprotect) for NaCl.
* pthread_start.c (GC_inner_start_routine): Don't invoke
pthread_cleanup_push/pop for NaCl.
* pthread_stop_world.c (GC_nacl_num_gc_threads,
GC_nacl_thread_idx, GC_nacl_park_threads_now,
GC_nacl_thread_parker, GC_nacl_gc_thread_self,
GC_nacl_thread_parked, GC_nacl_thread_used,
GC_nacl_thread_parking_inited, GC_nacl_thread_alloc_lock): New
variable (fo NaCl only).
* pthread_stop_world.c (GC_remove_allowed_signals,
suspend_handler_mask, GC_stop_count, GC_world_is_stopped,
GC_retry_signals, SIG_THR_RESTART, GC_suspend_ack_sem,
GC_restart_ack_sem, GC_suspend_handler_inner, GC_suspend_handler,
GC_restart_handler): Don't define for NaCl.
* pthread_support.c (GC_get_nprocs): Likewise.
* include/private/gc_priv.h (SIG_SUSPEND): Likewise.
* include/private/gcconfig.h (LINUX): Likewise.
* pthread_stop_world.c (GC_push_all_stacks): Push register storage
for NaCl.
* pthread_stop_world.c (GC_suspend_all, GC_stop_world,
GC_start_world): Implement for NaCl.
* pthread_stop_world.c (GC_stop_world): Don't define unused "i"
local variable for OpenBSD (and NaCl).
* pthread_stop_world.c (NACL_STORE_REGS): New macro definition for
NaCl.
* pthread_stop_world.c (nacl_pre_syscall_hook,
__nacl_suspend_thread_if_needed, nacl_post_syscall_hook,
GC_nacl_initialize_gc_thread, GC_nacl_shutdown_gc_thread): New
function (for NaCl only).
* pthread_stop_world.c (GC_stop_init): Empty for NaCl.
* pthread_support.c (pthread_cancel, pthread_sigmask): Don't
redirect for NaCl.
* include/gc_pthread_redirects.h (pthread_cancel,
pthread_sigmask): Likewise.
* pthread_support.c (GC_nacl_initialize_gc_thread,
GC_nacl_shutdown_gc_thread): New internal prototype (NaCl only).
* pthread_support.c (GC_new_thread, GC_delete_thread): Initialize
and shutdown thread for NaCl.
* pthread_support.c (GC_thr_init): Call sysconf for NaCl.
* pthread_support.c (GC_pthread_exit): Call GC_thread_exit_proc
for NaCl.
* include/gc.h: Don't include features.h for NaCl.
* include/gc_pthread_redirects.h (GC_PTHREAD_CONST): New macro.
* include/gc_pthread_redirects.h (GC_pthread_create): Use
GC_PTHREAD_CONST instead of const.
* win32_threads.c (GC_pthread_create): Likewise.
* pthread_support.c (GC_pthread_create_t, GC_pthread_create,
pthread_create): Likewise.
* include/private/gcconfig.h (NACL): Recognize NaCl.
* include/private/gcconfig.h (GC_LINUX_THREADS): Valid for NaCl.
* include/private/pthread_stop_world.h (thread_stop_info): Add
reg_storage member; define NACL_GC_REG_STORAGE_SIZE macro (for
NaCl only).
* include/private/pthread_support.h (GC_nacl_gc_thread_self):
Declare internal variable (for NaCl only).
* mach_dep.c (GC_with_callee_saves_pushed): Fix FE_ALL_EXCEPT
macro.
* mark.c (GC_mark_some): Prefix and suffix "asm" and "volatile"
keywords with double underscore.
* os_dep.c (catch_exception_raise, catch_exception_raise_state,
catch_exception_raise_state_identity): Add GC_API_OSCALL to
function definition.
* os_dep.c (catch_exception_raise_state,
catch_exception_raise_state_identity): Move definition to be
before GC_ports.
* os_dep.c (catch_exception_raise): Declare to have the symbol
defined before GC_ports.
* os_dep.c (GC_ports): Store references to catch_exception_raise,
catch_exception_raise_state, catch_exception_raise_state_identity
(to prevent stripping these symbols as dead).
* os_dep.c (catch_exception_raise, catch_exception_raise_state,
catch_exception_raise_state_identity): Mark these symbols as
"referenced dynamically" via an assembler directive (unless
NO_DESC_CATCH_EXCEPTION_RAISE).
* include/private/gc_priv.h (GC_API_OSCALL): New macro (defined
similar to GC_API but as if GC_DLL is always defined).
* os_dep.c: Don't include signal.h for GC_write_fault_handler on
Win32.
* os_dep.c (SIG_OK): Don't return true unless SIGSEGV or SIGBUS on
FreeBSD.
* os_dep.c (CODE_OK): Use SEGV_ACCERR on FreeBSD (define
SEGV_ACCERR for older FreeBSD releases).
* dyn_load.c (GC_register_map_entries,
GC_register_dynamic_libraries_dl_iterate_phdr): Calculate
DATASTART only once if DATASTART_IS_FUNC.
* dyn_load.c (GC_register_dynamic_libraries_dl_iterate_phdr):
Calculate DATAEND only once if DATAEND_IS_FUNC.
* dyn_load.c: Add comment to some endif; realign some code.
* dyn_load.c (GC_init_dyld): Don't use
_dyld_bind_fully_image_containing_address if
NO_DYLD_BIND_FULLY_IMAGE defined; add FIXME.
* include/private/gcconfig.h (GC_data_start, GC_find_limit):
Declare if used by DATASTART/DATAEND, respectively.
* include/private/gcconfig.h (DATASTART_IS_FUNC, DATAEND_IS_FUNC):
Define if DATASTART/DATAEND is a function, respectively.
* include/private/gcconfig.h (GETPAGESIZE, NO_PTHREAD_TRYLOCK,
NO_DYLD_BIND_FULLY_IMAGE): Define for Darwin/arm as well; include
unistd.h.
* os_dep.c (GC_setpagesize, GC_task_self, PROTECT, UNPROTECT):
Reorder to remove redundant ifdef for Win32.
* os_dep.c: Add comment to some endif.
* os_dep.c: Include pthread.h (for Linux even if single-threaded)
if USE_GET_STACKBASE_FOR_MAIN; also include it for Darwin.
* os_dep.c (STACKBOTTOM): Redefine for Darwin (unless prohibited
for some reason).
* os_dep.c (GC_get_main_stack_base): Allow
USE_GET_STACKBASE_FOR_MAIN for Linux even if single-threaded; add
assertion for the returned result.
* os_dep.c (GC_get_stack_base): Define for Darwin if
multi-threaded.
* os_dep.c (SIG_OK, CODE_OK): Add comment (for FreeBSD).
* os_dep.c (ID_STOP, ID_RESUME): Define only if threads.
* os_dep.c (catch_exception_raise): Remove redundant parentheses;
refine the documentation.
* NT_MAKEFILE: Define _CRT_SECURE_NO_DEPRECATE for C++ files as
well.
* NT_STATIC_THREADS_MAKEFILE: Likewise.
* doc/README.macros (USE_GET_STACKBASE_FOR_MAIN): Refine.
* include/gc.h (GC_INIT): Document.
* include/private/gc_priv.h (GC_MACH_HEADER, GC_MACH_SECTION,
GC_GETSECTBYNAME): Define depending only on the word size (i.e.,
define these macros also for ARM).
* tests/test.c (check_heap_stats): Print main thread stack bottom
as well (only if verbose mode is on).
* mach_dep.c (GC_with_callee_saves_pushed): Fix and improve code
introduced by the previous patch (if GETCONTEXT_FPU_EXCMASK_BUG
and X86_64).
* darwin_stop_world.c (GC_FindTopOfStack): Prefix and suffix
"volatile" keyword with double underscore.
* mach_dep.c (GETCONTEXT_FPU_EXCMASK_BUG): Recognize new macro and
include fenv.h if defined (unless NO_GETCONTEXT or HAVE_PUSH_REGS).
* mach_dep.c (GC_with_callee_saves_pushed): Restore FPU exception
mask corrupted by getcontext if GETCONTEXT_FPU_EXCMASK_BUG.
* include/private/gcconfig.h (GETCONTEXT_FPU_EXCMASK_BUG): Define
for Linux/amd64 (since its GLibc getcontext currently has the bug).
* allchblk.c (GC_use_entire_heap): Change type to int (as declared
in gc.h); set the default value depending on new GC_USE_ENTIRE_HEAP
macro.
* misc.c (GC_init): Test GC_USE_ENTIRE_HEAP environment variable to
alter the default value of GC_use_entire_heap.
* doc/README.environment (GC_USE_ENTIRE_HEAP): Document.
* doc/README.macros (GC_USE_ENTIRE_HEAP): Likewise.
* include/private/gcconfig.h (PARALLEL_MARK): Do not make it cause
MPROTECT_VDB undefining.
* include/private/gcconfig.h (DYNAMIC_LOADING): Fix filename in
the comment.
* include/private/gc_priv.h (_GC_arrays): Move the conditional
macro definitions (shortcuts for GC_arrays members) into the
structure body.
* darwin_stop_world.c (GC_mach_handler_thread,
GC_use_mach_handler_thread,
GC_darwin_register_mach_handler_thread): Define only if
MPROTECT_VDB.
* darwin_stop_world.c (GC_suspend_thread_list): Use
GC_mach_handler_thread and GC_use_mach_handler_thread only if
MPROTECT_VDB.
* darwin_stop_world.c (GC_stop_world): Reset GC_mach_threads_count
only if defined (i.e. unless GC_NO_THREADS_DISCOVERY).
* misc.c (GC_init): Fix comment for GWW_VDB.
* os_dep.c (DARWIN_EXC_STATE, DARWIN_EXC_STATE_COUNT,
DARWIN_EXC_STATE_T, DARWIN_EXC_STATE_DAR): New macros.
* os_dep.c (catch_exception_raise): Use DARWIN_EXC_STATE,
DARWIN_EXC_STATE_COUNT, DARWIN_EXC_STATE_T, DARWIN_EXC_STATE_DAR.
* pthread_support.c (GC_thr_init): Define "dummy" local variable
only unless GC_DARWIN_THREADS.
* include/private/gcconfig.h (MPROTECT_VDB): Define for Darwin
even in the single-threaded mode; define for iPhone/iPad.
* include/private/gcconfig.h (IA64): Remove unnecessary "ifdef"
around "undef".
* include/private/gcconfig.h (HEURISTIC1): Remove unused for
Cygwin.
* include/private/gcconfig.h (STACKBOTTOM): Use fixed address for
Darwin/arm (instead of HEURISTIC1).
* misc.c (GC_write): Replace multiple "ifdef/endif" with "elif"
(for ECOS and NOSYS).
* os_dep.c (GC_get_main_stack_base): Likewise.
* os_dep.c (GC_get_main_stack_base): Check
USE_GET_STACKBASE_FOR_MAIN macro before checking STACKBOTTOM one;
remove "dummy" variable (use result one instead).
* doc/README.macros (SN_TARGET_PS3): Document.
* extra/threadlibs.c (main): Don't output "-lpthread" (and "-ldl")
for Android.
* include/private/pthread_support.h: Fix comment for "endif".
* misc.c (GC_allocate_ml): Define global variable if SN_TARGET_PS3.
* misc.c (GC_init): Initialize GC_allocate_ml if SN_TARGET_PS3.
* os_dep.c (SIGSEGV): Define to dummy zero if SN_TARGET_PS3.
* os_dep.c (GC_unix_mmap_get_mem): Don't define if SN_TARGET_PS3.
* os_dep.c (GC_default_push_other_roots,
GC_push_thread_structures): Define for SN_TARGET_PS3.
* include/private/gc_locks.h (GC_allocate_ml, LOCK, UNLOCK): Define
for SN_TARGET_PS3.
* include/private/gcconfig.h (SN_TARGET_PS3): Recognize new macro
(Sony PS/3 target).
* include/private/gcconfig.h (THREADS): Define unconditionally if
SN_TARGET_PS3.
* include/private/gcconfig.h (GET_MEM): Define for SN_TARGET_PS3.
* alloc.c (GC_collect_or_expand): Replace NIL with NULL in message.
* dbg_mlc.c (GC_debug_malloc, GC_debug_malloc_ignore_off_page,
GC_debug_malloc_atomic_ignore_off_page,
GC_debug_generic_malloc_inner,
GC_generic_malloc_inner_ignore_off_page, GC_debug_malloc_stubborn,
GC_debug_malloc_atomic, GC_debug_malloc_uncollectable,
GC_debug_malloc_atomic_uncollectable): Likewise.
* gcj_mlc.c (GC_debug_gcj_malloc): Likewise.
* dbg_mlc.c (GC_check_annotated_obj): Replace NIL with NULL in a
comment.
* dyn_load.c (GC_FirstDLOpenedLinkMap): Likewise.
* mark_rts.c (GC_roots_present): Likewise.
* doc/README: Likewise.
* include/private/gc_hdrs.h (IS_FORWARDING_ADDR_OR_NIL): Likewise.
* include/private/gc_priv.h (_GC_arrays): Likewise.
* configure.ac: Use AC_CHECK_LIB() to check for pthread instead of
just blindly linking to -lpthread, as Android includes pthread
support within libc and does not provide a separate libpthread.
* dyn_load.c (GC_register_dynamic_libraries): Skip current link map
entry if l_addr is NULL (Android/bionic only).
* pthread_stop_world.c (android_thread_kill): New internal function
(Android only).
* pthread_stop_world.c (GC_suspend_all, GC_start_world): Call
android_thread_kill (based on tkill) instead of pthread_kill on
Android (since pthread_kill cannot be used safely on the platform).
* pthread_support.c (GC_new_thread): Store thread Id (obtained from
gettid) for use by android_thread_kill (Android only).
* include/private/pthread_support.h (GC_Thread_Rep): Add kernel_id
structure member (Android only).
* include/private/gcconfig.h: Recognize __x86_64 macro as a synonym
of __x86_64__ (Darwin); define __environ macro (Android on M68K).
* allchblk.c (GC_freehblk): Print extended error message (done via
GC_printf() before aborting with a short message) only if
GC_print_stats.
* dyn_load.c (GC_register_dynamic_libraries): Likewise.
* os_dep.c (GC_get_maps, GC_register_data_segments, GC_remap,
PROTECT, GC_write_fault_handler, GC_mprotect_thread): Likewise.
* pthread_stop_world.c (GC_start_world): Likewise.
* win32_threads.c (GC_register_my_thread_inner): Likewise.
* os_dep.c (GC_get_main_stack_base, GC_register_data_segments,
GC_dirty_init): Remove redundant print of an error message before
aborting with the same message.
* os_dep.c (GC_register_data_segments): Remove format specifier
from the string passed to GC_err_puts(); use ABORT instead of EXIT
(if invalid executable type).
* os_dep.c (GC_remap): Adjust printf format specifier (for long
type).
* os_dep.c (GC_dirty_init): Print a message about SIG_IGN detected
(for SIGSEGV/BUS) only if GC_print_stats.
* os_dep.c (catch_exception_raise): Join 2 adjacent GC_err_printf
calls.
* tests/test.c (main): Print the relevant message if GWW_VDB.
* include/private/gcconfig.h: Don't define MPROTECT_VDB for Win32
on x64 if compiled by GCC.
* tests/staticrootstest.c: Include string.h for memset() prototype.
* tests/thread_leak_test.c (main): Fix printf() format specifiers.
* CMakeLists.txt: Check enable_parallel_mark on Darwin.
* configure.ac: Likewise.
* darwin_stop_world.c (DARWIN_SUSPEND_GC_THREADS,
DARWIN_QUERY_TASK_THREADS): Rename to GC_NO_THREADS_DISCOVERY and
GC_DISCOVER_TASK_THREADS, respectively.
* os_dep.c (DARWIN_SUSPEND_GC_THREADS): Likewise.
* pthread_support.c (DARWIN_SUSPEND_GC_THREADS): Likewise.
* darwin_stop_world.c (DARWIN_QUERY_TASK_THREADS): Don't define
(and remove FIXME).
* darwin_stop_world.c (GC_use_threads_discovery): Add GC_API;
comment; remove FIXME.
* win32_threads.c (GC_NO_DLLMAIN): Rename to
GC_NO_THREADS_DISCOVERY.
* tests/test.c (GC_NO_DLLMAIN): Likewise.
* doc/README.macros (GC_NO_DLLMAIN): Likewise.
* doc/README.win32 (GC_NO_DLLMAIN): Likewise.
* doc/README.macros (GC_NO_THREADS_DISCOVERY): Update the comment.
* win32_threads.c (GC_win32_dll_threads): Define as macro to true
if GC_DISCOVER_TASK_THREADS (and not GC_NO_THREADS_DISCOVERY);
update the comment.
* win32_threads.c (GC_use_DllMain): Rename to
GC_use_threads_discovery; do not set GC_win32_dll_threads if
GC_DISCOVER_TASK_THREADS.
* win32_threads.c (GC_started_thread_while_stopped,
GC_lookup_thread_inner, UNPROTECT_THREAD, GC_lookup_pthread,
GC_thr_init, GC_pthread_create, DllMain): Rewrite some expressions
which use GC_win32_dll_threads to minimize the possibility of
an "unreachable code" compiler warning when GC_win32_dll_threads
is defined as a macro.
* win32_threads.c (GC_unregister_my_thread): Don't call
GC_delete_thread() if GC_win32_dll_threads and THREAD_LOCAL_ALLOC
(since can't happen); use "t" local variable only if not
GC_win32_dll_threads.
* doc/README.macros (GC_DISCOVER_TASK_THREADS): Document.
* include/gc.h (GC_use_DllMain): Rename to
GC_use_threads_discovery but keep old name as a macro definition.
* include/gc.h (GC_use_threads_discovery): Declare also for
Darwin; update the comment.
* tests/test.c (main): Call GC_use_threads_discovery for Darwin
(to test the mode if possible).
* darwin_stop_world.c (DARWIN_SUSPEND_GC_THREADS,
DARWIN_QUERY_TASK_THREADS): New macro recognized.
* darwin_stop_world.c (GC_query_task_threads): add STATIC;
initialize to false; define as macro if DARWIN_SUSPEND_GC_THREADS
or DARWIN_QUERY_TASK_THREADS; remove FIXME.
* darwin_stop_world.c (GC_use_threads_discovery): New function
(for setting GC_query_task_threads value).
* darwin_stop_world.c (GC_mach_handler_thread,
GC_use_mach_handler_thread, GC_mach_thread, GC_MAX_MACH_THREADS,
GC_mach_threads, GC_mach_threads_count, GC_suspend_thread_list,
GC_darwin_register_mach_handler_thread): Define only if not
DARWIN_SUSPEND_GC_THREADS.
* darwin_stop_world.c (GC_stop_world, GC_start_world): Exclude
the code for GC_query_task_threads case from compilation unless
DARWIN_SUSPEND_GC_THREADS.
* os_dep.c (GC_darwin_register_mach_handler_thread): Declared only
if Darwin threads and not DARWIN_SUSPEND_GC_THREADS.
* os_dep.c (GC_mprotect_thread): Call
GC_darwin_register_mach_handler_thread only if THREADS and not
DARWIN_SUSPEND_GC_THREADS.
* pthread_support.c (marker_mach_threads): Don't define if
DARWIN_SUSPEND_GC_THREADS.
* pthread_support.c (GC_mark_thread): Don't fill in
marker_mach_threads if DARWIN_SUSPEND_GC_THREADS.
* include/private/gc_locks.h (GC_need_to_lock): Always declare for
THREADS case.
* darwin_stop_world.c (GC_query_task_threads): Don't define to
false for DARWIN_DONT_PARSE_STACK case; unconditionally initialize
the variable to false (for now).
* darwin_stop_world.c (GC_push_all_stacks): Call task_threads()
only if not DARWIN_DONT_PARSE_STACK.
* darwin_stop_world.c (GC_stop_world, GC_start_world): Use the
approach based on task_threads() only if GC_query_task_threads
else use GC_threads table.
* darwin_stop_world.c (GC_mach_threads): Remove static qualifier.
* darwin_stop_world.c (GC_stop_init): Remove (as we do not need to
really clear GC_mach_threads[]).
* darwin_stop_world.c (GC_stop_world): Reset GC_mach_threads_count
(instead of calling GC_stop_init).
* include/private/pthread_support.h (GC_stop_init): Remove proto.
* pthread_support.c (GC_stop_init): Add proto (unless Darwin).
* pthread_support.c (GC_thr_init): Don't call GC_stop_init() if
GC_DARWIN_THREADS.
* darwin_stop_world.c (GC_stack_range_for): New static function
(move the code from GC_push_all_stacks).
* darwin_stop_world.c (GC_push_all_stacks): Call
GC_stack_range_for(); rename kern_return local variable to
kern_result.
* darwin_stop_world.c (GC_is_mach_marker): Change argument type
from mach_port_t to thread_act_t.
* pthread_support.c (GC_is_mach_marker): Likewise.
* darwin_stop_world.c (GC_push_all_stacks): Fix "my_task" local
variable initialization (always call current_task()).
* pthread_support.c (GC_thr_init, GC_register_my_thread_inner):
Don't set thread's stop_info.stack_ptr value for Darwin.
* include/private/darwin_stop_world.h (thread_stop_info): Update
the comment for stack_ptr.
* darwin_stop_world.c (GC_push_all_stacks): Rename "r", "me" local
variables to "kern_return" and "my_thread" ones, respectively;
call mach_port_deallocate() unconditionally.
* darwin_stop_world.c (GC_stop_world): Don't call mach_thread_self
if DEBUG_THREADS.
* darwin_stop_world.c (GC_mach_thread): Move from
darwin_stop_world.h.
* include/private/darwin_stop_world.h (GC_mach_thread): Remove.
* win32_threads.c (GC_start_world): Define "thread_id" local
variable only if GC_ASSERTIONS; decide whether to resume a thread
based on its "suspended" field value; assert that suspended thread
stack_base is non-zero and the thread is not our one.
* darwin_stop_world.c (GC_thread_resume): New inline function
(move code from GC_thread_resume).
* darwin_stop_world.c (GC_start_world): Check result of
task_threads(); call GC_thread_resume().
* os_dep.c (GC_malloc_heap_l, GC_is_malloc_heap_base): Define
only if not CYGWIN32.
* os_dep.c (GC_is_heap_base): Call GC_is_malloc_heap_base() only
if not CYGWIN32.
* darwin_stop_world.c (FindTopOfStack): Change return type to
ptr_t (from long); make GC_INNER; add GC_ prefix.
* darwin_stop_world.c (GC_push_all_stacks): Add thread_blocked
local variable (initialized from the corresponding GC_thread
field unless GC_query_task_threads); add assertion that our
thread is not blocked; prefix FindTopOfStack with GC_ and remove
no longer needed cast to ptr_t of the result; handle thread
blocked case (and remove FIXME); use GC_push_all_stack_sections
unless GC_query_task_threads (and remove FIXME).
* pthread_support.c (GC_FindTopOfStack): Declare (if needed).
* pthread_support.c (GC_do_blocking_inner): Call
GC_save_regs_in_stack (if needed) before acquiring the lock.
* win32_threads.c (GC_do_blocking_inner): Likewise.
* pthread_support.c (GC_do_blocking_inner): Set/clear topOfStack
field of GC_thread (Darwin only).
* include/private/pthread_support.h (GC_thread): Add topOfStack
field for Darwin (unless DARWIN_DONT_PARSE_STACK).
* finalize.c (GC_check_finalizer_nested): Change return type to
char pointer (instead of int pointer); use explicit cast for
GC_finalizer_nested assignment.
* pthread_support.c (GC_check_finalizer_nested): Likewise.
* win32_threads.c (GC_check_finalizer_nested): Likewise.
* finalize.c (GC_finalizer_nested): Change type to unsigned char.
* finalize.c (GC_notify_or_invoke_finalizers): Change type of
"pnested" local variable to char pointer.
* pthread_support.c (GC_do_blocking_inner,
GC_call_with_gc_active): Use explicit cast for "thread_blocked"
field assignment.
* win32_threads.c (GC_lookup_pthread): Use explicit cast for
"suspended" field assignment.
* win32_threads.c (GC_Thread_Rep): Use short type for
finalizer_skipped; use char type for finalizer_nested and flags
fields and reorder some fields (to minimize GC_Thread_Rep
structure size).
* include/private/pthread_support.h (GC_Thread_Rep): Likewise.
* win32_threads.c (GC_Thread_Rep): Use char type for suspended
field (instead of GC_bool).
* include/private/pthread_support.h (GC_Thread_Rep): Use char type
for thread_blocked field (instead of short).
* darwin_stop_world.c (GC_query_task_threads): New variable (or
macro).
* darwin_stop_world.c (GC_push_all_stacks): Use
GC_query_task_threads (to choose between algorithms based on
kernel task_threads and based on GC_threads table); update FIXME;
remove commented out GC_push_one statements.
* pthread_support.c (GC_thr_init, GC_do_blocking_inner,
GC_call_with_gc_active, GC_register_my_thread_inner): Initialize
stack_ptr field for all platforms.
* pthread_support.c (GC_call_with_gc_active): Initialize
saved_stack_ptr field for all platforms.
* include/private/darwin_stop_world.h (thread_stop_info): Add
stack_ptr field; change type of already_suspended from int to
GC_bool.
* darwin_stop_world.c (GC_MAX_MACH_THREADS): New macro.
* darwin_stop_world.c (GC_mach_threads, GC_stop_init): Use
GC_MAX_MACH_THREADS instead of THREAD_TABLE_SZ.
* darwin_stop_world.c (GC_mach_threads): Add FIXME.
* darwin_stop_world.c (GC_stop_init, GC_suspend_thread_list,
GC_stop_world): Use FALSE and TRUE for already_suspended field and
"changed", "found" variables.
* darwin_stop_world.c (GC_is_mach_marker): New prototype (only if
PARALLEL_MARK).
* darwin_stop_world.c (GC_suspend_thread_list): Change return type
to GC_bool; change type of "changed", "found" to GC_bool; make
"my_thread" as an argument (instead of acquiring/deallocating it
locally); do not add my_thread, GC_mach_handler_thread and marker
threads to GC_mach_threads table; check for overflow of
GC_mach_threads table; increase GC_mach_threads_count if "found"
is true and info.suspend_count is non-zero.
* darwin_stop_world.c (GC_suspend_thread_list, GC_start_world):
Adjust "thread" format specifiers for GC_printf(); search thread
in "old_list" starting from the previous found one.
* darwin_stop_world.c (GC_stop_world): Rename "changes" to
"changed" local variable; remove "result" variable; adjust
GC_printf debugging message.
* darwin_stop_world.c (GC_start_world): Do not check for
my_thread and GC_use_mach_handler_thread (since they are not added
to GC_mach_threads table); call thread_info() only if
DEBUG_THREADS or GC_ASSERTIONS.
* pthread_support.c (marker_mach_threads): New static variable (if
Darwin).
* pthread_support.c (GC_is_mach_marker): New function (if Darwin).
* pthread_support.c (GC_mark_thread): Fill in marker_mach_threads
table (if Darwin).
* alloc.c (GC_parallel): Define only if THREADS.
* misc.c (GC_get_parallel): Likewise.
* include/gc.h (GC_parallel, GC_get_parallel,
GC_get_suspend_signal, GC_allow_register_threads,
GC_register_my_thread, GC_unregister_my_thread): Define only if
GC_THREADS.
* include/gc.h (GC_get_heap_size): Fix a typo in a comment.
* configure.ac: Use `AC_C_INLINE'.
* include/private/gc_priv.h (GC_INLINE): Use "inline" keyword
(determined by configure AC_C_INLINE) if HAVE_CONFIG_H is defined.
* dyn_load.c (DL_ITERATE_PHDR_STRONG): New macro (define for
FreeBSD).
* dyn_load.c (GC_register_main_static_data): Move the definition
above GC_register_dynamic_libraries_dl_iterate_phdr one (FreeBSD
case); unconditionally return FALSE if DL_ITERATE_PHDR_STRONG.
* dyn_load.c (GC_register_dynamic_libraries_dl_iterate_phdr): Test
GC_register_main_static_data() result (instead of direct testing
of dl_iterate_phdr (to prevent a compiler warning).
* os_dep.c (CODE_OK): Test si_code also for the value of 2
(FreeBSD case; required for FreeBSD v7+).
* os_dep.c (CODE_OK): Properly use parentheses (HPUX case).
* include/private/gcconfig.h (DATASTART): Cast etext argument in
GC_FreeBSDGetDataStart() call; remove unnecessary "&" (FreeBSD
case).
* include/private/specific.h (quick_thread_id): Define thru
GC_approx_sp(); define as a macro.
* include/private/specific.h (getspecific): Use GC_INLINE instead
of __inline__ (to work around Sun CC which does not recognize
inline keyword surrounded with underscores).
* darwin_stop_world.c (FindTopOfStack): Simplify condition
expressions.
* darwin_stop_world.c (GC_push_all_stacks): Merge two variants
of this function (DARWIN_DONT_PARSE_STACK).
* darwin_stop_world.c (GC_push_all_stacks): Add a check for our
thread is found (same as in pthread_stop_world.c).
* darwin_stop_world.c (GC_push_all_stacks): Print the number of
scanned threads if verbose (same as in pthread_stop_world.c).
* darwin_stop_world.c (GC_push_all_stacks): Reset
thread_state_count value before every thread_get_state call;
refine the comment for thread_state_count.
* darwin_stop_world.c (GC_push_all_stacks): Ignore rsp, rip/eip,
rflags, cs, fs, gs, ss, ds, es, __pc registers; uncomment ebp
register pushing.
* darwin_stop_world.c (GC_push_all_stacks): Set outCount to
GC_MACH_THREAD_STATE_COUNT (instead of THREAD_STATE_MAX).
* darwin_stop_world.c (GC_push_all_stacks): Remove FIXME and WARN
for i386.
* doc/README.macros (DARWIN_DONT_PARSE_STACK): Fix a typo.
* darwin_stop_world.c (GC_use_mach_handler_thread): Change type
to GC_bool.
* darwin_stop_world.c (GC_suspend_thread_list, GC_start_world):
Simplify the expressions involving GC_use_mach_handler_thread.
* darwin_stop_world.c (GC_darwin_register_mach_handler_thread):
Initialize GC_use_mach_handler_thread to TRUE (instead of 1).
* include/gc_pthread_redirects.h (GC_pthread_sigmask, GC_dlopen,
pthread_sigmask, dlopen): Don't define for Win32 pthreads (and
don't include signal.h and dlfcn.h).
* dyn_load.c (GC_register_dynlib_callback): Add FIXME.
* include/private/gcconfig.h: Add support for FreeBSD on ppc64.
* os_dep.c (PROTECT, UNPROTECT): Correct VM_PROT_EXEC to
VM_PROT_EXECUTE.
* os_dep.c (os2_alloc): Don't set PAG_EXECUTE unless
pages_executable is on.
* os_dep.c (os2_alloc): Add FIXME (for recursion).
* os_dep.c (UNPROTECT): Abort with a more informative message if
pages_executable is on ("mprotect" case).
* os_dep.c (PROTECT, UNPROTECT): Set VM_PROT_EXEC if
pages_executable is on (Darwin case).
* pthread_support.c (GC_init_real_syms): Abort with an informative
message if libgc is linked after libpthread.
* dyn_load.c (GC_register_dynlib_callback): Adjust "start" pointer
for 64-bit targets.
* pthread_support.c (start_mark_threads): Expand PTHREAD_CREATE
macro.
* pthread_support.c (start_mark_threads): Call INIT_REAL_SYMS()
since REAL(pthread_create) is used.
* pthread_support.c (PTHREAD_CREATE): Remove unused.
* extra/threadlibs.c (main): Remove --wrap for "read" (since not
wrapped anymore).
* doc/README.linux (GC_USE_LD_WRAP): Likewise.
* os_dep.c (__wrap_read): Likewise.
* include/gc_pthread_redirects.h: Test GC_PTHREADS and GC_H at the
beginning of the file.
* include/gc_pthread_redirects.h (GC_PTHREAD_EXIT_ATTRIBUTE): New
macro (defined only for Linux and Solaris).
* include/gc_pthread_redirects.h (GC_pthread_cancel,
GC_pthread_exit): Declare new API function (only if
GC_PTHREAD_EXIT_ATTRIBUTE).
* include/gc_pthread_redirects.h (pthread_cancel, pthread_exit):
Redirect (if GC_PTHREAD_EXIT_ATTRIBUTE).
* include/private/pthread_support.h (DISABLED_GC): New macro.
* pthread_support.c (pthread_cancel, pthread_exit): Restore
original definition or declare "real" function (if needed and
GC_PTHREAD_EXIT_ATTRIBUTE).
* pthread_support.c (GC_pthread_cancel_t, GC_pthread_exit_t):
Declare new types if needed.
* pthread_support.c (GC_pthread_cancel, GC_pthread_exit): New
function definition (only if GC_PTHREAD_EXIT_ATTRIBUTE).
* pthread_support.c (GC_init_real_syms): Initialize pointers to
the "real" pthread_cancel and pthread_exit (only if
GC_PTHREAD_EXIT_ATTRIBUTE).
* pthread_support.c (GC_unregister_my_thread): Enable collections
if DISABLED_GC was set (only if GC_PTHREAD_EXIT_ATTRIBUTE).
* pthread_support.c (pthread_cancel, pthread_exit): New wrapped
function definition (only if GC_PTHREAD_EXIT_ATTRIBUTE defined).
* pthread_support.c (GC_start_routine): Refine the comment.
* extra/threadlibs.c (main): Adjust --wrap (add "read",
"pthread_exit", "pthread_cancel" but remove "sleep").
* doc/README.linux (GC_USE_LD_WRAP): Likewise.
* include/gc.h (GC_MALLOC_STUBBORN): Remove trailing ';' in the
macro definition.
* include/gc.h (GC_reachable_here): Likewise.
* include/gc.h (GC_reachable_here): Prefix and postfix "volatile"
with double '_'.
* pthread_start.c: New file.
* CMakeLists.txt (SRC): Add pthread_start.c.
* Makefile.am (libgc_la_SOURCES): Likewise.
* Makefile.direct (CSRCS): Likewise.
* Makefile.direct (OBJS): Add pthread_start.obj.
* extra/gc.c: Add a comment; include pthread_start.c.
* pthread_support.c (start_info): Move the struct definition down
closer to its usage.
* pthread_support.c (GC_thread_exit_proc): Replace STATIC with
GC_INNER.
* pthread_support.c (GC_inner_start_routine): Move to the
definition to pthread_start.c; leave only the prototype; remove
STATIC.
* pthread_support.c (GC_start_rtn_prepare_thread): New function
(contains parts of the original GC_inner_start_routine).
* configure.ac (NO_EXECUTE_PERMISSION): Add comment.
* doc/README.macros (NO_EXECUTE_PERMISSION): Update the
documentation.
* include/gc.h (GC_set_pages_executable, GC_get_pages_executable):
New API function declaration.
* os_dep.c (OPT_PROT_EXEC): Remove (superseded by
pages_executable).
* os_dep.c (pages_executable): New static variable.
* os_dep.c (IGNORE_PAGES_EXECUTABLE): New macro (used by
GC_get_pages_executable only).
* os_dep.c (GC_unix_mmap_get_mem, GC_remap, PROTECT, UNPROTECT):
Replace OPT_PROT_EXEC with pages_executable.
* os_dep.c (GC_unix_mmap_get_mem, GC_remap, GC_win32_get_mem,
GC_wince_get_mem, UNPROTECT): Undefine IGNORE_PAGES_EXECUTABLE.
* os_dep.c (GC_win32_get_mem, GC_wince_get_mem, GC_remap, PROTECT,
UNPROTECT): Use PAGE_EXECUTE_... only if pages_executable is on.
* os_dep.c (GC_set_pages_executable, GC_get_pages_executable): New
API function definition.
* tests/test.c (check_heap_stats): Increase max_heap_sz by 20% for
64-bit CPUs (to prevent "Unexpected heap growth" failure on Win64,
at least).
* tests/test.c (check_heap_stats): Increase max_heap_sz by 25% for
32-bit CPUs (to prevent "Unexpected heap growth" failure).
* gc_dlopen.c (dlopen): Prototype REAL_DLFUNC if GC_USE_LD_WRAP.
* pthread_support.c (pthread_create, pthread_join, pthread_detach,
pthread_sigmask): Likewise.
* gc_dlopen.c (dlopen): Remove cast (redundant since the prototype
is added).
* gc_dlopen.c (GC_dlopen): Fix return type.
* pthread_support.c (GC_init_real_syms): Don't define
LIBPTHREAD_NAME, LIBPTHREAD_NAME_LEN, len, namebuf and
libpthread_name if RTLD_NEXT.
* gc_dlopen.c (disable_gc_for_dlopen): Update the comment.
* gc_dlopen.c (dlopen): Likewise.
* include/gc.h (GC_enable_incremental): Refine the comment.
* include/gc.h (DECLSPEC_NORETURN): Define macro as empty if
missing (only for Win32).
* include/gc.h (GC_ExitThread): Use DECLSPEC_NORETURN.
* win32_threads.c (GC_ExitThread): Likewise.
* include/gc.h (GC_endthreadex): Add a comment.
* include/cord.h: Fix typos.
* Makefile.am (EXTRA_DIST): Add "CMakeLists.txt" and
"tests/CMakeLists.txt".
* doc/doc.am (dist_pkgdata_DATA): Add "doc/README.cmake".
* mach_dep.c (NO_GETCONTEXT): Also define if AVR32.
* include/private/gcconfig.h (AVR32): New macro (also define the
supplementary macros for the target).
* include/private/thread_local_alloc (USE_COMPILER_TLS): Don't
define for AVR32.
* tests/leak_test.c (main): Explicitly define as returning int
(to prevent a spurious test failure on some Linux/alpha targets).
* tests/thread_leak_test.c (main): Likewise.
* tests/thread_leak_test.c: Initialize GC_find_leak in the main
thread (before GC_INIT) only.
* tests/leak_test.c (main): Use GC_set_find_leak() instead of
accessing GC_find_leak directly.
* tests/thread_leak_test.c (main): Likewise.
* include/gc.h (GC_find_leak, GC_finalize_on_demand,
GC_java_finalization, GC_dont_expand, GC_no_dls,
GC_dont_precollect): Simplify the comment (remove the information
about data races since the value is boolean).
* os_dep.c (GC_get_stack_base, GC_get_main_stack_base): New
Solaris-specific implementation (based on thr_stksegment).
* os_dep.c (stackbase_main_self, stackbase_main_ss_sp): New static
variable used by the Solaris-specific GC_get_stack_base().
* pthread_support.c (GC_mark_thread_local_free_lists,
GC_check_tls): Mark (and check) only for live threads (in case of
GC_destroy_thread_local() is called already but GC_delete_thread()
is not yet).
* win32_threads.c (GC_mark_thread_local_free_lists, GC_check_tls):
Likewise.
* NT_MAKEFILE: Remove the comment about DLL and Win32S.
* NT_STATIC_THREADS_MAKEFILE: Likewise.
* NT_X64_STATIC_THREADS_MAKEFILE: Likewise.
* NT_MAKEFILE: Add ".SUFFIXES" directive (to handle gc_cpp.cc
properly on VS 2005+).
* NT_MAKEFILE: Update GC log file name in comments.
* NT_STATIC_THREADS_MAKEFILE: Likewise.
* NT_X64_STATIC_THREADS_MAKEFILE: Likewise.
* NT_X64_THREADS_MAKEFILE: Likewise.
* doc/README.win32: Likewise.
* NT_MAKEFILE: Remove ":full" for "-debug" option (since no
longer supported by VS).
* NT_STATIC_THREADS_MAKEFILE: Likewise.
* NT_MAKEFILE: Commented out copying of gc_cpp.cc to gc_cpp.cpp.
* NT_STATIC_THREADS_MAKEFILE: Likewise.
* NT_X64_STATIC_THREADS_MAKEFILE: Likewise.
* NT_X64_THREADS_MAKEFILE: Likewise.
* NT_STATIC_THREADS_MAKEFILE: Add -D PARALLEL_MARK option.
* NT_STATIC_THREADS_MAKEFILE: Increase stack size for gctest.exe.
* NT_X64_STATIC_THREADS_MAKEFILE: Remove "-stack" option (use the
default stack size limit).
* NT_X64_THREADS_MAKEFILE: Rename "gc64_dll.dll" to "gc64.dll".
* win32_threads.c (GC_get_next_stack): Always define (since it is
also used for Cygwin now).
* alloc.c (GC_maybe_gc): Move GC_notify_full_gc() call upper to
be just before GC_clear_marks() call.
* include/gc_mark.h (GC_start_callback_proc): Refine the comment.
* Makefile.am (check_LTLIBRARIES): Initialize to empty.
* tests/tests.am (TESTS, check_PROGRAMS): Add staticrootstest.
* tests/tests.am (staticrootstest_SOURCES, staticrootstest_LDADD,
libstaticrootslib_la_SOURCES, libstaticrootslib_la_LIBADD,
libstaticrootslib_la_LDFLAGS, libstaticrootslib_la_DEPENDENCIES):
Define.
* tests/tests.am (check_LTLIBRARIES): Add libstaticrootslib.la.
* tests/staticrootstest.c: New file.
* tests/staticrootslib.c: Likewise.
* dyn_load.c (GC_get_next_stack, GC_cond_add_roots): Define for
Cygwin as well as other win32 targets.
* dyn_load.c (GC_wnt): Define to constant true.
* dyn_load.c (GC_register_dynamic_libraries): Define for Cygwin as
well as other win32 targets.
* mark_rts.c (rt_hash, GC_roots_present, add_roots_to_index):
Don't define for Cygwin, as on other win32.
* mark_rts.c (GC_add_roots_inner, GC_clear_roots): Handle on
Cygwin as for other win32 targets.
* mark_rts.c (GC_rebuild_root_index): Don't declare on Cygwin, as
other win32.
* mark_rts.c (GC_remove_tmp_roots): Do declare on Cygwin as on
other win32.
* mark_rts.c (GC_remove_roots, GC_remove_roots_inner): Don't
declare on Cygwin as on other win32.
* mark_rts.c (GC_is_tmp_root): Do declare on Cygwin when
!NO_DEBUGGING, as on other win32 targets.
* mark_rts.c (GC_cond_register_dynamic_libraries): Handle on
Cygwin as for other win32 targets.
* os_dep.c (GC_setpagesize): Handle on Cygwin as on other win32.
* os_dep.c (GC_get_main_stack_base): Don't declare on Cygwin, as
other win32.
* os_dep.c (GC_sysinfo): Declare on Cygwin, as other win32.
* os_dep.c (GC_win32_get_mem): Declare on Cygwin, as on other
Win32, but call GC_unix_get_mem instead of GlobalAlloc.
* os_dep.c (GC_win32_free_heap): Declare on Cygwin (as empty).
* ptr_chck.c (GC_is_visible): Register dynamic libraries on Cygwin
as on other win32 platforms.
* win32_threads.c (GC_get_next_stack): Define on Cygwin as well as
for dynamic loading targets.
* include/private/gc_priv.h (GC_INNER): Don't try to use
visibility on Cygwin which does not support it.
* include/private/gc_priv.h (struct roots): Don't declare r_next
member on Cygwin as on other windows hosts.
* include/private/gc_priv.h (LOG_RT_SIZE, RT_SIZE): Don't define
likewise.
* include/private/gc_priv.h (struct _GC_arrays): Do declare
_heap_bases[] member and don't declare _root_index likewise.
* include/private/gc_priv.h (GC_heap_bases): Do define likewise.
* include/private/gc_priv.h (_SYSTEM_INFO): Do forward-declare
likewise.
* include/private/gc_priv.h (GC_sysinfo): Do declare extern
likewise.
* include/private/gcconfig.h (GC_win32_get_mem, GET_MEM): Do
prototype on Cygwin as other win32 platforms.
* os_dep.c (GC_get_main_stack_base): Use pthread_getattr_np() and
pthread_attr_getstack() instead of GC_get_stack_base() (and check
returned stackaddr for NULL); output a warning on failure.
* alloc.c (GC_start_call_back): Replace the definition type to
GC_start_callback_proc.
* alloc.c (GC_set_start_callback, GC_get_start_callback): New
setter/getter function.
* alloc.c (GC_try_to_collect_inner): Call GC_notify_full_gc()
unconditionally (because GC_try_to_collect_inner always does full
GC).
* include/gc_mark.h (GC_start_callback_proc): New type.
* include/gc_mark.h (GC_set_start_callback,
GC_get_start_callback): New API function declaration.
* doc/README.macros (USE_GET_STACKBASE_FOR_MAIN): Document.
* os_dep.c (GC_get_main_stack_base): Recognize
USE_GET_STACKBASE_FOR_MAIN (only if THREADS and LINUX_STACKBOTTOM)
and use GC_get_stack_base() in this case.
* os_dep.c (GC_get_stack_base): Add LOCK/UNLOCK() (since
GC_find_limit_with_bound() should be called with the lock held).
* backgraph.c (FOR_EACH_PRED): Fix a typo.
* alloc.c (GC_set_stop_func, GC_get_stop_func): Add
DCL_LOCK_STATE.
* finalize.c (GC_notify_or_invoke_finalizers): Likewise.
* gc_dlopen.c (disable_gc_for_dlopen): Likewise.
* gcj_mlc.c (maybe_finalize, GC_debug_gcj_malloc): Likewise.
* mark.c (GC_print_trace): Likewise.
* misc.c (GC_set_warn_proc, GC_get_warn_proc, GC_enable,
GC_disable, GC_new_free_list, GC_new_kind, GC_new_proc,
GC_set_oom_fn, GC_get_oom_fn, GC_set_finalizer_notifier,
GC_get_finalizer_notifier): Likewise.
* os_dep.c (GC_get_stack_base, GC_print_callers): Likewise.
* pthread_support.c (GC_is_thread_tsd_valid,
GC_wait_for_gc_completion, GC_init_parallel, GC_do_blocking_inner,
GC_call_with_gc_active, GC_unregister_my_thread, pthread_join,
pthread_detach, GC_register_my_thread, GC_inner_start_routine,
pthread_create): Likewise.
* reclaim.c (GC_print_all_errors): Likewise.
* win32_threads.c (GC_is_thread_tsd_valid, GC_register_my_thread,
GC_unregister_my_thread, GC_do_blocking_inner,
GC_call_with_gc_active, GC_lookup_pthread, GC_pthread_join,
GC_pthread_start_inner, GC_thread_exit_proc, GC_pthread_detach,
GC_init_parallel): Likewise.
* doc/README.darwin: Update.
* CMakeLists.txt: Adjust INCLUDE_DIRECTORIES and SRC (to make it
usable on Mac OS X).
* doc/README.cmake: Update.
* CMakeLists.txt: New file (adding CMake support).
* tests/CMakeLists.txt: Likewise.
* doc/README.cmake: Likewise.
* configure.ac (darwin): Don't define HAS_PPC_THREAD_STATE...
macros.
* include/private/gc_priv.h (THREAD_FLD): Recognize
__DARWIN_UNIX03 instead of HAS_PPC_THREAD_STATE... macros.
* pthread_support.c: Include <sys/param.h> and <sys/sysctl.h> for
OpenBSD.
* pthread_support.c (get_ncpu): Define also for Darwin, NetBSD and
OpenBSD.
* pthread_support.c (GC_thr_init): Use get_ncpu() for Darwin,
NetBSD and OpenBSD.
* mallocx.c (GC_generic_malloc_many, GC_malloc_many): Define even
if THREADS is undefined.
* include/gc.h (GC_malloc_many): Update the comment.
* include/gc_cpp.h (GC_PLACEMENT_DELETE): Define for Embarcadero
(formerly known as Borland) C++ compiler v6.21+.
* include/gc_cpp.h (GC_NO_OPERATOR_NEW_ARRAY): Define for ancient
VC++ compilers.
* win32_threads.c (GC_register_my_thread_inner,
GC_pthread_start_inner): Undo the previous commit changes for
the thread flags and DETACHED state (since the state is only
tested in GC_thread_exit_proc).
* include/gc.h (GC_unregister_my_thread): Fix a typo; update the
comment.
* pthread_support.c (GC_delete_thread): Allow to delete the main
thread (don't call GC_INTERNAL_FREE for it); update the comment.
* win32_threads.c (GC_delete_thread): Likewise.
* pthread_support.c (GC_unregister_my_thread): Add an assertion
for FINISHED flag is unset.
* tests/test.c (check_heap_stats): Test the main thread
unregistering (only if THREADS).
* win32_threads.c (GC_register_my_thread_inner): Set flags to
DETACHED (only if GC_PTHREADS).
* win32_threads.c (GC_unregister_my_thread): Add FIXME (for
GC_wait_for_gc_completion).
* win32_threads.c (GC_pthread_start_inner): Clear flags detached
state if needed; set pthread_id and flags while holding the lock.
* include/private/gc_priv.h (SIG_SUSPEND): Don't define for
OpenBSD and Darwin.
* include/gc.h: Recognize _M_X64 (as an alias for _AMD64_).
* test.c (main, WinMain): Consistently don't invoke
GC_enable_incremental() if MAKE_BACKGRAPH is defined, but
do invoke it even if parallel marking is enabled.
* tests/test.c (reverse_test): Comment out a check for MSWIN32
(when determing BIG value) assuming outdated win32S.
* tests/test.c (reverse_test): Rename to reverse_test_inner;
change the declaration (to be of GC_fn_type); call itself thru
GC_call_with_gc_active() if the argument is zero.
* tests/test.c (reverse_test): New function added calling
reverse_test_inner thru GC_do_blocking (to test GC_do_blocking and
GC_call_with_gc_active).
* doc/README.macros (IGNORE_DYNAMIC_LOADING, PLATFORM_ANDROID):
Document.
* dyn_load.c: Don't include <elf.h> if PLATFORM_ANDROID.
* dyn_load.c: Include bionic <linker.h> (instead of <link.h>) if
PLATFORM_ANDROID.
* include/private/gcconfig.h (LINUX): Define also if
PLATFORM_ANDROID (for the windows-based toolkit).
* include/private/gcconfig.h (SEARCH_FOR_DATA_START): Explicitly
define for Android/x86 platform.
* include/private/gcconfig.h (IGNORE_DYNAMIC_LOADING): Recognize
new macro (undefine DYNAMIC_LOADING in this case).
* include/private/gcconfig.h (CANCEL_SAFE): Don't define if
PLATFORM_ANDROID.
* include/private/gcconfig.h (IF_CANCEL): Fix definition for the
explicitly defined CANCEL_SAFE.
* allchblk.c (GC_allochblk_nth): Don't call GC_remove_protection()
if GC_DISABLE_INCREMENTAL.
* reclaim.c (GC_reclaim_generic): Likewise.
* checksums.c (GC_page_was_ever_dirty): Add prototype.
* include/private/gc_locks.h (GC_mark_lock_holder): Don't declare
unless PARALLEL_MARK.
* include/private/gc_priv.h (GC_dirty_maintained,
GC_page_was_dirty, GC_remove_protection, GC_dirty_init): Don't
declare if GC_DISABLE_INCREMENTAL.
* include/private/gc_priv.h (GC_print_finalization_stats): Don't
declare if SMALL_CONFIG.
* include/private/gcconfig.h (CHECKSUMS): Explicitly undefine if
GC_DISABLE_INCREMENTAL (since nothing to check).
* include/private/gcconfig.h (DEFAULT_VDB): Don't define if
GC_DISABLE_INCREMENTAL.
* os_dep.c (GC_dirty_maintained): Likewise.
* mark.c (GC_initiate_gc): Don't call GC_read_dirty() if
GC_DISABLE_INCREMENTAL.
* os_dep.c (GC_gww_page_was_ever_dirty, GC_page_was_ever_dirty):
Uncomment; define only if CHECKSUMS.
* darwin_stop_world.c (GC_push_all_stacks): Fix a bug (call
GC_push_all_stack() instead of GC_push_all_stack_frames()).
* include/private/gc_priv.h (GC_push_all_stack_frames,
GC_push_all_register_frames): Rename to
GC_push_all_stack_sections and GC_push_all_register_sections,
respectively.
* mark_rts.c (GC_push_all_stack_frames,
GC_push_all_register_frames, GC_push_all_stack_part_eager_frames,
GC_push_current_stack): Likewise.
* pthread_stop_world.c (GC_push_all_stacks): Likewise.
* win32_threads.c (GC_push_stack_for): Likewise.
* misc.c (GC_call_with_gc_active): Rename "frame" local variable
to "stacksect".
* pthread_support.c (GC_call_with_gc_active): Likewise.
* win32_threads.c (GC_call_with_gc_active): Likewise.
* pthread_support.c (GC_call_with_gc_active): Update FIXME for
Darwin.
* win32_threads.c (GC_Thread_Rep): Update the comment for
traced_stack_sect.
* darwin_stop_world.c (GC_push_all_stacks): Rename
activation_frame to traced_stack_sect.
* include/private/gc_priv.h (GC_push_all_stack_frames,
GC_push_all_register_frames): Likewise.
* include/private/pthread_support.h (GC_Thread_Rep): Likewise.
* mark_rts.c (GC_push_all_register_frames,
GC_push_all_stack_frames, GC_push_all_stack_part_eager_frames,
GC_push_current_stack): Likewise.
* pthread_stop_world.c (GC_push_all_stacks): Likewise.
* pthread_support.c (GC_call_with_gc_active): Likewise.
* win32_threads.c (GC_Thread_Rep, GC_call_with_gc_active,
GC_push_stack_for): Likewise.
* include/private/gc_priv.h (GC_activation_frame_s): Rename to
GC_traced_stack_sect_s.
* include/private/gc_priv.h (GC_activation_frame): Rename to
GC_traced_stack_sect.
* misc.c (GC_activation_frame, GC_call_with_gc_active): Likewise.
* doc/README.macros (UNICODE): Document.
* doc/README.macros (GC_READ_ENV_FILE): Document (new macro).
* include/private/gc_priv.h (GETENV): Recognize GC_READ_ENV_FILE;
declare and use GC_envfile_getenv().
* misc.c (GC_envfile_content, GC_envfile_length): New static
variable (only if GC_READ_ENV_FILE).
* misc.c (GC_ENVFILE_MAXLEN): New macro (used in GC_envfile_init).
* misc.c (GC_envfile_init, GC_envfile_getenv): New function (only
if GC_READ_ENV_FILE).
* misc.c (GC_init): Call GC_envfile_init() (before using GETENV)
if GC_READ_ENV_FILE.
* misc.c (GC_init): Move GC_setpagesize() and GC_init_win32()
calls to be just before GC_envfile_init() one (since the latter
uses GET_MEM).
* misc.c (GC_abort): use ExitProcess() (instead of DebugBreak) for
WinCE if NO_DEBUGGING; add a comment for DebugBreak() (for WinCE).
* mark_rts.c (GC_add_roots_inner): Remove redundant trailing '\n'
from the ABORT message.
* misc.c (GC_init): Likewise.
* os_dep.c (GC_get_main_stack_base, GC_register_data_segments):
Likewise.
* pthread_stop_world.c (GC_push_all_stacks): Likewise.
* pthread_support.c (GC_init_real_syms, start_mark_threads):
Likewise.
* win32_threads.c (GC_get_next_stack): Don't define for Cygwin
(since unused for now).
* dyn_load.c (HAVE_REGISTER_MAIN_STATIC_DATA): Don't define unless
GC_register_main_static_data() is defined.
* dyn_load.c (GC_register_dynamic_libraries): Define only if used
(if DYNAMIC_LOADING or PCR or Win32/CE).
* dyn_load.c (GC_register_main_static_data): Define the default
one only if DYNAMIC_LOADING.
* include/private/gc_priv.h (GC_register_dynamic_libraries):
Declare only if used (to prevent compiler warning).
* mark_rts.c (GC_approx_sp): Add a comment (for GCC).
== [7.2alpha4] 2009-12-01 ==
* configure.ac (AC_CONFIG_COMMANDS): Quote srcdir value.
* include/gc.h (GC_get_suspend_signal): New function declaration.
* misc.c (GC_get_suspend_signal): New API function (only if
THREADS).
* alloc.c (min_bytes_allocd): Multiply GC_free_space_divisor by
two if GC_incremental (instead of TRUE_INCREMENTAL).
* sparc_mach_dep.S (GC_push_regs): Remove the reference.
* os_dep.c (SIZE_T, PULONG_PTR): Remove.
* os_dep.c (ULONG_PTR): Replace with GC_ULONG_PTR (defined as GC
"word"); add the comment.
* os_dep.c (GetWriteWatch_type, detect_GetWriteWatch,
GC_gww_read_dirty): Prefix ULONG_PTR with "GC_".
* win32_threads.c (THREAD_TABLE_SZ): Change back to a power-of-two
const value (for speed).
* win32_threads.c (THREAD_TABLE_INDEX): New macro.
* win32_threads.c (GC_new_thread, GC_lookup_thread_inner,
GC_delete_gc_thread, GC_delete_thread, GC_lookup_pthread): Use
THREAD_TABLE_INDEX instead of THREAD_TABLE_SZ.
* win32_threads.c (PTHREAD_MAP_HASH): Rename to PTHREAD_MAP_INDEX.
* win32_threads.c (THREAD_TABLE_SZ): Make the const value prime.
* backgraph.c: Remove apostrophe char from "#error".
* doc/README.macros (GC_DISABLE_INCREMENTAL): Document.
* include/private/gcconfig.h (GC_DISABLE_INCREMENTAL): Recognize
new macro; implicitly define it if SMALL_CONFIG.
* alloc.c (GC_incremental, GC_timeout_stop_func): Check for
GC_DISABLE_INCREMENTAL instead of SMALL_CONFIG.
* include/private/gc_priv.h (GC_incremental, TRUE_INCREMENTAL,
GC_push_conditional): Likewise.
* mark.c (GC_push_next_marked_dirty, GC_push_selected,
GC_push_conditional, GC_block_was_dirty): Likewise.
* misc.c (GC_enable_incremental): Likewise.
* misc.c (GC_init): Likewise.
* dyn_load.c (WIN32_LEAN_AND_MEAN): Guard with ifndef.
* misc.c (WIN32_LEAN_AND_MEAN): Likewise.
* os_dep.c (WIN32_LEAN_AND_MEAN): Likewise.
* allchblk.c (GC_allochblk_nth): Fix a minor typo (don't/doesn't)
in a comment.
* backgraph.c: Likewise.
* dyn_load.c (GC_register_dynamic_libraries): Likewise.
* extra/threadlibs.c (main): Likewise.
* pthread_support.c (pthread_join): Likewise.
* tests/test.c (main): Likewise.
* mach_dep.c (GC_push_regs): Remove STATIC (just to catch
a duplicate symbol definition linker error).
* misc.c (GC_clear_stack_inner): Likewise.
* sparc_mach_dep.S (GC_push_regs): Comment out the reference.
* include/private/gc_priv.h (GC_write_disabled): New variable
declaration (only if GC_ASSERTIONS and Win32 threads).
* misc.c (GC_write): Add assertion for GC_write_disabled value is
not on (only if THREADS).
* win32_threads.c (GC_write_disabled): New variable (only if
GC_ASSERTIONS and not Cygwin).
* win32_threads.c (GC_stop_world): Set and clear GC_write_disabled
(while holding GC_write_cs).
* win32_threads.c (GC_please_stop): If DllMain-based thread
registration is not compiled in then define GC_please_stop as
a non-volatile variable for assertion only.
* win32_threads.c (GC_stop_world): Set and clear only if defined.
* win32_threads.c (GC_stop_world): Add the comment for GC_printf()
usage (while holding GC_write_cs).
* win32_threads.c (GC_delete_gc_thread): Likewise.
* os_dep.c (GC_remove_protection): Likewise.
* pthread_support.c (GC_inner_start_routine): Join 3 sequential
GC_printf() calls into a single one (for DEBUG_THREADS).
* include/private/gc_priv.h (GC_total_stacksize): New variable
declaration (only if THREADS).
* alloc.c (GC_total_stacksize): New variable (only if THREADS).
* alloc.c (min_bytes_allocd): Calculate stack_size using
GC_stackbottom only in the single-threaded case; otherwise use
GC_total_stacksize; print GC_total_stacksize value if
DEBUG_THREADS.
* darwin_stop_world.c (GC_push_all_stacks): Use "%p" printf type
specifier for lo/hi values (instead of "%lx").
* darwin_stop_world.c (GC_push_all_stacks): Use
GC_push_all_stack_frames() instead of GC_push_all_stack().
* darwin_stop_world.c (GC_push_all_stacks): Recalculate
GC_total_stacksize value.
* pthread_stop_world.c (GC_push_all_stacks): Likewise.
* win32_threads.c (GC_push_all_stacks): Likewise.
* win32_threads.c (GC_push_stack_for): Pass "me" argument; return
stack size; don't check for non-zero value of thread->stack_base.
* win32_threads.c (GC_push_all_stacks): Don't call
GC_push_stack_for() and don't check for "t->id == me" if
thread->stack_base is zero.
* dyn_load.c (GC_dump_meminfo): Prefix "%lx" printf type specifier
with "0x".
* os_dep.c (PROTECT): Likewise.
* win32_threads.c (GC_mark_thread_local_free_lists): Cast p->id to
int (to match printf type specifier).
* tests/test.c (check_heap_stats): Take into account the unmapped
memory size when checking for "Unexpected heap growth"; remove
FIXME.
* alloc.c: Revert last change.
* include/private/gcconfig.h (STACKBOTTOM): Add a presence check
for eCos/NOSYS.
* misc.c (GC_write): Comment out _Jv_diag_write() call (since no
longer defined in GCJ).
* os_dep.c (brk): Rename to ecos_gc_brk.
* alloc.c (min_bytes_allocd): Use GC_stackbottom value to compute
stack_size even if THREADS.
* doc/README.macros (DEBUG_THREADS): Document.
* pthread_support.c (DEBUG_THREADS): Remove the commented out
definition.
* win32_threads.c (DEBUG_WIN32_THREADS): Remove duplicate
definition.
* win32_threads.c: Include errno.h (except for WinCE).
* win32_threads.c (GC_win32_start_inner): Copy "start" and "param"
to local variables, and free "arg" parameter before "start"
invocation.
* win32_threads.c (GC_beginthreadex): Set errno to EAGAIN on error
(instead of calling SetLastError(ERROR_NOT_ENOUGH_MEMORY)).
* win32_threads.c (GC_beginthreadex): Return 0 on error (instead
of -1).
* darwin_stop_world.c (GC_darwin_register_mach_handler_thread):
Use GC_INNER for the function definition.
* include/private/darwin_stop_world.h
(GC_darwin_register_mach_handler_thread): Remove the prototype.
* os_dep.c (GC_darwin_register_mach_handler_thread): Use GC_INNER
for the function prototype.
* include/private/gc_priv.h (NDEBUG): Explicitly define if
NO_DEBUGGING and not GC_ASSERTIONS (before the standard headers
inclusion).
* include/private/gcconfig.h: Move DebugBreak() workaround (for
x86mingw32ce toolchain) to gc_priv.h (after windows.h inclusion).
* allchblk.c (GC_unmap_old, GC_merge_unmapped, GC_allochblk,
GC_freehblk): Use GC_INNER for the function definition.
* alloc.c (GC_never_stop_func, GC_should_collect,
GC_try_to_collect_inner, GC_collect_a_little_inner,
GC_set_fl_marks, GC_add_to_our_memory, GC_add_to_heap,
GC_expand_hp_inner, GC_collect_or_expand, GC_allocobj): Likewise.
* backgraph.c (GC_build_back_graph, GC_traverse_back_graph):
Likewise.
* blacklst.c (GC_default_print_heap_obj_proc, GC_bl_init,
GC_promote_black_lists, GC_unpromote_black_lists,
GC_add_to_black_list_normal, GC_add_to_black_list_stack,
GC_is_black_listed): Likewise.
* darwin_stop_world.c (GC_push_all_stacks, GC_push_all_stacks,
GC_stop_init, GC_stop_world, GC_start_world): Likewise.
* dbg_mlc.c (GC_has_other_debug_info, GC_store_back_pointer,
GC_marked_for_finalization, GC_generate_random_backtrace_no_gc,
GC_store_debug_info, GC_start_debugging,
GC_debug_generic_malloc_inner,
GC_debug_generic_malloc_inner_ignore_off_page,
GC_debug_malloc_uncollectable, GC_debug_free_inner): Likewise.
* dyn_load.c (GC_register_dynamic_libraries,
GC_register_main_static_data, GC_init_dyld): Likewise.
* finalize.c (GC_push_finalizer_structures, GC_finalize,
GC_notify_or_invoke_finalizers, GC_print_finalization_stats):
Likewise.
* gcj_mlc.c (GC_core_gcj_malloc): Likewise.
* headers.c (GC_find_header, GC_header_cache_miss,
GC_scratch_alloc, GC_init_headers, GC_install_header,
GC_install_counts, GC_remove_header, GC_remove_counts,
GC_next_used_block, GC_prev_block): Likewise.
* mach_dep.c (GC_with_callee_saves_pushed): Likewise.
* malloc.c (GC_collect_or_expand, GC_alloc_large,
GC_generic_malloc_inner, GC_generic_malloc_inner_ignore_off_page,
GC_core_malloc_atomic, GC_core_malloc, GC_free_inner): Likewise.
* mallocx.c (GC_generic_malloc_ignore_off_page): Likewise.
* mark.c (GC_collection_in_progress, GC_clear_hdr_marks,
GC_set_hdr_marks, GC_set_mark_bit, GC_clear_mark_bit,
GC_clear_marks, GC_initiate_gc, GC_mark_some,
GC_mark_stack_empty, GC_invalidate_mark_state,
GC_signal_mark_stack_overflow, GC_mark_from, GC_help_marker,
GC_mark_init, GC_push_all, GC_push_conditional,
GC_mark_and_push_stack, GC_push_all_eager, GC_push_all_stack):
Likewise.
* mark_rts.c (GC_is_static_root, GC_roots_present, GC_approx_sp,
GC_exclude_static_roots_inner, GC_push_all_register_frames,
GC_push_all_stack_frames, GC_cond_register_dynamic_libraries,
GC_push_roots): Likewise.
* misc.c (GC_extend_size_map, GC_clear_stack, GC_err_write):
Likewise.
* new_hblk.c (GC_build_fl, GC_new_hblk): Likewise.
* obj_map.c (GC_register_displacement_inner, GC_add_map_entry,
GC_initialize_offsets): Likewise.
* os_dep.c (GC_get_maps, GC_parse_map_entry, GC_text_mapping,
GC_init_linux_data_start, GC_init_netbsd_elf, GC_setpagesize,
GC_set_and_save_fault_handler, GC_setup_temporary_fault_handler,
GC_reset_fault_handler, GC_get_register_stack_base, GC_init_win32,
GC_add_current_malloc_heap, GC_is_heap_base, GC_unmap, GC_remap,
GC_unmap_gap, GC_push_all_stacks, GC_gww_dirty_init,
GC_dirty_init, GC_read_dirty, GC_page_was_dirty,
GC_page_was_ever_dirty, GC_remove_protection,
GC_write_fault_handler, GC_mprotect_stop, GC_mprotect_resume,
GC_save_callers, GC_print_callers): Likewise.
* pthread_stop_world.c (GC_push_all_stacks, GC_stop_world,
GC_start_world, GC_stop_init): Likewise.
* pthread_support.c (GC_mark_thread_local_free_lists,
GC_lookup_thread, GC_reset_finalizer_nested,
GC_check_finalizer_nested, GC_segment_is_thread_stack,
GC_greatest_stack_base_below, GC_thr_init, GC_init_parallel,
GC_do_blocking_inner, GC_lock, GC_acquire_mark_lock,
GC_release_mark_lock, GC_wait_for_reclaim, GC_notify_all_builder,
GC_wait_marker, GC_notify_all_marker): Likewise.
* reclaim.c (GC_print_all_errors, GC_block_empty,
GC_reclaim_generic, GC_start_reclaim, GC_continue_reclaim,
GC_reclaim_all): Likewise.
* thread_local_alloc.c (GC_init_thread_local,
GC_destroy_thread_local, GC_mark_thread_local_fls_for): Likewise.
* win32_threads.c (GC_reset_finalizer_nested,
GC_check_finalizer_nested, GC_do_blocking_inner, GC_stop_world,
GC_start_world, GC_push_all_stacks, GC_get_next_stack,
GC_acquire_mark_lock, GC_release_mark_lock, GC_wait_for_reclaim,
GC_notify_all_builder, GC_wait_marker, GC_notify_all_marker,
GC_thr_init, GC_init_parallel, GC_lock,
GC_mark_thread_local_free_lists): Likewise.
* alloc.c (GC_add_current_malloc_heap, GC_build_back_graph,
GC_traverse_back_graph): Use GC_INNER for the function prototype.
* darwin_stop_world.c (GC_mprotect_stop, GC_mprotect_resume):
Likewise.
* dbg_mlc.c (GC_default_print_heap_obj_proc): Likewise.
* dyn_load.c (GC_parse_map_entry, GC_get_maps,
GC_segment_is_thread_stack, GC_roots_present, GC_is_heap_base,
GC_get_next_stack): Likewise.
* finalize.c (GC_reset_finalizer_nested,
GC_check_finalizer_nested): Likewise.
* gcj_mlc.c (GC_start_debugging): Likewise.
* include/private/dbg_mlc.h (GC_save_callers, GC_print_callers,
GC_has_other_debug_info, GC_store_debug_info): Likewise.
* include/private/gc_hdrs.h (GC_header_cache_miss): Likewise.
* include/private/gc_locks.h (GC_lock): Likewise.
* include/private/gc_pmark.h (GC_signal_mark_stack_overflow,
GC_mark_from): Likewise.
* include/private/pthread_support.h (GC_lookup_thread,
GC_stop_init): Likewise.
* include/private/thread_local_alloc.h (GC_init_thread_local,
GC_destroy_thread_local, GC_mark_thread_local_fls_for): Likewise.
* malloc.c (GC_extend_size_map, GC_text_mapping): Likewise.
* mark.c (GC_page_was_ever_dirty): Likewise.
* mark_rts.c (GC_mark_thread_local_free_lists): Likewise.
* misc.c (GC_register_main_static_data, GC_init_win32,
GC_setpagesize, GC_init_linux_data_start,
GC_set_and_save_fault_handler, GC_init_dyld, GC_init_netbsd_elf,
GC_do_blocking_inner): Likewise.
* os_dep.c (GC_greatest_stack_base_below): Likewise.
* win32_threads.c (GC_write_fault_handler, GC_gww_dirty_init):
Likewise.
* include/private/gc_priv.h: Likewise.
* include/private/gc_priv.h (GC_INNER): Update the comment.
* doc/README.macros (GC_DLL): Update.
* alloc.c (GC_collection_in_progress): Move the prototype to
gc_priv.h.
* gc_dlopen.c (GC_collection_in_progress): Likewise.
* pthread_support.c (GC_collection_in_progress): Likewise.
* misc.c (GC_init_parallel): Likewise.
* pthread_support.c (GC_init_parallel): Likewise.
* win32_threads.c (GC_init_parallel): Likewise.
* darwin_stop_world.c (GC_thr_init): Likewise.
* misc.c (GC_thr_init): Likewise.
* pthread_stop_world.c (GC_thr_init): Likewise.
* pthread_support.c (GC_thr_init): Likewise.
* blacklst.c (GC_clear_bl, GC_copy_bl,
GC_number_stack_black_listed): Make STATIC.
* dbg_mlc.c (GC_print_obj, GC_make_closure,
GC_debug_invoke_finalizer): Likewise.
* malloc.c (GC_alloc_large_and_clear): Likewise.
* mark.c (GC_push_selected, GC_push_marked1, GC_push_marked2,
GC_push_marked4, GC_push_marked, GC_push_next_marked,
GC_push_next_marked_dirty, GC_push_next_marked_uncollectable):
Likewise.
* misc.c (GC_clear_stack_inner): Likewise.
* os_dep.c (GC_repeat_read, GC_default_push_other_roots): Likewise.
* darwin_stop_world.c (FindTopOfStack): Make static; define only
if not DARWIN_DONT_PARSE_STACK.
* dbg_mlc.c (GC_debug_free_inner): Define only if DBG_HDRS_ALL.
* dyn_load.c (GC_repeat_read): Remove unused prototype.
* include/private/gc_pmark.h (GC_find_start): Likewise.
* misc.c (GC_read, GC_register_finalizer_no_order): Likewise.
* dyn_load.c (GC_segment_is_thread_stack): Add prototype (only if
THREADS).
* dyn_load.c (GC_register_main_static_data): Define only if
DYNAMIC_LOADING.
* finalize.c (GC_enqueue_all_finalizers): Remove unnecessary tail
"return" statement.
* gc_dlopen.c (GC_SOLARIS_THREADS): Don't recognize (since implies
GC_PTHREADS).
* include/gc.h: Fix a typo.
* include/gc_inline.h (GC_ASSERT): Define (if not defined) since
the header is public.
* include/gc_inline.h (GC_generic_malloc_many): New public
function declaration.
* mallocx.c (GC_generic_malloc_many): Make public.
* include/private/gc_priv.h (GC_INNER): Use visibility attribute
(if available).
* include/private/gc_priv.h (GC_EXTERN): Define using GC_INNER.
* include/private/gc_priv.h: Include atomic_ops.h if THREADS and
MPROTECT_VDB.
* os_dep.c: Don't include atomic_ops.h
* win32_threads.c: Likewise.
* include/private/gc_priv.h (GC_push_selected, GC_push_regs,
GC_push_marked, GC_number_stack_black_listed,
GC_alloc_large_and_clear, GC_reclaim_or_delete_all,
GC_generic_malloc_many, GC_make_closure,
GC_debug_invoke_finalizer, GC_print_obj, GC_page_was_ever_dirty):
Remove the prototype.
* mark.c (GC_page_was_ever_dirty): Add prototype (only if
PROC_VDB).
* include/private/gc_priv.h (GC_push_next_marked_dirty,
GC_push_next_marked, GC_push_next_marked_uncollectable): Move
the prototype to mark.c.
* include/private/gc_priv.h (GC_is_static_root): Declare only if
not THREADS.
* include/private/gc_priv.h (GC_free_inner): Declare only if
THREADS.
* include/private/gc_priv.h (GC_debug_free_inner): Declare only if
THREADS and DBG_HDRS_ALL.
* include/private/gc_priv.h (GC_markers): Declare GC_markers only
if PARALLEL_MARK.
* include/private/gc_priv.h (GC_register_main_static_data): Move
the prototype to misc.c.
* mach_dep.c (GC_push_regs): Make STATIC; define only along with
HAVE_PUSH_REGS definition.
* mach_dep.c (GC_clear_stack_inner): Replace K&R-style function
definition with the ANSI C one.
* mark.c (GC_started_thread_while_stopped): Declared only if not
GNU C.
* win32_threads.c (GC_started_thread_while_stopped): Don't define
if GNU C.
* mark.c (GC_mark_from): Avoid unbalanced brackets in
#if-#else-#endif blocks.
* mark_rts.c (GC_is_static_root): Define only if not THREADS.
* os_dep.c (GC_get_stack_base): Make public (for OpenBSD).
* os_dep.c (GC_page_was_ever_dirty): Comment out the function
except for PROC_VDB.
* tests/test.c (main): Don't reference GC_print_obj,
GC_make_closure, GC_debug_invoke_finalizer,
GC_page_was_ever_dirty, GC_is_fresh (in GC_noop).
* thread_local_alloc.c: Don't include "gc_inline.h".
* win32_threads.c (GC_write_fault_handler): Declare only if
MPROTECT_VDB.
* allchblk.c (DEBUG): Remove macro (since unused).
* allchblk.c: Include private/gc_priv.h before other includes and
definitions.
* alloc.c: Likewise.
* gc_dlopen.c: Likewise.
* headers.c: Likewise.
* mallocx.c: Likewise.
* mark_rts.c: Likewise.
* new_hblk.c: Likewise.
* reclaim.c: Likewise.
* mark.c: Include private/gc_pmark.h before other includes.
* misc.c: Likewise.
* dyn_load.c (_GNU_SOURCE): Move the definition to gc_priv.h.
* pthread_support.c (_USING_POSIX4A_DRAFT10): Likewise.
* pthread_support.c (_POSIX4A_DRAFT10_SOURCE): Remove (since
already defined in gc_config_macros.h).
* dyn_load.c (GC_init_dyld): Remove parameter cast for
_dyld_register_func_for_add_image() and
_dyld_register_func_for_remove_image(); add the comment about
possible warnings; add FIXME for the deprecated
_dyld_bind_fully_image_containing_address().
* include/private/gc_priv.h: Include gc.h before the standard
headers inclusion.
* tests/test.c: Likewise.
* include/private/gcconfig.h (DebugBreak): Update the comment.
* typd_mlc.c (ED_INITIAL_SIZE): Remove ';'.
* configure.ac (openbsd): Define GC_OPENBSD_THREADS.
* configure.ac: Add AM_CONDITIONAL(OPENBSD_THREADS).
* configure.ac: Add sparc-openbsd case.
* doc/README.macros (GC_NETBSD_THREADS, GC_OPENBSD_THREADS):
Document.
* tests/test.c (main): Handle OpenBSD case.
* include/private/pthread_stop_world.h: Likewise.
* extra/threadlibs.c (main): Replace K&R-style function definition
with the ANSI C one.
* extra/threadlibs.c (main): Handle GC_OPENBSD_THREADS case.
* dyn_load.c (OPENBSD): Recognize (similar to NETBSD).
* include/gc_config_macros.h (GC_SOLARIS_THREADS): Recognize;
define it for OpenBSD.
* include/gc_pthread_redirects.h (GC_pthread_sigmask,
pthread_sigmask): Don't declare and redefine for OpenBSD.
* include/private/gcconfig.h: Handle OpenBSD (on arm, sh, i386,
amd64, powerpc).
* mach_dep.c (NO_GETCONTEXT): Likewise.
* include/private/pthread_stop_world.h (thread_stop_info): Don't
define last_stop_count field if OpenBSD.
* misc.c (GC_init_dyld): Add declaration (if NetBSD).
* misc.c (GC_init): Don't call GC_init_netbsd_elf() for OpenBSD.
* os_dep.c (GC_init_netbsd_elf): Don't define for OpenBSD.
* os_dep.c (old_segv_act, GC_jmp_buf_openbsd): New static variable
(only if OpenBSD).
* os_dep.c (GC_fault_handler_openbsd, GC_find_limit_openbsd,
GC_skip_hole_openbsd): New static function (only if OpenBSD).
* os_dep.c (GC_get_stack_base, GC_get_main_stack_base,
GC_register_data_segments): Define specially for OpenBSD case.
* os_dep.c (GC_fault_handler_lock): Initialize to
AO_TS_INITIALIZER (instead of 0).
* pthread_support.c (GC_allocate_lock): Likewise.
* pthread_stop_world.c (NSIG, GC_print_sig_mask,
GC_remove_allowed_signals, suspend_handler_mask, GC_stop_count,
GC_world_is_stopped, GC_retry_signals, SIG_THR_RESTART,
GC_suspend_ack_sem, GC_suspend_handler_inner, GC_suspend_handler,
GC_restart_handler): Don't define and use if OpenBSD.
* pthread_stop_world.c (GC_suspend_all, GC_stop_world,
GC_start_world): Handle OpenBSD case.
* pthread_stop_world.c (GC_stop_init): Define as empty if OpenBSD.
* pthread_support.c (pthread_sigmask): Don't undefine the macro and
don't define the wrapper function if OpenBSD.
* pthread_support.c (GC_thr_init): Handle OpenBSD case.
* dyn_load.c: Move the inclusion of private/gc_priv.h below
definition of a feature macro (_GNU_SOURCE).
* include/gc.h (REVEAL_POINTER): Remove redundant parentheses.
* include/gc.h (GC_HIDE_POINTER, GC_REVEAL_POINTER): New macros
(only if GC_I_HIDE_POINTERS).
* backgraph.c (GET_OH_BG_PTR): Prefix REVEAL_POINTER() with "GC_".
* dbg_mlc.c (GC_get_back_ptr_info): Likewise.
* finalize.c (GC_grow_table, GC_dump_finalization, GC_finalize,
GC_enqueue_all_finalizers): Likewise.
* backgraph.c (SET_OH_BG_PTR): Prefix HIDE_POINTER() with "GC_".
* finalize.c (GC_general_register_disappearing_link,
GC_unregister_disappearing_link, GC_register_finalizer_inner,
GC_finalize): Likewise.
* include/private/dbg_mlc.h (HIDE_BACK_PTR): Likewise.
* include/private/dbg_mlc.h (GC_I_HIDE_POINTERS): Define instead
of I_HIDE_POINTERS.
* include/private/gc_priv.h (GC_I_HIDE_POINTERS): Likewise.
* include/gc.h (_GC_H): Strip leading underscore.
* include/gc_backptr.h (_GC_H): Likewise.
* include/gc_gcj.h (_GC_H): Likewise.
* include/gc_mark.h (_GC_H): Likewise.
* include/gc_typed.h (_GC_TYPED_H, _GC_H): Likewise.
* include/javaxfc.h (_GC_H): Likewise.
* include/new_gc_alloc.h (__GC_SPECIALIZE): Likewise.
* include/private/dbg_mlc.h (_GC_H): Likewise.
* include/private/gc_priv.h (_GC_H): Likewise.
* gc_cpp.cc: Include "gc_cpp.h" instead of <gc_cpp.h>.
* include/private/gc_priv.h (GC_INNER): New macro (for GC-scope
variable definitions).
* include/private/gc_priv.h (GC_EXTERN): Update the comment.
* allchblk.c (GC_unmap_threshold): Define as GC_INNER.
* alloc.c (GC_incremental, GC_world_stopped, GC_n_heap_sects,
GC_n_memory, GC_fail_count): Likewise.
* blacklst.c (GC_black_list_spacing, GC_print_heap_obj): Likewise.
* gcj_mlc.c (GC_gcj_malloc_initialized, GC_gcjobjfreelist): Likewise.
* mach_dep.c (GC_save_regs_ret_val): Likewise.
* mark.c (GC_n_mark_procs, GC_obj_kinds, GC_n_kinds,
GC_mark_stack, GC_mark_stack_limit, GC_mark_stack_size,
GC_mark_stack_top, GC_mark_state, GC_mark_stack_too_small,
GC_mark_no, GC_markers): Likewise.
* mark_rts.c (GC_root_size, GC_push_typed_structures): Likewise.
* misc.c (GC_allocate_ml, GC_debugging_started, GC_check_heap,
GC_print_all_smashed, GC_print_back_height, GC_dump_regularly,
GC_backtraces, GC_force_unmap_on_gcollect,
GC_large_alloc_warn_interval, GC_is_initialized, GC_write_cs,
GC_current_warn_proc, GC_blocked_sp, GC_activation_frame): Likewise.
* os_dep.c (GC_page_size, GC_dont_query_stack_min,
GC_no_win32_dlls, GC_wnt, GC_sysinfo, GC_push_other_roots,
GC_dirty_maintained, GC_fault_handler_lock): Likewise.
* pthread_support.c (GC_allocate_ml, GC_lock_holder,
GC_need_to_lock, GC_thr_initialized, GC_threads,
GC_in_thread_creation, GC_collecting, GC_allocate_lock,
GC_mark_lock_holder): Likewise.
* reclaim.c (GC_bytes_found, GC_fl_builder_count, GC_have_errors):
Likewise.
* win32_threads.c (GC_allocate_ml, GC_lock_holder,
GC_need_to_lock, GC_mark_lock_holder, GC_collecting): Likewise.
* extra/gc.c (GC_INNER, GC_EXTERN): Define as STATIC.
* mach_dep.c (GC_with_callee_saves_pushed): Remove redundant {}.
* include/private/gc_priv.h (GC_bytes_allocd, GC_objfreelist,
GC_aobjfreelist): Replace GC_EXTERN to extern for SEPARATE_GLOBALS
case (since they are not defined inside GC at present).
* include/private/gc_priv.h (GC_objects_are_marked): Remove the
declaration (since made static).
* mark.c (GC_objects_are_marked): Define as STATIC.
* win32_threads.c (GC_thr_initialized, GC_in_thread_creation):
Likewise.
* mark.c (GC_N_KINDS_INITIAL_VALUE): New macro (defined and used
to initialize GC_n_kinds).
* win32_threads.c (start_mark_threads): Adjust the comment.
* alloc.c (GC_notify_full_gc): Use GC_INLINE for a tiny static
function.
* backgraph.c (pop_in_progress, GC_apply_to_each_object): Likewise.
* mark_rts.c (add_roots_to_index): Likewise.
* extra/gc.c: New file.
* Makefile.am (EXTRA_DIST): Add "extra/gc.c".
* misc.c (GC_log): Remove the declaration; move the definition (to
the place where it is used); make STATIC.
* misc.c (GC_init): Use GC_err_printf() instead of GC_log_printf()
to print open log failure.
* misc.c (GC_write): Don't abort on open log failure if the GC is
compiled with GC_PRINT_VERBOSE_STATS (useful for WinCE).
* include/private/gcconfig.h (USE_MMAP): Guard with ifndef.
* allchblk.c (GC_fail_count, GC_large_alloc_warn_interval): Move
the variable declaration to gc_priv.h.
* alloc.c (GC_bytes_found, GC_unmap_threshold,
GC_force_unmap_on_gcollect): Likewise.
* dyn_load.c (GC_no_win32_dlls, GC_wnt): Likewise.
* finalize.c (GC_fail_count): Likewise.
* include/private/gc_locks.h (GC_allocate_ml, GC_lock_holder,
GC_collecting, GC_mark_lock_holder, GC_need_to_lock): Likewise.
* include/private/gc_pmark.h (GC_n_mark_procs, GC_mark_stack_size,
GC_mark_stack_limit, GC_mark_stack_top, GC_mark_stack,
GC_mark_stack_too_small, GC_mark_state): Likewise.
* include/private/pthread_support.h (GC_threads,
GC_thr_initialized, GC_in_thread_creation): Likewise.
* mallocx.c (GC_bytes_found): Likewise.
* mark_rts.c (GC_save_regs_ret_val, GC_world_stopped): Likewise.
* misc.c (GC_unmap_threshold): Likewise.
* os_dep.c (GC_unmap_threshold): Likewise.
* pthread_support.c (GC_markers): Likewise.
* thread_local_alloc.c (GC_gcjobjfreelist,
GC_gcj_malloc_initialized, GC_gcj_kind): Likewise.
* win32_threads.c (GC_fault_handler_lock, GC_write_cs,
GC_dont_query_stack_min, GC_markers, GC_wnt): Likewise.
* include/private/gc_priv.h (GC_EXTERN): New macro (used mostly as
a tag for now); defined after "gcconfig.h" inclusion.
* include/private/gc_priv.h: Use GC_EXTERN instead of "extern"
keyword for most global variables.
* alloc.c (GC_copyright): Add the comment about the symbol
visibility.
* finalize.c (GC_fo_entries): Likewise.
* include/private/gc_priv.h (GC_print_stats): Likewise.
* misc.c (GC_quiet): Likewise.
* mallocx.c (GC_bytes_allocd_tmp): Make the volatile variable
STATIC.
* pthread_support.c (GC_threads): Add explicit zero initializer
(to make the variable definition differ from the declaration).
* backgraph.c (GC_quiet): Remove the declaration (not needed
anymore since gc_priv.h is always included).
* checksums.c (GC_quiet): Likewise.
* gcj_mlc.c (GC_quiet): Likewise.
* headers.c (GC_hdr_cache_hits, GC_hdr_cache_misses): Add the
comment.
* include/private/gc_hdrs.h (GC_hdr_cache_hits,
GC_hdr_cache_misses): Likewise.
* mark.c (GC_first_nonempty): Make the volatile variable STATIC.
* pthread_stop_world.c (GC_stop_count, GC_world_is_stopped):
Likewise.
* win32_threads.c (GC_please_stop, GC_max_thread_index,
GC_mark_mutex_waitcnt): Likewise.
* pthread_support.c (GC_USE_LD_WRAP): Fix a typo (swapped 'L' and
'D') in the name.
* gc_dlopen.c (GC_MUST_RESTORE_REDEFINED_DLOPEN): Define if dlopen
redirection is turned off; turn it on later when dlopen real
symbol is no longer needed (according to the comment and the same
as in dyn_load.c).
* gc_dlopen.c (WRAP_FUNC, REAL_FUNC): Rename to WRAP_DLFUNC and
REAL_DLFUNC, respectively (to have unique names since the
definitions may differ from that of the similar ones in
pthread_support.c).
* mark.c (source): Undefine the macro when no longer needed.
* os_dep.c (handler): Rename the type to GC_fault_handler_t (to
have the unique name across the project).
* os_dep.c (STAT_BUF_SIZE, STAT_READ); Guard with ifndef; add the
comment.
* pthread_support.c (STAT_BUF_SIZE, STAT_READ): Likewise.
* os_dep.c (sbrk): Undo sbrk() redirection (for ECOS) when no
longer needed.
* pthread_stop_world.c (pthread_sigmask): Undefine before using
in GC_print_sig_mask() (only if DEBUG_THREADS); add the comment.
* win32_threads.c (dlopen, _beginthread): Don't undefine (since
neither redirected nor used here).
* win32_threads.c (GC_Thread_Rep): Rename "table_management" to
"tm" for short; remove "tm_" prefix.
* win32_threads.c (in_use, next): Don't define the macros; use
tm.in_use and tm.next fields, respectively (to ease debugging).
* win32_threads.c (HASH): Rename to PTHREAD_MAP_HASH (to have
unique name across the project).
* include/private/gc_priv.h (I_HIDE_POINTERS): Define before gc.h
inclusion.
* include/private/gc_pmark.h (I_HIDE_POINTERS): Define if gc.h is
not included yet.
* finalize.c (I_HIDE_POINTERS): Don't define.
* include/private/dbg_mlc.h (I_HIDE_POINTERS): Likewise.
* misc.c (I_HIDE_POINTERS): Likewise.
* include/private/dbg_mlc.h (HIDE_POINTER, REVEAL_POINTER,
GC_hidden_pointer): Don't define if HIDE_POINTER is undefined.
* include/private/gc_pmark.h: Remove the comment about gc_priv.h
inclusion order.
* dyn_load.c: Include gc_priv.h before using configuration
information (MACOS).
* dyn_load.c (GC_must_restore_redefined_dlopen): Rename to
GC_MUST_RESTORE_REDEFINED_DLOPEN.
* backgraph.c (SET_OH_BG_PTR): Place outermost parenthesis
properly.
* darwin_stop_world.c: Replace "if DEBUG_THREADS" with
"ifdef DEBUG_THREADS".
* pthread_stop_world.c: Likewise.
* pthread_support.c: Likewise.
* include/gc_inline.h: Guard with GC_INLINE_H.
* alloc.c (GC_copyright): Define as const.
* alloc.c (GC_collect_at_heapsize): Replace "static" with "STATIC"
(since the name starts with "GC_" prefix).
* dbg_mlc.c (GC_describe_type_fns): Likewise.
* dyn_load.c (GC_FirstDLOpenedLinkMap,
GC_register_dynlib_callback, GC_dyld_sections,
GC_dyld_name_for_hdr, GC_dyld_image_add, GC_dyld_image_remove):
Likewise.
* malloc.c (GC_libpthread_start, GC_libpthread_end,
GC_libld_start, GC_libld_end): Likewise.
* mark_rts.c (GC_remove_root_at_pos, GC_rebuild_root_index):
Likewise.
* os_dep.c (GC_gww_read_dirty, GC_gww_page_was_dirty,
GC_gww_page_was_ever_dirty, GC_mprotect_thread_notify,
GC_mprotect_thread_reply, GC_mprotect_thread, GC_darwin_sigbus,
GC_forward_exception): Likewise.
* pthread_support.c (GC_syms_initialized): Likewise.
* typd_mlc.c (GC_push_typed_structures_proc): Likewise.
* win32_threads.c (GC_win32_dll_threads,
GC_register_my_thread_inner, GC_lookup_pthread, GC_get_stack_min,
GC_waitForSingleObjectInfinite): Likewise.
* darwin_stop_world.c (GC_use_mach_handler_thread,
GC_use_mach_handler_thread, GC_mach_threads_count): Replace
"static" with "STATIC" and add zero initializer.
* os_dep.c (GC_task_self, GC_ports, GC_mprotect_state,
GC_sigbus_count): Likewise.
* headers.c (free_hdr): Replace "static" with GC_INLINE.
* misc.c (GC_tmp): Rename static variable to fwrite_gc_res.
* os_dep.c (memory): Rename static variable to ecos_gc_memory.
* os_dep.c (async_set_pht_entry_from_index): Make static (for
MPROTECT_VDB case).
* pthread_support.c (GC_real_pthread_create,
GC_real_pthread_sigmask, GC_real_pthread_join,
GC_real_pthread_detach, GC_init_real_syms): Use REAL_FUNC() macro
for static GC_real_XXX symbols.
* win32_threads.c (GC_may_be_in_stack): Remove "GC_" prefix.
* alloc.c (GC_finish_collection): Replace getenv() with GETENV().
* dyn_load.c (GC_init_dyld): Likewise.
* os_dep.c (GC_print_callers): Likewise.
* dyn_load.c (GC_dyld_name_for_hdr): Cast _dyld_get_image_name()
result (since it's always of "struct mach_header" type).
* dyn_load.c (GC_init_dyld): Cast GC_dyld_image_add and
GC_dyld_image_remove (to always have the first argument of
"struct mach_header" pointer type).
* configure.ac: Add threads support for OpenBSD case (threads may
not work correctly for it).
* acinclude.m4: Rename to m4/gc_set_version.m4.
* m4/libtool.m4: Delete the file.
* m4/lt~obsolete.m4: Likewise.
* m4/ltoptions.m4: Likewise.
* m4/ltsugar.m4: Likewise.
* m4/ltversion.m4: Likewise.
* include/private/gcconfig.h: Define DebugBreak() as _exit(-1) for
x86mingw32ce toolchain to workaround the incorrect DebugBreak()
declaration in winbase.h (the workaround would turn into a no-op
when DebugBreak() will be defined as a macro in the toolchain).
* include/private/gcconfig.h: Recognize __i386__ if WinCE (for
x86mingw32ce toolchain).
* include/private/gcconfig.h (NO_GETENV): Don't define for CeGCC
toolchain (or if already defined).
* include/private/gcconfig.h (NO_GETENV_WIN32): New macro (always
defined for WinCE or if NO_GETENV is defined).
* misc.c (GC_CreateLogFile): Use NO_GETENV_WIN32 macro instead of
NO_GETENV one.
* configure.ac: Add AC_CONFIG_MACRO_DIR([m4]).
* Makefile.am: Add "ACLOCAL_AMFLAGS = -I m4".
* libtool.m4: Remove.
* m4/libtool.m4: New file (generated).
* m4/lt~obsolete.m4: Likewise.
* m4/ltoptions.m4: Likewise.
* m4/ltsugar.m4: Likewise.
* m4/ltversion.m4: Likewise.
* include/gc.h (GC_UNDERSCORE_STDCALL): Recognize new macro;
prefix GC_CreateThread and GC_ExitThread with '_' if defined.
* doc/README.macros (GC_UNDERSCORE_STDCALL): Document.
* alloc.c (GC_collect_or_expand): Add "retry" argument; add the
comments; don't use "default" stop_func on a retry if
GC_dont_expand.
* alloc.c (GC_allocobj): Pass "retry" argument to
GC_collect_or_expand().
* malloc.c (GC_alloc_large): Likewise.
* include/private/gc_priv.h (GC_collect_or_expand): Move the
declaration to malloc.c; add "retry" argument.
* alloc.c (GC_start_call_back): Move the variable definition from
misc.c.
* include/private/gc_priv.h (GC_start_call_back): Remove the
declaration.
* alloc.c (GC_notify_full_gc): Remove unnecessary cast of 0.
* alloc.c (GC_try_to_collect_inner): Also call stop_func at the
beginning of the function.
* include/gc.h (GC_try_to_collect): Refine the comment about
stop_func.
* alloc.c (GC_default_stop_func, GC_try_to_collect_general,
GC_gcollect): Add the comment.
* alloc.c (GC_try_to_collect_general): Move the assertion on
stop_func != 0 to GC_try_to_collect().
* alloc.c (GC_try_to_collect_general): If stop_func == 0 then use
GC_default_stop_func instead (holding the lock).
* alloc.c (GC_gcollect): Pass 0 as stop_func instead of
GC_default_stop_func (to prevent data races).
* Makefile.direct: Move "define arguments" documentation to
doc/README.macros; add reference to doc/README.macros.
* Makefile.dj: Change the documentation reference to
doc/README.macros.
* README.QUICK: Likewise.
* configure.ac: Likewise.
* allchblk.c: Remove unnecessary "-D" from the comment.
* doc/README.macros: Likewise.
* README.environment: Likewise.
* include/gc.h: Likewise.
* include/gc_inline.h: Likewise.
* include/private/gcconfig.h: Likewise.
* README.QUICK: Fix a typo.
* misc.c (GC_CreateLogFile): Use FILE_ATTRIBUTE_NORMAL for
CreateFile(); don't immediately flush every write if very verbose.
* doc/README.win32: Replace ".exe.log" to ".gc.log".
* doc/README.win64: Likewise.
* doc/README.win64: Fix a typo.
* misc.c (GC_CreateLogFile): Strip executable file extension for
the log file; use ".gc.log" extension (instead of ".log").
* include/gc_config_macros.h: Avoid the redefinition of
GC_xxx_THREADS macros.
* alloc.c (GC_try_to_collect_general): Change the type of "result"
local variable to GC_bool.
* include/gc_config_macros.h: Use old behavior for FreeBSD and
NetBSD platform detection code (check that other GC_xxx_THREADS
are undefined); add FIXME.
* include/gc_config_macros.h: Rearrange the platform detection
code (GC_WIN32_PTHREADS implies GC_WIN32_THREADS; define
GC_THREADS first if GC_XXX_THREADS already set; define proper
GC_XXX_THREADS if GC_THREADS; define GC_PTHREADS in a single
place; define _REENTRANT if posix threads except for Win32).
* alloc.c (GC_try_to_collect_general): New function (move the code
from GC_try_to_collect, pass force_unmap argument).
* alloc.c (GC_try_to_collect, GC_gcollect): Call
GC_try_to_collect_general().
* alloc.c (GC_gcollect_and_unmap): New public function.
* include/gc.h (GC_gcollect_and_unmap): New function declaration.
* tests/test.c (window_proc): Call GC_gcollect_and_unmap() on
WM_HIBERNATE event (instead of GC_set_force_unmap_on_gcollect()
and GC_gcollect()).
* include/gc.h (GC_allow_register_threads, GC_register_my_thread,
GC_unregister_my_thread, GC_malloc_many): Refine the comment.
* include/gc.h (GC_malloc_many, GC_NEXT): Declare unconditionally
(that is, don't depend on GC_THREADS macro).
* include/gc.h: Don't check for __CYGWIN32__ and __CYGWIN__ along
with a check for GC_PTHREADS (since the former implies the
latter).
* include/gc.h (GC_SOLARIS_THREADS): Don't check for.
* include/gc.h (GC_MIN, GC_MAX): Don't define.
* mallocx.c (GC_malloc_many): Add comment to #endif.
* configure.ac: Drop the subdir-objects Automake option, since
it's incompatible with picking source files from libatomic_ops.
* allchblk.c (GC_fail_count, GC_large_alloc_warn_interval): Add
"extern" keyword to a global variable declaration (some compilers
require it).
* alloc.c (GC_bytes_found, GC_unmap_threshold,
GC_force_unmap_on_gcollect): Likewise.
* dyn_load.c (GC_no_win32_dlls, GC_wnt): Likewise.
* finalize.c (GC_fail_count): Likewise.
* include/private/gc_hdrs.h (GC_hdr_cache_hits,
GC_hdr_cache_misses): Likewise.
* mallocx.c (GC_bytes_found): Likewise.
* mark_rts.c (GC_save_regs_ret_val, GC_world_stopped): Likewise.
* misc.c (GC_unmap_threshold): Likewise.
* os_dep.c (GC_unmap_threshold, GC_old_allocator): Likewise.
* pthread_support.c (GC_markers): Likewise.
* thread_local_alloc.c (GC_gcjobjfreelist,
GC_gcj_malloc_initialized, GC_gcj_kind): Likewise.
* win32_threads.c (GC_fault_handler_lock, GC_write_cs,
GC_dont_query_stack_min, GC_markers, GC_wnt): Likewise.
* tests/huge_test.c: Define GC_IGNORE_WARN (if not defined) to
suppress misleading GC "Out of Memory!" warning printed on every
GC_MALLOC(LONG_MAX) call.
* tests/huge_test.c: Include "gc.h" instead of <gc.h>.
* tests/huge_test.c (main): Replace K&R-style function definition
with the ANSI C one.
* dyn_load.c (GC_register_dynamic_libraries): Always use
lpMaximumApplicationAddress value for WinCE (even for old
versions).
* os_dep.c (VER_PLATFORM_WIN32_CE): Define if not in winbase.h.
* os_dep.c (GC_dont_query_stack_min): New global variable (only if
WinCE and THREADS).
* os_dep.c (GC_setpagesize): Adjust lpMaximumApplicationAddress
for WinCE (prior to version 6) if not _WIN32_WCE_EMULATION; set
GC_dont_query_stack_min for older WinCE (prior to version 5).
* win32_threads.c (GC_dont_query_stack_min): Declare.
* win32_threads.c (GC_get_stack_min): Rename the macro to
GC_wince_evaluate_stack_min for WinCE; update the comment.
* win32_threads.c (GC_push_stack_for, GC_get_next_stack): Use
GC_wince_evaluate_stack_min() instead of GC_get_stack_min() for
WinCE and don't update thread's last_stack_min value (only if
GC_dont_query_stack_min).
* win32_threads.c (GC_push_stack_for): Skip assertion for WinCE if
GC_dont_query_stack_min (since the evaluated stack_min value may
be incorrect if the stack is bigger than 64 KiB).
* gc_dlopen.c (GC_dlopen): Add function redirector (only if
GC_USE_LD_WRAP).
* include/gc.h: Include "gc_pthread_redirects.h" even if
GC_USE_LD_WRAP or GC_NO_THREAD_REDIRECTS.
* include/gc_pthread_redirects.h (GC_PTHREAD_REDIRECTS_H): Don't
define and check for (since included only from gc.h).
* include/gc_pthread_redirects.h: Declare "GC_" symbols even if
GC_USE_LD_WRAP or GC_NO_THREAD_REDIRECTS.
* include/gc_pthread_redirects.h: Include signal.h only to get
sigset_t definition.
* Makefile.direct: Document GC_REGISTER_MEM_PRIVATE.
* mark_rts.c (GC_is_tmp_root): Define also for WinCE unless
NO_DEBUGGING (that is, replace _WIN32_WCE_EMULATION with MSWINCE).
* os_dep.c (GC_sysinfo): Remove explicit global variable
initialization to "{0}" (revert back the previous change) since it
might produce a warning.
* allchblk.c (GC_large_alloc_warn_interval): Move declaration from
gc_priv.h.
* allchblk.c (GC_large_alloc_warn_suppressed): Move definition
from misc.c; define as STATIC.
* include/private/gc_priv.h (GC_large_alloc_warn_interval,
GC_large_alloc_warn_suppressed): Remove declaration.
* alloc.c (GC_bytes_found): Add "defined in" comment.
* mallocx.c (GC_bytes_found): Likewise.
* misc.c (GC_unmap_threshold): Likewise.
* os_dep.c (GC_old_allocator): Likewise.
* pthread_support.c (GC_markers): Likewise.
* thread_local_alloc.c (GC_gcjobjfreelist,
GC_gcj_malloc_initialized, GC_gcj_kind): Likewise.
* win32_threads.c (GC_markers): Likewise.
* alloc.c (GC_start_time): Explicitly initialize to 0 or NULL (to
be distinctive from a variable declaration).
* backgraph.c (GC_max_height, GC_deepest_obj): Likewise.
* blacklst.c (GC_old_normal_bl, GC_incomplete_normal_bl,
GC_old_stack_bl, GC_incomplete_stack_bl): Likewise.
* checksums.c (GC_faulted, GC_n_dirty_errors,
GC_n_faulted_dirty_errors, GC_n_changed_errors, GC_n_clean,
GC_n_dirty, GC_bytes_in_used_blocks): Likewise.
* dbg_mlc.c (GC_smashed): Likewise.
* finalize.c (GC_old_dl_entries): Likewise.
* gcj_mlc.c (GC_gcj_kind, GC_gcj_debug_kind, GC_gcjobjfreelist,
GC_gcjdebugobjfreelist): Likewise.
* mach_dep.c (GC_save_regs_ret_val): Likewise.
* mark.c (GC_n_rescuing_pages, GC_mark_stack, GC_mark_stack_limit,
GC_mark_stack_top): Likewise.
* misc.c (GC_min_sp, GC_high_water, GC_bytes_allocd_at_reset):
Likewise.
* os_dep.c (GC_data_start, GC_page_size, GC_sysinfo,
GC_old_segv_handler, GC_old_bus_handler,
GC_old_bus_handler_used_si, GC_old_segv_handler_used_si,
GC_proc_buf, GC_proc_fd, GC_vd_base): Likewise.
* pthread_stop_world.c (GC_stop_count, GC_stopping_pid): Likewise.
* reclaim.c (GC_leaked): Likewise.
* typd_mlc.c (GC_explicit_kind, GC_array_kind, GC_ext_descriptors,
GC_typed_mark_proc_index, GC_array_mark_proc_index,
GC_eobjfreelist, GC_arobjfreelist): Likewise.
* win32_threads.c (GC_pthread_map_cache, GC_marker_cv,
GC_marker_Id): Likewise.
* dbg_mlc.c (GC_smashed, GC_n_smashed): Define as STATIC.
* gcj_mlc.c (GC_gcjdebugobjfreelist): Likewise.
* os_dep.c (GC_vd_base): Likewise.
* pthread_support.c (GC_mark_threads): Likewise.
* reclaim.c (GC_leaked): Likewise.
* typd_mlc.c (GC_bm_table): Likewise.
* mark_rts.c (GC_save_regs_ret_val): Change declaration type to
that of definition; add "defined in" comment.
* mark_rts.c (GC_push_current_stack): Remove unnecessary cast for
GC_save_regs_ret_val.
* misc.c (GC_check_heap, GC_print_all_smashed,
GC_start_call_back): Remove unnecessary cast (of 0).
* misc.c (GC_LARGE_ALLOC_WARN_INTERVAL): New tuning macro.
* misc.c (GC_large_alloc_warn_interval): Initialize to
GC_LARGE_ALLOC_WARN_INTERVAL value.
* misc.c (GC_tmp): Change to "static".
* os_dep.c (GC_mprotect_state): Define as static.
* pthread_support.c (dummy_thread_local): Prefix with "GC_".
* win32_threads.c (WinMain): Remove FIXME for WinCE.
* os_dep.c (PROTECT, UNPROTECT): Use distinct ABORT messages.
* configure.ac: Rewrite the tests for external or internal
libatomic_ops.
* configure.ac: In particular, drop the symbolic links. Add option
--with-libatomic-ops for forced selection.
* Makefile.am: Adjust the path of source files from libatomic_ops
to not use the links.
* Makefile.am (libgc_la_LIBADD): Add $(ATOMIC_OPS_LIBS). This will
be empty if we use the bundled AO sources.
* Makefile.am: Strip version suffix for libatomic_ops directory.
* build_atomic_ops.sh: Likewise.
* build_atomic_ops.sh.cygwin: Likewise.
* configure_atomic_ops.sh: Likewise.
* Makefile.direct: Remove AO_VERSION definition; strip version
suffix for libatomic_ops directory.
* NT_STATIC_THREADS_MAKEFILE: Likewise.
* NT_X64_STATIC_THREADS_MAKEFILE: Likewise.
* NT_X64_THREADS_MAKEFILE: Likewise.
* gc.mak: Likewise.
* libatomic_ops: Rename from "libatomic_ops-1.2".
* alloc.c (GC_version): Add "const" keyword.
* alloc.c (GC_get_version): New public function.
* include/gc.h (GC_get_version): New function declaration; update
the comment for the GC version.
* include/private/gc_locks.h (GC_allocate_ml, GC_lock_holder,
GC_collecting, GC_mark_lock_holder, GC_need_to_lock): Use "extern"
(for the global variable declaration) again.
* include/private/gc_pmark.h (GC_n_mark_procs, GC_mark_stack_size,
GC_mark_stack_limit, GC_mark_stack_top, GC_mark_stack,
GC_mark_stack_too_small, GC_mark_state): Likewise.
* include/private/gcconfig.h (GC_register_stackbottom): Likewise.
* include/private/pthread_support.h (GC_threads,
GC_thr_initialized, GC_in_thread_creation): Likewise.
* include/private/gc_priv.h: Likewise.
* real_malloc.c: Include private/config.h if HAVE_CONFIG_H.
* allchblk.c (GC_hblkfreelist): Define as STATIC.
* blacklst.c (GC_total_stack_black_listed): Likewise.
* include/private/gc_priv.h (GC_hblkfreelist, GC_stopped_mark,
GC_total_stack_black_listed, GC_push_stubborn_structures): Remove
declaration.
* mark_rts.c (GC_stopped_mark): Add declaration (only if
THREAD_LOCAL_ALLOC).
* allchblk.c (GC_fail_count): Move the declaration out of
GC_allochblk_nth(); remove "extern".
* alloc.c (IF_THREADS): Remove unused macro.
* alloc.c (GC_world_stopped): Define only if THREAD_LOCAL_ALLOC.
* alloc.c (GC_stopped_mark): Set GC_world_stopped value only if
THREAD_LOCAL_ALLOC.
* alloc.c (GC_bytes_found, GC_collection_in_progress,
GC_check_tls, GC_unmap_threshold, GC_force_unmap_on_gcollect):
Remove K&R-style "extern" for the declaration.
* dbg_mlc.c (GC_free_inner): Likewise.
* dyn_load.c (GC_repeat_read, GC_roots_present, GC_is_heap_base,
GC_get_next_stack, GC_no_win32_dlls, GC_wnt): Likewise.
* finalize.c (GC_fail_count): Likewise.
* include/private/gc_hdrs.h (GC_hdr_cache_hits,
GC_hdr_cache_misses): Likewise.
* include/private/gc_locks.h (GC_allocate_ml, GC_lock_holder,
GC_lock, GC_collecting, GC_mark_lock_holder, GC_need_to_lock):
Likewise.
* include/private/gc_pmark.h (GC_mark_procs, GC_n_mark_procs,
GC_mark_stack_size, GC_mark_stack_limit, GC_mark_stack_top,
GC_mark_stack, GC_mark_stack_too_small, GC_mark_state): Likewise.
* include/private/gc_priv.h (GC_current_warn_proc, GC_obj_kinds,
GC_n_kinds, GC_fo_entries, GC_n_heap_sects, GC_n_memory,
GC_page_size, GC_sysinfo, GC_black_list_spacing,
GC_objects_are_marked, GC_incremental, GC_dirty_maintained,
GC_root_size, GC_debugging_started, GC_large_alloc_warn_interval,
GC_large_alloc_warn_suppressed, GC_blocked_sp,
GC_activation_frame, GC_push_other_roots,
GC_push_finalizer_structures, GC_push_thread_structures,
GC_push_typed_structures, GC_start_call_back, GC_is_initialized,
GC_check_heap, GC_print_all_smashed, GC_print_all_errors,
GC_print_heap_obj, GC_have_errors, GC_print_stats,
GC_dump_regularly, GC_backtraces, GC_print_back_height,
GC_debug_generic_malloc_inner,
GC_debug_generic_malloc_inner_ignore_off_page,
GC_fl_builder_count, GC_mark_no, GC_help_marker,
GC_setup_temporary_fault_handler, GC_reset_fault_handler): Likewise.
* include/private/gcconfig.h (GC_SysVGetDataStart,
GC_FreeBSDGetDataStart, GC_register_stackbottom,
GC_MacTemporaryNewPtr, GC_amiga_get_mem): Likewise.
* include/private/pthread_support.h (GC_threads,
GC_thr_initialized, GC_in_thread_creation): Likewise.
* malloc.c (GC_text_mapping): Likewise.
* mallocx.c (GC_bytes_found): Likewise.
* mark.c (GC_check_dirty, GC_started_thread_while_stopped): Likewise.
* mark_rts.c (GC_save_regs_ret_val): Likewise.
* misc.c (GC_clear_stack_inner, GC_init_parallel, GC_init_win32,
GC_setpagesize, GC_init_linux_data_start,
GC_set_and_save_fault_handler, GC_unmap_threshold): Likewise.
* os_dep.c (GC_unmap_threshold, GC_push_all_stacks,
GC_darwin_register_mach_handler_thread): Likewise.
* pthread_support.c (GC_markers, GC_collection_in_progress):
Likewise.
* tests/test.c (GC_amiga_free_all_mem): Likewise.
* thread_local_alloc.c (GC_gcjobjfreelist,
GC_gcj_malloc_initialized, GC_gcj_kind): Likewise.
* win32_threads.c (GC_write_fault_handler, GC_gww_dirty_init,
GC_fault_handler_lock, GC_write_cs, GC_markers): Likewise.
* misc.c (GC_read, GC_register_finalizer_no_order, GC_init_dyld):
Move the declaration out of GC_init(); remove "extern".
* os_dep.c (GC_abort): Add the comment; add workaround to suppress
compiler "unreachable code" warnings for ABORT callers (where
ABORT is followed by a dummy return statement).
* os_dep.c (GC_old_allocator): Move the declaration out of
GC_default_push_other_roots(); remove "extern".
* darwin_stop_world.c (GC_mprotect_stop, GC_mprotect_resume):
Move the declaration out of GC_stop_world() and GC_start_world()
(only if MPROTECT_VDB); remove "extern".
* win32_threads.c (GC_get_stack_min, GC_push_stack_for,
GC_get_next_stack): Recognize _WIN32_WCE_EMULATION macro (used for
WinCE emulation and for custom WinCE 6 devices); add the comment.
* win32_threads.c (GC_get_stack_min): Cast pointer to word instead
of DWORD.
* win32_threads.c (GC_get_next_stack): Don't use and maintain the
latest known stack_min value for WinCE (if GC_get_stack_min is
defined as a macro); update the comments.
* win32_threads.c (GC_wnt): Don't declare for WinCE.
* Makefile.direct: Document EMPTY_GETENV_RESULTS.
* gcj_mlc.c (GC_clear_stack): Remove declaration.
* malloc.c (GC_clear_stack): Likewise.
* mallocx.c (GC_clear_stack): Likewise.
* typd_mlc.c (GC_clear_stack): Likewise.
* gcj_mlc.c (GENERAL_MALLOC, GENERAL_MALLOC_IOP): Rename to
GENERAL_MALLOC_INNER and GENERAL_MALLOC_INNER_IOP, respectively;
remove "lb" unnecessary cast to word.
* include/private/gc_priv.h (GC_clear_stack): Add declaration.
* include/private/gc_priv.h (GENERAL_MALLOC, GENERAL_MALLOC_IOP):
Move common declaration from typd_mlc.c and malloc.c; remove
unnecessary result and "lb" parameter casts.
* include/private/thread_local_alloc.h: Guard against duplicate
header file inclusion.
* os_dep.c (USE_MUNMAP): Replace "-->" with an error directive for
the case when USE_MMAP is not defined.
* pthread_support.c (GC_is_thread_tsd_valid): New internal
function (only if GC_ASSERTIONS and THREAD_LOCAL_ALLOC); move the
code from thread-local GC_malloc(); add FIXME for the condition.
* win32_threads.c (GC_is_thread_tsd_valid): Likewise.
* thread_local_alloc.c (GC_gcjobjfreelist): Change the type (to
match that of its definition).
* thread_local_alloc.c (GC_destroy_thread_local): Add a cast for
GC_gcjobjfreelist.
* thread_local_alloc.c (GC_lookup_thread, GC_lookup_thread_inner):
Remove unused declaration; don't include pthread.h.
* thread_local_alloc.c (GC_is_thread_tsd_valid): New declaration
(only if GC_ASSERTIONS).
* thread_local_alloc.c (GC_malloc): Use GC_is_thread_tsd_valid()
instead of GC_lookup_thread().
* win32_threads.c (GC_lookup_thread_inner): Define as STATIC.
* win32_threads.c (UNPROTECT): Rename to UNPROTECT_THREAD (to have
id different from that in os_dep.c).
* allchblk.c (GC_enough_large_bytes_left): Replace "inline static"
with GC_INLINE.
* include/private/gc_priv.h (fixed_getenv): Likewise.
* alloc.c (GC_max, GC_min): Replace "static INLINE" with
GC_INLINE.
* mark_rts.c (rt_hash): Likewise.
* win32_threads.c (GC_get_max_thread_index): Likewise.
* include/private/gc_priv.h (INLINE): Prefix with "GC_"; include
"static"; define for Sun CC; define for VC++ (and other
compilers).
* pthread_support.c: Don't define __inline__ for non-GNU compilers
(not needed anymore).
* NT_THREADS_MAKEFILE: Remove file (since it duplicates gc.mak).
* Makefile.in: Remove reference to NT_THREADS_MAKEFILE.
* Makefile.am: Likewise.
* Makefile.dj: Likewise.
* Makefile.direct: Likewise.
* doc/README.win32: Add reference to gc.mak.
* NT_X64_THREADS_MAKEFILE: Likewise.
* Makefile.direct: Remove references to acinclude.m4, libtool.m4.
* autogen.sh: Update.
* Makefile.am: Don't add libtool.m4 to EXTRA_DIST.
* acinclude.m4: Fix underquoting of GC_SET_VERSION.
* README.QUICK: Update information for Makefile.
* Makefile.am: Do not distribute the substituted bdw-gc.pc.
* configure.ac: Add AM conditional analog to KEEP_BACK_PTRS.
* tests/tests.am: Use it here to conditionally enable tracetest
when possible.
* dyn_load.c (GC_wnt): Update the comment.
* dyn_load.c (GC_register_dynamic_libraries): Add the comment for
_WIN32_WCE_EMULATION; recognize GC_REGISTER_MEM_PRIVATE (new
macro); call GC_is_heap_base() only if check for Type succeeded.
* mark_rts.c (GC_is_tmp_root): Don't define unless NO_DEBUGGING;
update the comment.
* include/private/gc_priv.h (GC_is_tmp_root): Remove declaration.
* include/private/gcconfig.h (CANCEL_SAFE, IF_CANCEL): new macros.
* include/private/gc_priv.h (DISABLE_CANCEL, RESTORE_CANCEL,
ASSERT_CANCEL_DISABLED): New macros.
* alloc.c (GC_maybe_gc): Assert cancellation disabled.
(GC_collect_a_little_inner,GC_try_to_collect, GC_collect_or_expand):
Disable cancellation.
(GC_add_to_our_memory): Check for overflow.
* misc.c (GC_cancel_disable_count): declare.
(GC_init, GC_write): Disable cancellation.
(GC_init): Remove redundant GC_is_initialized test.
* os_dep.c (GC_repeat_read): Assert cancellation disabled.
(GC_get_stack_base): Disable cancellation.
* pthread_stop_world.c (GC_suspend_handler_inner): Disable
cancellation.
* pthread_support.c (GC_mark_thread): Permanently disable
cancellation.
(GC_wait_for_gc_completion, GC_wait_builder, GC_wait_marker):
Assert cancellation disabled.
(fork handling): Disable cancellation, fix comment.
(GC_pthread_create): Disable cancellation.
(GC_unregister_my_thread): Disable cancellation.
* Makefile.direct: Document NO_CANCEL_SAFE.
* Makefile: Remove outdated file (Makefile.direct should be used
instead).
* include/gc.h (GC_use_DllMain): Refine the comment.
* configure.ac: Add documentation to AC_DEFINE for GC_THREADS and
EMPTY_GETENV_RESULTS.
* configure.ac: Fix a typo.
* Makefile.am: Likewise.
* checksums.c (GC_checksum, GC_update_check_page): Remove
"register" keyword in local variable declarations (for the code
used only for debugging or which is not time-critical).
* dbg_mlc.c (GC_has_other_debug_info, GC_store_debug_info,
GC_store_debug_info_inner, GC_check_annotated_obj, GC_print_obj,
GC_print_smashed_obj, GC_debug_end_stubborn_change,
GC_debug_invoke_finalizer): Likewise.
* dyn_load.c (GC_register_dynamic_libraries): Likewise.
* mallocx.c (GC_realloc): Likewise.
* mark_rts.c (GC_print_static_roots, GC_is_static_root,
GC_clear_roots): Likewise.
* misc.c (GC_write): Likewise.
* os_dep.c (GC_print_callers): Likewise.
* dyn_load.c (GC_register_dynamic_libraries): Rename "i" local
variable to "j" for the nested loop (just not to hide the similar
variable in the outer one).
* mark_rts.c (GC_print_static_roots): Output an error message
using GC_err_printf() (instead of GC_printf()).
* configure.ac: Move include flag from ${INCLUDE} ...
* Makefile.am: ... to AM_CPPFLAGS and also add the build directory.
* configure.ac: Call AM_CONFIG_HEADER([include/private/config.h]).
* configure.ac: Add documentation to all AC_DEFINE either directly
or using AH_TEMPLATE.
* win32_threads.c (GC_waitForSingleObjectInfinite): New static
function (only if GC_WINMAIN_REDIRECT).
* win32_threads.c (WinMain): Call GC_waitForSingleObjectInfinite()
thru GC_do_blocking() instead of calling WaitForSingleObject()
directly.
* pthread_support.c (start_mark_threads): Refine printed message.
* win32_threads.c (GC_thr_init): Likewise.
* Makefile.direct (GC_WINMAIN_REDIRECT): Add the comment for.
* Makefile.direct (NO_GETENV): Update the comment.
* include/gc.h (GC_WINMAIN_WINCE_LPTSTR): Remove macro.
* include/gc.h (GC_WinMain): Remove declaration.
* include/gc.h (WinMain): Define (as GC_WinMain) if and only if
GC_WINMAIN_REDIRECT.
* tests/test.c (GC_COND_INIT): Define as GC_INIT() also in case of
WinCE target unless GC_WINMAIN_REDIRECT is defined.
* tests/test.c (WINMAIN_LPTSTR): New macro.
* tests/test.c (WinMain): Use WINMAIN_LPTSTR instead of LP[W]STR
and GC_WINMAIN_WINCE_LPTSTR.
* win32_threads.c (start_mark_threads): Add the comment for
MARK_THREAD_STACK_SIZE.
* win32_threads.c: Recognize new GC_WINMAIN_REDIRECT macro.
* win32_threads.c (WINMAIN_LPTSTR, WINMAIN_THREAD_STACK_SIZE): New
macro (only if GC_WINMAIN_REDIRECT).
* win32_threads.c: Undefine WinMain macro if GC_WINMAIN_REDIRECT.
* win32_threads.c (GC_WinMain): Add prototype (only if
GC_WINMAIN_REDIRECT).
* win32_threads.c (main_thread_args, WinMain): Rename
GC_WINMAIN_WINCE_LPTSTR to WINMAIN_LPTSTR.
* win32_threads.c (WinMain): Call GC_INIT() instead of GC_init();
use WINMAIN_THREAD_STACK_SIZE.
* win32_threads.c (WinMain): Call GC_deinit() and
DeleteCriticalSection() only if WinCE; add FIXME.
* os_dep.c (GC_get_main_stack_base): add assertion for mem_base
value returned by GC_get_stack_base().
* Makefile.direct (MUNMAP_THRESHOLD, GC_FORCE_UNMAP_ON_GCOLLECT):
Add the comment for.
* alloc.c (GC_unmap_threshold, GC_force_unmap_on_gcollect):
Declare external variable (only if USE_MUNMAP).
* alloc.c (GC_try_to_collect): Temporarily set GC_unmap_threshold
value to 1 if GC_force_unmap_on_gcollect and restore it before
unlocking (only if USE_MUNMAP).
* doc/README.environment (GC_FORCE_UNMAP_ON_GCOLLECT): Add
information for.
* include/gc.h (GC_set_force_unmap_on_gcollect,
GC_get_force_unmap_on_gcollect): New public function prototype.
* include/gc.h (GC_FORCE_UNMAP_ON_GCOLLECT): New macro is
recognized.
* misc.c (GC_FORCE_UNMAP_ON_GCOLLECT): Likewise.
* include/gc.h (GC_INIT_CONF_FORCE_UNMAP_ON_GCOLLECT): New
internal macro (used by GC_INIT only).
* misc.c (GC_force_unmap_on_gcollect): New global variable.
* misc.c (GC_init): Recognize new "GC_FORCE_UNMAP_ON_GCOLLECT"
environment variable (and set GC_force_unmap_on_gcollect).
* misc.c (GC_set_force_unmap_on_gcollect,
GC_get_force_unmap_on_gcollect): New public function.
* tests/test.c (window_proc): Call GC_set_force_unmap_on_gcollect
to force the mode on if WM_HIBERNATE; restore the mode after
GC_gcollect().
* Makefile.direct (LARGE_CONFIG): Update information.
* include/gc.h (GC_stop_func): Refine the comment.
* configure.ac: Use EMPTY_GETENV_RESULTS instead of NO_GETENV for
Win32 (workaround for Wine bug).
* allchblk.c (GC_freehblk): Adjust local variables indentation.
* mallocx.c (GC_generic_malloc_many): Likewise.
* typd_mlc.c (GC_malloc_explicitly_typed_ignore_off_page,
GC_calloc_explicitly_typed): Likewise.
* typd_mlc.c (GC_make_array_descriptor): Remove unnecessary
brackets.
* configure.ac: Replace GC_WIN32_THREADS with GC_THREADS.
* configure.ac: Process enable_parallel_mark option for Cygwin and
Win32; define THREAD_LOCAL_ALLOC for Win32.
* include/private/gc_priv.h: Define AO_ASSUME_WINDOWS98 if
PARALLEL_MARK (required for VC++ x86).
* dbg_mlc.c (GC_generate_random_backtrace): Call
GC_try_to_collect(GC_never_stop_func) instead of GC_gcollect();
if GC is disabled then print error message and return.
* include/gc.h (GC_try_to_collect): Refine the comment.
* include/private/gc_priv.h (GC_never_stop_func): Fix return type;
refine the comment.
* add_gc_prefix.c: Move the file to the new "extra" directory.
* AmigaOS.c: Likewise.
* gcname.c: Likewise.
* if_mach.c: Likewise.
* if_not_there.c: Likewise.
* MacOS.c: Likewise.
* msvc_dbg.c: Likewise.
* setjmp_t.c: Likewise.
* threadlibs.c: Likewise.
* EMX_MAKEFILE: Prepend setjmp_t.c with "extra" directory.
* Makefile: Prepend AmigaOS.c, MacOS.c, add_gc_prefix.c, gcname.c,
if_mach.c, if_not_there.c, msvc_dbg.c, setjmp_t.c, threadlibs.c
with "extra" directory.
* Makefile.am: Likewise.
* Makefile.direct: Likewise.
* Makefile.dj: Likewise.
* Makefile.in: Likewise.
* NT_MAKEFILE: Prepend msvc_dbg.obj with "extra" directory.
* NT_STATIC_THREADS_MAKEFILE: Likewise.
* NT_X64_STATIC_THREADS_MAKEFILE: Likewise.
* NT_X64_THREADS_MAKEFILE: Likewise.
* NT_THREADS_MAKEFILE: Prepend msvc_dbg.c with "extra" directory.
* gc.mak: Likewise.
* PCR-Makefile: Prepend if_mach.c, if_not_there.c with "extra"
directory.
* SMakefile.amiga: Prepend AmigaOS.c, setjmp_t.c with "extra"
directory.
* doc/simple_example.html: Update for threadlibs.c.
* os_dep.c: Prepend included AmigaOS.c with "extra" directory.
* include/gc.h (GC_do_blocking, GC_call_with_gc_active): New
function prototype.
* include/private/gc_priv.h (STOP_WORLD): Replace a no-op (for the
single-threaded case) with an assertion check for the state to be
not a "do-blocking" one.
* include/private/gc_priv.h (blocking_data): Move the structure
definition from pthread_support.c; change "fn" return type to void
pointer.
* include/private/gc_priv.h (GC_activation_frame_s): New structure
type.
* include/private/gc_priv.h (GC_push_all_stack_frames): New
function declaration (only if THREADS).
* include/private/gc_priv.h (GC_world_stopped): Don't declare
unless THREADS.
* include/private/gc_priv.h (GC_blocked_sp,
GC_activation_frame_s): New declaration (only if not THREADS).
* include/private/gc_priv.h (GC_push_all_register_frames): New
function declaration (only for IA-64).
* include/private/gc_priv.h (NURSERY, GC_push_proc): Remove
obsolete (unused) symbols.
* include/private/gc_priv.h (GC_push_all_stack_partially_eager):
Remove declaration (since it is static now).
* mark_rts.c (GC_push_all_stack_partially_eager): Move from mark.c
(for code locality) and make STATIC.
* mark_rts.c (GC_push_all_register_frames): New function (only for
IA-64).
* mark_rts.c (GC_push_all_stack_frames): New function (only if
THREADS).
* mark_rts.c (GC_add_trace_entry): New function prototype (used by
GC_push_all_stack_partially_eager(), only if TRACE_BUF).
* mark_rts.c (GC_push_all_stack_part_eager_frames): New function.
* mar_rts.c (GC_save_regs_ret_val): Move the declaration out of a
function body (only for IA-64).
* mark_rts.c (GC_push_current_stack): Call
GC_push_all_stack_part_eager_frames() instead of
GC_push_all_stack_partially_eager().
* mark_rts.c (GC_push_current_stack): Call
GC_push_all_register_frames() instead of GC_push_all_eager() for
IA-64 backing store.
* misc.c (GC_do_blocking_inner): Declare function (if THREADS
only).
* misc.c (GC_blocked_sp, GC_blocked_register_sp,
GC_activation_frame): New global variables (only if not THREADS).
* misc.c (GC_call_with_gc_active, GC_do_blocking_inner): New API
function (only if not THREADS).
* misc.c (GC_do_blocking): Move the function from
pthread_support.c.
* include/private/pthread_support.h (GC_Thread_Rep): Add
"activation_frame" field.
* pthread_stop_world.c (GC_push_all_stacks): Call
GC_push_all_stack_frames() and GC_push_all_register_frames instead
of GC_push_all_stack() and/or GC_push_all_eager(); don't check for
STACK_GROWS_UP here.
* pthread_support.c (GC_do_blocking_inner): Remove "static"; store
"fn" result back to "client_data" field.
* pthread_support.c (GC_call_with_gc_active): New API function.
* win32_threads.c (GC_call_with_gc_active): Likewise.
* win32_threads.c (GC_Thread_Rep): Add "thread_blocked_sp" and
"activation_frame" fields.
* win32_threads.c (GC_new_thread): Add assertion checking for
thread_blocked_sp is NULL.
* win32_threads.c (GC_do_blocking_inner): New function.
* win32_threads.c (GC_stop_world): Don't suspend a thread if its
thread_blocked_sp is non-NULL.
* win32_threads.c (GC_push_stack_for): Use thread
"activation_frame" (if non-NULL); use "thread_blocked_sp" if
non-NULL (instead of calling GetThreadContext()); "UNPROTECT" the
thread before modifying its last_stack_min; call
GC_push_all_stack_frames() instead of GC_push_all_stack(); update
the comments.
* alloc.c (GC_default_stop_func): New static variable (initialized
to GC_never_stop_func).
* alloc.c (GC_set_stop_func, GC_get_stop_func): New function.
* alloc.c (GC_timeout_stop_func): Define as GC_default_stop_func
(instead of GC_never_stop_func) if SMALL_CONFIG (or NO_CLOCK),
else call GC_default_stop_func() before getting "current_time".
* alloc.c (GC_maybe_gc): Expand GC_gcollect_inner() macro (for
FIXME comment).
* alloc.c (GC_maybe_gc, GC_collect_a_little_inner): add FIXME for
replacing GC_never_stop_func with GC_default_stop_func (if
possible).
* alloc.c (GC_gcollect): Use GC_default_stop_func.
* alloc.c (GC_collect_or_expand): Use GC_default_stop_func
(instead of GC_never_stop_func) unless it is trigged due to out of
memory; don't increment GC_fail_count and don't output warning
(before trying to collect again) in case the collection has been
interrupted (by GC_default_stop_func) and the heap expansion has
failed too.
* include/gc.h (GC_set_stop_func, GC_get_stop_func): New function
prototypes.
* os_dep.c (GC_get_stack_base): Add FIXME; add assertion for
GC_get_writable_length() result.
* configure.ac: Don't use -lpthread -ldl for Cygwin.
* NT_THREADS_MAKEFILE: Make it back equal to gc.mak.
* include/private/gcconfig.h (GWW_VDB): Undefine if
USE_GLOBAL_ALLOC (since incompatible).
* os_dep.c (GetWriteWatch_alloc_flag): Define as 0 unless GWW_VDB
is defined.
* os_dep.c (GC_unmap_threshold): Declare (for use in
GC_init_win32) if USE_MUNMAP.
* os_dep.c (GC_init_win32): Turn off memory unmapping if
GlobalAlloc() is used.
* os_dep.c (GC_win32_get_mem): Define and use new
VIRTUAL_ALLOC_PAD macro; don't waste a extra memory page unless
MPROTECT_VDB is in use.
* Makefile: Replace "version.h" with "include/gc_version.h".
* include/gc_version.h: Likewise.
* alloc.c (GC_collect_or_expand): Output heap size in WARN()
(before returning FALSE) for convenience.
* allchblk.c (GC_allochblk_nth): Use GC_PRIdPTR in WARN() format
string.
* pthread_support.c (start_mark_threads, GC_thr_init): Likewise.
* win32_threads.c (GC_delete_thread): Likewise.
* include/private/gc_priv.h (GC_PRIdPTR): New macro.
* pthread_stop_world.c (GC_suspend_handler_inner): Remove
unnecessary cast for WARN argument.
* pthread_support.c (start_mark_threads): if pthread_create()
failed then don't try to create other marker threads and (after
printing a warning) adjust GC_markers and GC_parallel values; log
GC_markers value (possibly adjusted) after that.
* win32_threads.c (start_mark_threads): if pthread_create() is
failed then don't try to create other marker threads and (after
printing a warning) adjust GC_markers and GC_parallel values.
* win32_threads.c (mark_mutex_event, builder_cv, mark_cv): Move
the definition upper (to be visible in start_mark_threads()).
* win32_threads.c (start_mark_threads): if CreateThread() or
_beginthreadex() is failed then don't try to create other marker
threads and (after printing a warning) adjust GC_markers,
GC_parallel values, and destroy the event objects (either only
some for the uncreated threads if DONT_USE_SIGNALANDWAIT or all if
not a single thread is created).
* win32_threads.c (GC_thr_init): Log GC_markers value (possibly
adjusted) after start_mark_threads() call.
* Makefile.am: Back remove "GC_" prefix for PTHREADS,
DARWIN_THREADS, WIN32_THREADS (for configure.ac).
* include/private/gc_priv.h: Change include of config.h to
private/config.h.
* include/private/gc_pmark.h: Likewise.
* gc_cpp.cc: Likewise.
* tests/test.c: Likewise.
* tests/test_cpp.cc: Include private/config.h (if HAVE_CONFIG_H);
undefine GC_BUILD.
* finalize.c (GC_general_register_disappearing_link): Return
GC_SUCCESS, GC_DUPLICATE, GC_NO_MEMORY (instead of 0, 1 and 2,
respectively).
* include/gc.h (GC_NO_MEMORY): New macro (defined as 2).
* include/gc.h (GC_register_disappearing_link,
GC_general_register_disappearing_link): Update the comment.
* typd_mlc.c (GC_calloc_explicitly_typed): Use GC_NO_MEMORY macro.
* finalize.c (GC_general_register_disappearing_link,
GC_register_finalizer_inner): Recalculate the hash table index
after GC_oom_fn succeeded (since the table may grow while not
holding the lock) and check again that the entry is still not in
the table (free the unused entry otherwise unless DBG_HDRS_ALL).
* finalize.c (GC_register_finalizer_inner): Initialize "hhdr"
local variable (to prevent a compiler warning).
* finalize.c (GC_register_finalizer_inner): Don't modify the data
pointed by "ocd" and "ofn" in GC_register_finalizer_inner() failed
(due to out of memory).
* alloc.c (GC_set_fl_marks, GC_clear_fl_marks): Transform loop to
suppress compiler "variable might be uninitialized" warnings.
* Makefile.direct (DONT_USE_SIGNALANDWAIT): Add the comment for.
* win32_threads.c (DONT_USE_SIGNALANDWAIT): Always define for
WinCE.
* win32_threads.c (THREAD_HANDLE): Cast Id (of DWORD type) to
HANDLE thru word type (to avoid a compiler warning) for WinCE.
* win32_threads.c (GC_marker_cv, GC_marker_Id): New static array
(only if DONT_USE_SIGNALANDWAIT).
* win32_threads.c (start_mark_threads): Initialize GC_marker_Id
and GC_marker_cv for each helper thread (only if
DONT_USE_SIGNALANDWAIT).
* win32_threads.c (GC_mark_mutex_state): New static variable (only
if DONT_USE_SIGNALANDWAIT).
* win32_threads.c (GC_mark_mutex_waitcnt,
signalObjectAndWait_func): Don't define if DONT_USE_SIGNALANDWAIT.
* win32_threads.c (GC_acquire_mark_lock, GC_release_mark_lock):
Use InterlockedExchange() over GC_mark_mutex_state (instead of
AO_fetch_and_add()) if DONT_USE_SIGNALANDWAIT.
* win32_threads.c (GC_wait_marker, GC_notify_all_marker):
Implement wait/broadcast primitives using Win32 multiple events
(one for each marker thread) if DONT_USE_SIGNALANDWAIT (instead of
using Win32 SignalObjectAndWait).
* win32_threads.c (GC_thr_init): Don't declare hK32 local
variable, don't check for GC_wnt, and don't initialize
signalObjectAndWait_func if DONT_USE_SIGNALANDWAIT.
* alloc.c (GC_finish_collection): Call GC_print_finalization_stats
if GC_print_stats (after getting "done_time").
* finalize.c (GC_old_dl_entries): New static variable (only if not
SMALL_CONFIG).
* finalize.c (GC_finalize): Save current GC_dl_entries value (only
if not SMALL_CONFIG).
* finalize.c (GC_print_finalization_stats): Define if and only if
not SMALL_CONFIG; use GC_old_dl_entries value; use GC_log_printf()
instead of GC_printf(); use "%lu" (instead of "%u") print format
specifier; use unsigned long type for "ready" counter (for LP64
targets).
* misc.c (GC_dump): No longer call GC_print_finalization_stats()
here (since it is called from GC_finish_collection()).
* misc.c (STACKBASE): Remove unused macro undef (for NOSYS and
ECOS).
* alloc.c (GC_expand_hp): Replace GC_init_inner() call with
GC_init() one.
* malloc.c (GC_alloc_large, GC_generic_malloc_inner): Likewise.
* mallocx.c (GC_generic_malloc_many): Likewise.
* misc.c (GC_enable_incremental): Likewise.
* alloc.c (GC_expand_hp): Update the comment.
* mark.c (GC_obj_kinds): Likewise.
* win32_threads.c (GC_allow_register_threads): Likewise.
* private/gc_priv.h (GC_init_inner): Remove function declaration.
* misc.c (GC_init_inner): Replace with public GC_init().
* gcj_mlc.c (GC_gcj_fake_mark_proc): New static function.
* gcj_mlc.c (GC_init_gcj_malloc): If mp is 0 then supply
GC_gcj_fake_mark_proc (aborting with the appropriate message)
instead.
* os_dep.c (GC_wince_get_mem): If VirtualAlloc() returns NULL (due
to out of memory) then don't increment GC_n_heap_bases and don't
call VirtualAlloc() again (with MEM_COMMIT).
* os_dep.c (GC_remap): Abort with a more informatory message if
VirtualAlloc() fails due to out of memory; update FIXME.
* Makefile: Fix typo for msvc_dbg.c.
* Makefile.direct: Likewise.
* Makefile.am: Prefix PTHREADS, DARWIN_THREADS, WIN32_THREADS with
"GC_".
* Makefile.dj: Don't reference remove files (nursery.c,
gc_nursery.h, gc_copy_descr.h).
* NT_MAKEFILE: Don't define __STDC__ macro (no longer used).
* NT_STATIC_THREADS_MAKEFILE: Likewise.
* NT_THREADS_MAKEFILE: Likewise.
* NT_X64_STATIC_THREADS_MAKEFILE: Likewise.
* NT_X64_THREADS_MAKEFILE: Likewise.
* gc.mak: Likewise.
* NT_MAKEFILE: Remove unnecessary -DGC_BUILD (since it is always
defined in the source files).
* NT_THREADS_MAKEFILE: Likewise.
* NT_X64_THREADS_MAKEFILE: Likewise.
* gc.mak: Likewise.
* NT_X64_THREADS_MAKEFILE: Fix typo for -DGC_NOT_DLL.
* NT_STATIC_THREADS_MAKEFILE: Replace GC_WIN32_THREADS with
GC_THREADS.
* NT_THREADS_MAKEFILE: Likewise.
* NT_X64_STATIC_THREADS_MAKEFILE: Likewise.
* NT_X64_THREADS_MAKEFILE: Likewise.
* gc.mak: Likewise.
* NT_MAKEFILE: Define _CRT_SECURE_NO_DEPRECATE to suppress the
compiler warnings.
* NT_STATIC_THREADS_MAKEFILE: Likewise.
* NT_X64_STATIC_THREADS_MAKEFILE: Place -D_CRT_SECURE_NO_DEPRECATE
before "$*.C" (and "$*.CPP").
* NT_X64_THREADS_MAKEFILE: Likewise.
* doc/README.solaris2: Replace GC_SOLARIS_THREADS with GC_THREADS.
* doc/README.win32: Replace GC_WIN32_THREADS with GC_THREADS.
* doc/README.win64: Add info about mingw-w64; add note for VC++
warnings suppression.
* os_dep.c (GC_forward_exception): Fix logic in several places.
(OSX-specific)
* include/private/gc_priv.h (MAX_HEAP_SECTS): Guard with ifndef.
* Makefile.direct: Copy missing information for -DSHORT_DBG_HDRS
from Makefile.
* Makefile: Remove the information about "define arguments" (which
is incomplete and outdated compared to that in Makefile.direct);
add help reference to Makefile.direct.
* Makefile.dj: Likewise.
* alloc.c (world_stopped_total_time, world_stopped_total_divisor):
Replace "STATIC" with "static" in the definition (since the
symbols aren't prefixed with "GC_").
* win32_threads.c (marker_sp, marker_bsp, marker_last_stack_min,
start_mark_threads, mark_mutex, builder_cv, mark_cv,
mark_mutex_event, signalObjectAndWait_func, main_thread_start):
Likewise.
* pthread_support.c (GC_wait_builder): Define as STATIC.
* win32_threads.c (GC_wait_builder): Likewise.
* misc.c (GC_get_heap_size_inner, GC_get_free_bytes_inner): New
API function.
* include/gc_pmark.h (GC_get_heap_size_inner,
GC_get_free_bytes_inner): New function declaration.
* include/gc.h: Recognize __CEGCC__ (as a synonym for _WIN32_WCE).
* include/gc_config_macros.h: Likewise.
* include/gc.h (GC_MAXIMUM_HEAP_SIZE): Recognize new macro.
* include/gc.h (GC_INIT_CONF_MAXIMUM_HEAP_SIZE): New macro (for
internal use).
* include/gc_config_macros.h: Always include stddef.h if GCC.
* include/gc_config_macros.h (GC_API): Define for CeGCC in the
same way as for MinGW.
* include/gc_config_macros.h (GC_API): Group the definition for
all cases together (check for GC_DLL only once).
* include/gc_pthread_redirects.h: Group non-Darwin code together.
* tests/test.c: Recognize GC_PRINT_VERBOSE_STATS (only if GC_DLL).
* Makefile.direct (GC_PTHREADS_PARAMARK, GC_IGNORE_GCJ_INFO,
GC_PRINT_VERBOSE_STATS, GC_DONT_EXPAND, GC_INITIAL_HEAP_SIZE,
GC_FREE_SPACE_DIVISOR, GC_TIME_LIMIT, GC_FULL_FREQ): Add the
comment for.
* misc.c (GC_init_inner): Recognize GC_PRINT_VERBOSE_STATS (new
macro).
* dyn_load.c (GC_wnt): Change definition to TRUE for WinCE; add
FIXME and the comment for WinCE.
* gcj_mlc.c (GC_init_gcj_malloc): Recognize GC_IGNORE_GCJ_INFO
(new macro).
* include/gc.h (GC_HAVE_BUILTIN_BACKTRACE): Don't define for VC++
WinCE (since backtrace() is unimplemented).
* include/private/gc_priv.h (GC_n_heap_bases): Remove declaration
(since static).
* os_dep.c (GC_n_heap_bases): Define as STATIC; move the
definition to be above GC_is_heap_base().
* include/private/gcconfig.h: Don't define NOSYS for WinCE on ARM
(both for MinGW and CeGCC toolchains).
* include/private/gcconfig.h: Recognize __CEGCC__ and
__MINGW32CE__ (as synonyms for __WIN32_WCE).
* include/private/gcconfig.h: If SH4 then don't set config
parameters for SH.
* include/private/thread_local_alloc.h (GC_key_create): Don't
abort on failures, just return -1 in these cases (this also
prevents compilation error for targets where ABORT is defined
indirectly as an inline assembler sequence).
* mark.c (WRAP_MARK_SOME): Also define for WinCE; add FIXME for
the GCC-based cross-compiler.
* mark.c (ext_ex_regn, mark_ex_handler): Don't define unless
WRAP_MARK_SOME is defined; define also for WinCE case; don't
check for _WIN64 (since WRAP_MARK_SOME is undefined for it).
* mark.c (GC_mark_some): Use __try/__except also for WinCE; update
the comment.
* misc.c: Include signal.h after gc_pmark.h included; check for
MSWINCE instead of _WIN32_WCE.
* misc.c (GC_init_inner): Remove duplicate GC_setpagesize() call.
* misc.c: Don't include <crtdbg.h> for WinCE targets.
* misc.c (GC_write): Define _MAX_PATH if undefined (workaround for
CeGCC toolchain).
* misc.c (GC_write): Use OutputDebugStringW() instead of
_CrtDbgReport() for WinCE targets.
* os_dep.c (GC_least_described_address): Define as STATIC.
* os_dep.c (GC_register_data_segments): Fix code indentation.
* os_dep.c (GC_wince_get_mem): Initialize "result" local variable
(to prevent a compiler warning).
* os_dep.c (GC_dirty_init): Add comment for WinCE target.
* tests/test.c: Don't include winbase.h directly if GCC for WinCE,
include assert.h instead.
* tests/test.c (tiny_reverse_test): Define and use
TINY_REVERSE_UPPER_VALUE macro (4 if VERY_SMALL_CONFIG else 10);
useful for WinCE.
* win32_threads.c (GC_Thread_Rep): Don't declare "handle" field
for WinCE (since thread Id is used as a "real" thread handle).
* win32_threads.c (THREAD_HANDLE): New macro.
* win32_threads.c (GC_register_my_thread_inner): Don't recognize
DONT_IMPORT_GETCURTHREAD anymore; don't record thread handle on
WinCE.
* Makefile.direct (DONT_IMPORT_GETCURTHREAD): Remove comment for.
* win32_threads.c (UNPROTECT, GC_fault_handler_lock): Don't check
for MSWINCE.
* win32_threads.c (GC_delete_gc_thread, GC_delete_thread): Don't
close thread handle on WinCE (since it's a thread Id).
* win32_threads.c (GC_suspend): Don't check for MSWINCE in the
MPROTECT-related code (for the case if MPROTECT_VDB would be
implemented for WinCE).
* win32_threads.c (GC_suspend, GC_start_world, GC_push_stack_for):
Use THREAD_HANDLE(t) to obtain thread handle.
* win32_threads.c (GC_PTHREADS_PARAMARK): New macro recognized;
implicitly define GC_PTHREADS_PARAMARK if GC_PTHREADS; include
pthread.h; define NUMERIC_THREAD_ID(id) if undefined yet; replace
GC_PTHREADS with GC_PTHREADS_PARAMARK where appropriate (for the
parallel mark support).
* win32_threads.c (start_mark_threads): Use int type for "i" local
variable (instead of "unsigned") to prevent a compiler warning.
* win32_threads.c (start_mark_threads): Don't check CreateThread()
result for -1; call CloseHandle() for the handle created by
CreateThread() (on WinCE); don't use errno (since errno.h is
missing on some targets like WinCE) when printing warning on a
marker thread creation failure.
* win32_threads.c (signalObjectAndWait_func): Define for WinCE.
* win32_threads.c (GC_wait_marker): Remove unnecessary assertion
for non-zero signalObjectAndWait_func (to make the code compilable
for WinCE).
* win32_threads.c (GC_thr_init): Allow PARALLEL_MARK for WinCE;
use GC_sysinfo to get processors count if WinCE; don't check for
SignalObjectAndWait() if WinCE; replace GC_PTHREADS with
GC_PTHREADS_PARAMARK.
* win32_threads.c (GC_thr_init): Recognize GC_MIN_MARKERS new
macro (useful for testing parallel marking on WinCE).
* win32_threads.c (GC_win32_start, main_thread_start): Define as
STATIC.
* win32_threads.c: Don't define main_thread_args,
main_thread_start(), WinMain() for WinCE if GC_DLL.
* win32_threads.c (WINCE_MAIN_STACK_SIZE): Remove useless macro
(since the stack size parameter is ignored on WinCE).
* win32_threads.c (main_thread_start): Remove forward declaration;
place its definition before WinMain() one.
* win32_threads.c (WinMain): Abort if GC_CreateThread() or
WaitForSingleObject() failed (for the main thread).
* allchblk.c (MUNMAP_THRESHOLD): Move macro definition out of
a function.
* allchblk.c (GC_unmap_threshold): New global variable definition
(initialized to MUNMAP_THRESHOLD).
* allchblk.c (GC_unmap_old): Use GC_unmap_threshold instead of
MUNMAP_THRESHOLD; skip unmapping if GC_unmap_threshold is 0.
* doc/README.environment (GC_UNMAP_THRESHOLD): Add information.
* misc.c (GC_unmap_threshold): New variable declaration.
* misc.c (GC_init_inner): Recognize "GC_UNMAP_THRESHOLD"
environment variable to set GC_unmap_threshold value (only if
USE_MUNMAP).
* dbg_mlc.c (OFN_UNSET): New macro (to detect
GC_register_finalizer() failures).
* dbg_mlc.c (store_old): Add a check for register_finalizer()
failure caused by an out-of-memory event (leave *ofn and *ocd
unmodified in that case).
* dbg_mlc.c (GC_debug_register_finalizer,
GC_debug_register_finalizer_no_order,
GC_debug_register_finalizer_unreachable,
GC_debug_register_finalizer_ignore_self): Initialize my_old_fn
to OFN_UNSET; clear *ocd and *ofn for non-heap objects (the same
as in GC_register_finalizer_inner()).
* Makefile.direct (GC_DLL): Add the comment for.
* doc/README.macros: Fix a typo.
* doc/README.macros (_DLL, GC_DLL, GC_NOT_DLL): Update info.
* doc/README.macros (__STDC__): Remove info.
* dbg_mlc.c (GC_get_back_ptr_info, GC_generate_random_heap_address,
GC_generate_random_valid_address, GC_print_backtrace,
GC_generate_random_backtrace, GC_register_describe_type_fn): Add
GC_API and GC_CALL to function definition.
* malloc.c (GC_generic_malloc): Likewise.
* mallocx.c (GC_incr_bytes_allocd, GC_incr_bytes_freed): Likewise.
* mark.c (GC_mark_and_push): Likewise.
* misc.c (GC_new_free_list_inner, GC_new_free_list,
GC_new_kind_inner, GC_new_kind, GC_new_proc_inner, GC_new_proc):
Likewise.
* include/gc_backptr.h (GC_get_back_ptr_info,
GC_generate_random_heap_address, GC_generate_random_valid_address,
GC_generate_random_backtrace, GC_print_backtrace): Add GC_API and
GC_CALL to function prototype.
* include/gc_mark.h (GC_mark_and_push, GC_new_free_list,
GC_new_free_list_inner, GC_new_kind, GC_new_kind_inner,
GC_new_proc, GC_new_proc_inner, GC_generic_malloc,
GC_register_describe_type_fn): Likewise.
* include/new_gc_alloc.h (GC_incr_bytes_allocd, GC_incr_mem_freed,
GC_generic_malloc_words_small): Likewise.
* gc_cpp.cc: Include "config.h" (if HAVE_CONFIG_H defined).
* include/private/gc_pmark.h: Likewise.
* include/private/gc_priv.h: Likewise.
* tests/test.c: Likewise.
* gc_cpp.cc: Define GC_BUILD.
* include/private/gc_pmark.h: Likewise.
* include/private/gc_priv.h: Likewise.
* gc_dlopen.c (WRAP_FUNC, REAL_FUNC): New macro.
* gc_dlopen.c (dlopen): Add GC_API to the wrapper function
definition.
* pthread_support.c (GC_pthread_create, GC_pthread_sigmask,
GC_pthread_join, GC_pthread_detach, pthread_sigmask, pthread_join,
pthread_detach, pthread_create): Likewise.
* win32_threads.c (GC_pthread_join, GC_pthread_create,
GC_pthread_sigmask, GC_pthread_detach): Likewise.
* gc_dlopen.c (dlopen): Use WRAP_FUNC and REAL_FUNC macros.
* include/gc_backptr.h: Include "gc.h".
* include/gc_backptr.h: Use extern "C" for the exported functions.
* include/gc_mark.h: Likewise.
* include/gc_config_macros.h (GC_THREADS): Define the macro if any
GC_XXX_THREADS is defined.
* include/gc_config_macros.h (_PTHREADS, _POSIX4A_DRAFT10_SOURCE):
Move the definitions below the place where GC_NETBSD_THREADS and
GC_DGUX386_THREADS are defined.
* include/gc_config_macros.h (GC_DLL): Don't define (even if _DLL
is defined) for GCC.
* include/gc_config_macros.h (GC_API): Define for Cygwin (in the
same way as for VC++); define for GCC v4+ (other than already
recognized MinGW/Cygwin) as a "default" visibility attribute if
GC_DLL is defined.
* include/gc_config_macros.h (GC_ATTR_MALLOC, GC_ATTR_ALLOC_SIZE):
New macro.
* include/gc.h (GC_malloc, GC_malloc_atomic, GC_strdup,
GC_malloc_uncollectable, GC_malloc_stubborn, GC_memalign,
GC_malloc_atomic_uncollectable, GC_malloc_ignore_off_page,
GC_malloc_atomic_ignore_off_page, GC_debug_malloc,
GC_debug_malloc_atomic, GC_debug_strdup,
GC_debug_malloc_uncollectable, GC_debug_malloc_stubborn,
GC_debug_malloc_ignore_off_page,
GC_debug_malloc_atomic_ignore_off_page,
GC_debug_malloc_replacement): Add GC_ATTR_MALLOC attribute.
* include/gc_gcj.h (GC_gcj_malloc, GC_debug_gcj_malloc,
GC_gcj_malloc_ignore_off_page): Likewise.
* include/gc.h (GC_malloc, GC_malloc_atomic,
GC_malloc_uncollectable, GC_malloc_stubborn,
GC_malloc_atomic_uncollectable, GC_malloc_ignore_off_page,
GC_malloc_atomic_ignore_off_page, GC_debug_malloc,
GC_debug_malloc_atomic, GC_debug_malloc_uncollectable,
GC_debug_malloc_stubborn, GC_debug_malloc_ignore_off_page,
GC_debug_malloc_atomic_ignore_off_page,
GC_debug_malloc_replacement: Add GC_ATTR_ALLOC_SIZE attribute
(for the first argument).
* include/gc_gcj.h (GC_gcj_malloc, GC_debug_gcj_malloc,
GC_gcj_malloc_ignore_off_page): Likewise.
* include/gc.h (GC_memalign, GC_realloc, GC_debug_realloc,
GC_debug_realloc_replacement): Add GC_ATTR_ALLOC_SIZE attribute
(for the second argument).
* include/gc.h (GC_malloc, GC_malloc_atomic, GC_strdup,
GC_malloc_uncollectable, GC_malloc_stubborn, GC_memalign,
GC_malloc_atomic_uncollectable, GC_free, GC_base, GC_size,
GC_realloc, GC_expand_hp, GC_set_max_heap_size,
GC_exclude_static_roots, GC_add_roots, GC_remove_roots,
GC_register_displacement, GC_debug_register_displacement,
GC_try_to_collect, GC_malloc_ignore_off_page,
GC_malloc_atomic_ignore_off_page, GC_debug_malloc,
GC_debug_malloc_atomic, GC_debug_strdup,
GC_debug_malloc_uncollectable, GC_debug_malloc_stubborn,
GC_debug_malloc_ignore_off_page,
GC_debug_malloc_atomic_ignore_off_page, GC_debug_free,
GC_debug_realloc, GC_debug_malloc_replacement,
GC_debug_realloc_replacement, GC_finalization_proc,
GC_register_finalizer, GC_debug_register_finalizer,
GC_register_finalizer_ignore_self,
GC_debug_register_finalizer_ignore_self,
GC_register_finalizer_no_order,
GC_debug_register_finalizer_no_order,
GC_register_finalizer_unreachable,
GC_debug_register_finalizer_unreachable,
GC_register_disappearing_link,
GC_general_register_disappearing_link,
GC_unregister_disappearing_link, GC_noop1, GC_warn_proc,
GC_set_warn_proc, GC_ignore_warn_proc, GC_fn_type,
GC_call_with_alloc_lock, GC_stack_base_func,
GC_call_with_stack_base, GC_same_obj, GC_pre_incr, GC_post_incr,
GC_is_visible, GC_is_valid_displacement, GC_same_obj_print_proc,
GC_is_valid_displacement_print_proc, GC_is_visible_print_proc,
GC_malloc_many, GC_CreateThread, GC_beginthreadex,
GC_endthreadex): Comment out (or remove if single and meaningless)
function argument names (to avoid identifiers out of the name
space).
* include/gc_gcj.h (GC_init_gcj_malloc, GC_gcj_malloc,
GC_debug_gcj_malloc, GC_gcj_malloc_ignore_off_page): Likewise.
* include/gc.h (GC_try_to_collect): Update the comment.
* include/gc.h (GC_size, GC_register_my_thread): Add const
qualifier for the argument referent.
* misc.c (GC_size): Likewise.
* pthread_support.c (GC_register_my_thread_inner,
GC_register_my_thread): Likewise.
* win32_threads.c (GC_register_my_thread_inner,
GC_register_my_thread): Likewise.
* include/gc.h (GC_INIT_CONF_ROOTS): New macro for internal use
(define instead of GC_INIT() for Cygwin and AIX).
* include/gc.h (GC_DONT_EXPAND, GC_MAX_RETRIES,
GC_FREE_SPACE_DIVISOR, GC_FULL_FREQ, GC_TIME_LIMIT, GC_IGNORE_WARN,
GC_INITIAL_HEAP_SIZE): Recognize new macro.
* include/gc.h (GC_INIT_CONF_DONT_EXPAND, GC_INIT_CONF_MAX_RETRIES,
GC_INIT_CONF_FREE_SPACE_DIVISOR, GC_INIT_CONF_FULL_FREQ,
GC_INIT_CONF_TIME_LIMIT, GC_INIT_CONF_IGNORE_WARN,
GC_INIT_CONF_INITIAL_HEAP_SIZE): New macro for internal use.
* include/gc.h (GC_INIT): Use GC_INIT_CONF_XXX macros.
* include/gc_mark.h: Prefix GC_H with '_'.
* include/gc_mark.h (GC_least_plausible_heap_addr,
GC_greatest_plausible_heap_addr, GC_debug_header_size): Use GC_API
for the public variable declaration.
* include/new_gc_alloc.h (GC_objfreelist_ptr, GC_aobjfreelist_ptr,
GC_uobjfreelist_ptr, GC_auobjfreelist_ptr): Likewise.
* include/gc_pthread_redirects.h (GC_pthread_create,
GC_pthread_sigmask, GC_dlopen, GC_pthread_join, GC_pthread_detach):
Use GC_API for the wrapper prototype.
* include/gc_pthread_redirects.h (pthread_create, pthread_join,
pthread_detach, pthread_sigmask, dlopen): Undefine unconditionally
before redirecting.
* include/new_gc_alloc.h: Replace GC_incr_mem_freed() with
GC_incr_bytes_freed(); remove FIXME.
* include/private/gc_priv.h (GC_make_closure,
GC_debug_invoke_finalizer, GC_noop): Remove GC_API for the private
function.
* tests/test.c (GC_print_stats): Handle GC_DLL case regardless of
the target.
* finalize.c (GC_general_register_disappearing_link,
GC_register_finalizer_inner): Remove unnecessary "ifdef THREADS"
guard for LOCK/UNLOCK().
* finalize.c (GC_general_register_disappearing_link,
GC_register_finalizer_inner): Get GC_oom_fn value before releasing
the lock (to prevent data races).
* gcj_mlc.c (GC_gcj_malloc, GC_debug_gcj_malloc,
GC_gcj_malloc_ignore_off_page): Likewise.
* mallocx.c (GC_generic_malloc_ignore_off_page): Likewise.
* include/gc_inline.h (GC_FAST_MALLOC_GRANS): Use GC_get_oom_fn()
instead of GC_oom_fn (to prevent data races).
* malloc.c (GC_generic_malloc): Likewise.
* mallocx.c (GC_memalign): Likewise.
* pthread_support.c (pthread_create): Likewise.
* gcj_mlc.c (maybe_finalize): Acquire the lock before setting
last_finalized_no value to prevent data races.
* include/gc.h (GC_gc_no, GC_get_gc_no, GC_oom_fn, GC_set_oom_fn,
GC_set_find_leak, GC_set_finalize_on_demand,
GC_set_java_finalization, GC_set_finalizer_notifier,
GC_set_dont_expand, GC_set_full_freq, GC_set_non_gc_bytes,
GC_set_no_dls, GC_set_free_space_divisor, GC_set_max_retries,
GC_set_dont_precollect, GC_set_time_limit, GC_warn_proc): Refine
the comment.
* misc.c (GC_set_oom_fn): Likewise.
* include/gc.h (GC_general_register_disappearing_link): Refine the
comment (replace "soft" word with "weak").
* misc.c (GC_oom_fn, GC_get_gc_no, GC_get_parallel,
GC_set_finalizer_notifier, GC_set_find_leak): Add the comment.
* misc.c (GC_set_oom_fn, GC_get_oom_fn, GC_set_finalizer_notifier,
GC_get_finalizer_notifier): Use LOCK/UNLOCK to prevent data races.
* dbg_mlc.c: Guard include <errno.h> with ifndef MSWINCE; include
"private/dbg_mlc.h" before it.
* malloc.c: Likewise.
* dbg_mlc.c (GC_debug_strdup): Use memcpy() instead of strcpy()
for WinCE (since deprecated); evaluate strlen() only once; don't
set errno for WinCE.
* malloc.c (GC_strdup): Likewise.
* dyn_load.c (GC_wnt): Define as macro (FALSE) for WinCE.
* include/gc.h (GC_unregister_my_thread): Refine the comment.
* include/gc.h (GC_uintptr_t, GC_beginthreadex, GC_endthreadex):
Don't declare for WinCE.
* include/gc.h (GC_WINMAIN_WINCE_LPTSTR): New macro (WinCE only).
* include/gc.h (GC_WinMain): Remove GC_API.
* include/gc.h (GC_WinMain): Use GC_WINMAIN_WINCE_LPTSTR for
lpCmdLine.
* tests/test.c (GC_WinMain): Likewise.
* win32_threads.c (main_thread_args, GC_WinMain): Likewise.
* include/gc_config_macros.h (ptrdiff_t): Guard with
ifndef _PTRDIFF_T_DEFINED; define _PTRDIFF_T_DEFINED macro.
* include/private/gc_locks.h: Guard include "atomic_ops.h" with
ifdef GC_PTHREADS (and not GC_WIN32_THREADS).
* mark.c: Include "atomic_ops.h" if PARALLEL_MARK.
* thread_local_alloc.c: Include "atomic_ops.h" if GC_GCJ_SUPPORT.
* win32_threads.c: Include "atomic_ops.h" if MPROTECT_VDB.
* include/private/gc_locks.h: Use include "atomic_ops.h" instead
of include <atomic_ops.h>.
* include/private/gc_priv.h: Likewise.
* include/private/gc_locks.h (GC_allocate_ml, GC_need_to_lock):
Don't export (replace GC_API to "extern").
* win32_threads.c (GC_allocate_ml): Don't export.
* include/private/gc_priv.h (DebugBreak): Define as macro for
WinCE (if not UNDER_CE and DebugBreak is not defined yet).
* include/private/gc_priv.h (UNALIGNED): Rename to UNALIGNED_PTRS
(since "UNALIGNED" is defined in winnt.h of WinCE).
* mark.c (UNALIGNED): Likewise.
* include/private/gcconfig.h (ARM32): Recognize _M_ARM and _ARM_.
* include/private/gcconfig.h (ALIGNMENT): Check always defined.
* include/private/gcconfig.h: Allow GC_WIN32_THREADS for WinCE.
* include/private/thread_local_alloc.h: Define USE_WIN32_SPECIFIC
for WinCE (since __declspec(thread) is unsupported).
* include/private/thread_local_alloc.h (TLS_OUT_OF_INDEXES):
Define for WinCE (if undefined).
* malloc.c (GC_malloc): Remove outdated comment about disabling
signals.
* misc.c: Don't include <tchar.h> (since not used anymore and may
break TEXT() macro defined in winnt.h).
* misc.c (GC_init_inner): Don't use GetModuleHandle() and
InitializeCriticalSectionAndSpinCount() for WinCE.
* misc.c (GC_init_inner): Replace GetModuleHandleA() with
GetModuleHandle() (and use TEXT() macro controlled by UNICODE).
* misc.c (LOG_FILE): Remove unused macro; don't use _T() macro.
* misc.c (GC_CreateLogFile): New static function (Win32/WinCE
only); move the code from GC_write(); replace GETENV() with
GetEnvironmentVariable(); replace CreateFileA() with
CreateFile(); use TEXT() macro (for Unicode support); replace
strcat() with memcpy() (since deprecated in WinCE).
* misc.c (GC_write): Define as STATIC.
* win32_threads.c (GC_attached_thread): Likewise.
* misc.c (GC_write): Use GC_CreateLogFile().
* misc.c: Define vsnprintf macro as StringCchVPrintfA for WinCE.
* misc.c (GC_abort): Try to invoke MessageBoxA() dynamically
(Win32 only) if DONT_USE_USER32_DLL is defined.
* misc.c (GC_abort): Duplicate msg to GC log file (for Win32 and
WinCE).
* misc.c (GC_abort): Use a more user-friendly abort if
NO_DEBUGGING (Win32 only).
* os_dep.c: Include "atomic_ops.h" only if MPROTECT_VDB (and
THREADS).
* os_dep.c (detect_GetWriteWatch): Use TEXT() for GetModuleHandle
(for Unicode support); check GetModuleHandle() result.
* tests/test.c: Don't define assert for WinCE (since may be
redefined by "assert.h" included from libatomic_ops).
* tests/test.c (FAIL): Define as ABORT for all targets (except
for PCR).
* tests/test.c (n_tests): Don't use AO_t.
* tests/test.c (check_heap_stats): Don't cast n_tests.
* tests/test.c (inc_int_counter): New function (for n_tests atomic
incrementation).
* tests/test.c (run_one_test): Test GC_memalign() for all targets.
* tests/test.c (run_one_test): Avoid unbalanced brackets in
#if-#else-#endif blocks.
* tests/test.c (run_one_test): Replace AO_fetch_and_add1() and
private LOCK/UNLOCK with GC_call_with_alloc_lock(inc_int_counter).
* tests/test.c (check_heap_stats): Replace
"if (sizeof(char *) > 4)" with "#if CPP_WORDSZ == 64" to suppress
"unreachable code" compiler warning.
* tests/test.c (WinMain): Set cmd type to LPWSTR (for WinCE
"UNDER_CE" mode); else use LPSTR type (for Win32 and WinCE).
* tests/test.c (thr_window): Replace "L" string prefix with
TEXT().
* thread_local_alloc.c: Check THREADS is defined (to prevent other
compiler errors and warnings otherwise).
* tests/test.c (WinMain): Recognize GC_NO_DLLMAIN macro (for
GC_use_DllMain()).
* Makefile.direct (GC_NO_DLLMAIN, DONT_IMPORT_GETCURTHREAD): Add
the comments for.
* win32_threads.c (GC_register_my_thread_inner): Recognize
DONT_IMPORT_GETCURTHREAD macro.
* win32_threads.c: Recognize GC_NO_DLLMAIN macro (to exclude
DllMain support if needed).
* win32_threads.c (GC_NO_DLLMAIN): Define implicitly if DllMain
thread registration is unsupported for a given configuration.
* win32_threads.c (GC_use_DllMain): Update the comment; refine
ABORT message.
* win32_threads.c (GC_use_DllMain,
GC_started_thread_while_stopped, GC_register_my_thread_inner,
GC_lookup_thread_inner, GC_delete_gc_thread,
GC_allow_register_threads, GC_lookup_pthread,
GC_push_thread_structures, GC_stop_world, GC_push_all_stacks):
Check for GC_NO_DLLMAIN.
* win32_threads.c (GC_Thread_Rep.tm_in_use, GC_attached_thread,
DllMain): Don't define if GC_NO_DLLMAIN.
* win32_threads.c (GC_stop_world): Declare "i" and "max" local
variables only if not GC_NO_DLLMAIN (to suppress compiler
warning).
* win32_threads.c (GC_mark_thread, start_mark_threads): Use
CreateThread() instead of _beginthreadex() for WinCE.
* win32_threads.c (MARK_THREAD_STACK_SIZE, WINCE_MAIN_STACK_SIZE):
New macros defined (used by start_mark_threads(), WinMain()).
* win32_threads.c (GC_thr_init): Exclude parallel-specific code on
WinCE for now (since getenv(), GetProcessAffinityMask() and
SignalObjectAndWait() are missing on WinCE).
* win32_threads.c (GC_thr_init): replace GetModuleHandleA() with
GetModuleHandle(); replace CreateEventA() with CreateEvent(); use
TEXT() macro (for Unicode support).
* include/gc.h (GC_has_static_roots_func): New typedef (user filter
callback).
* include/gc.h (GC_register_has_static_roots_callback): Use
GC_has_static_roots_func type.
* dyn_load.c (GC_has_static_roots,
GC_register_has_static_roots_callback): Likewise.
* dyn_load.c (GC_has_static_roots,
GC_register_has_static_roots_callback): Define on all platforms.
* dyn_load.c (GC_register_dynlib_callback,
GC_register_dynamic_libraries, GC_init_dyld): Replace K&R-style
functions definition with the ANSI C one.
* dyn_load.c (GC_register_dynlib_callback): Use new local variable
"callback" (initialized from GC_has_static_roots) to minimize data
races.
* dyn_load.c (GC_register_dynamic_libraries_dl_iterate_phdr,
GC_cond_add_roots): Define as STATIC.
* mark_rts.c (GC_remove_roots_inner): Likewise.
* dyn_load.c (GC_dyld_image_add): Don't call GC_add_roots() for
sections smaller than pointer size (just to avoid acquiring the
lock unnecessarily).
* dyn_load.c (GC_dyld_name_for_hdr): Define unconditionally (not
only for DARWIN_DEBUG).
* dyn_load.c (GC_dyld_image_add): Replace GC_add_roots() call with
LOCK + GC_add_roots_inner() + UNLOCK.
* dyn_load.c (GC_dyld_image_add): Call GC_has_static_roots() user
callback (if set) holding the lock; if it returns 0 then don't call
GC_add_roots_inner() for that region.
* dyn_load.c (GC_register_has_static_roots_callback): Put
"callback" value to GC_has_static_roots on all platforms.
* dyn_load.c (GC_has_static_roots): Update the comments.
* include/gc.h (GC_exclude_static_roots, GC_add_roots,
GC_remove_roots, GC_register_has_static_roots_callback): Likewise.
* include/private/gc_priv.h (struct roots): Likewise.
* include/private/gc_priv.h (GC_remove_roots_inner): Move prototype
to mark_rts.c and declare it as STATIC.
* include/private/gc_priv.h (GC_exclude_static_roots_inner): New
prototype.
* dyn_load.c (GC_register_dynamic_libraries_dl_iterate_phdr): Use
GC_exclude_static_roots_inner() instead of GC_exclude_static_roots.
* misc.c (GC_init_inner): Likewise.
* mark_rts.c (GC_exclude_static_roots_inner): New function (move
all the code from GC_exclude_static_roots(); add the comment.
* mark_rts.c (GC_add_roots_inner, GC_exclude_static_roots_inner):
add alignment assertion for the lower bound; add assertion for the
lower bound to be less than the upper one.
* mark_rts.c (GC_add_roots_inner, GC_exclude_static_roots): Adjust
the upper bound (round down to be of a pointer-aligned value);
return in case of an empty range.
* mark_rts.c (GC_exclude_static_roots): Acquire the lock and call
GC_exclude_static_roots_inner().
* mark_rts.c (GC_remove_roots): Quickly check the bounds and return
in case of a do-nothing case (before acquiring the lock).
* finalize.c (GC_fail_count): New external variable declaration.
* finalize.c (GC_reset_finalizer_nested,
GC_check_finalizer_nested): New function declarations (if THREADS
only).
* finalize.c (GC_finalizer_nested, GC_finalizer_skipped): New
static global variables (used internally by GC_finalize() and
GC_check_finalizer_nested()).
* finalize.c (GC_check_finalizer_nested): New static function
definition (only if not THREADS, used internally by
GC_notify_or_invoke_finalizers() to minimize the probability of
a deep recursion when a client finalizer tries to allocate GC
memory).
* finalize.c (GC_finalize): Reset GC_finalizer_nested value (or
call GC_reset_finalizer_nested()) if last heap expansion failed.
* finalize.c (GC_notify_or_invoke_finalizers): Access GC_gc_no,
GC_finalizer_now, GC_finalize_on_demand, GC_finalizer_notifier,
last_finalizer_notification variables holding the lock (to avoid
data races).
* finalize.c (GC_finalizer_notifier): Add comment.
* finalize.c (GC_notify_or_invoke_finalizers): Add "quick" check
for an empty finalization queue (only if THREADS and not
KEEP_BACK_PTRS/MAKE_BACK_GRAPH).
* finalize.c (GC_notify_or_invoke_finalizers): Call
GC_check_finalizer_nested() and skip GC_invoke_finalizers() call
if appropriate.
* include/private/pthread_support.h (GC_Thread_Rep): Add unsigned
finalizer_nested and finalizer_skipped fields (for internal use
by the multi-threaded GC_check_finalizer_nested()).
* win32_threads.c (GC_Thread_Rep): Likewise.
* pthread_support.c (GC_reset_finalizer_nested,
GC_check_finalizer_nested): New function definitions (the
multi-threaded variants of that in finalize.c).
* win32_threads.c (GC_reset_finalizer_nested,
GC_check_finalizer_nested): Likewise.
* alloc.c (GC_stopped_mark): Remove GC_log_printf("") (not needed
anymore and GCC produces a warning for it).
* alloc.c (GC_stopped_mark): Adjust printf argument type
specifier.
* backgraph.c: Include dbg_mlc.h before ifdef MAKE_BACK_GRAPH (for
the case when the configuration information comes from aconfig
file).
* checksums.c: Likewise.
* include/gc_allocator.h (GC_ATTR_UNUSED): Use "__unused__"
keyword instead of "unused".
* include/gc_allocator.h: Fix typos in comments.
* thread_local_alloc.c: Likewise.
* include/javaxfc.h (GC_finalize_all): Update comment.
* include/private/gc_priv.h (GC_API_PRIV): New macro (defined as
GC_API and serves only as a marker for the private but exported
symbols used by test.c only).
* include/private/gc_priv.h (GC_abort, GC_arrays, GC_is_marked,
GC_printf, GC_err_printf, GC_log_printf): Replace GC_API decl with
GC_API_PRIV one.
* include/private/gc_priv.h (GC_fo_entries): Don't export it
outside a DLL.
* include/private/gc_priv.h (GC_ATTR_FORMAT_PRINTF): New macro
designated to check the arguments correctness of printf-like
functions (currently works only for GCC v3+).
* include/private/gc_priv.h (GC_printf, GC_err_printf,
GC_log_printf): Use GC_ATTR_FORMAT_PRINTF attribute.
* dyn_load.c (HAVE_DL_ITERATE_PHDR): Break definition from use.
Define for FreeBSD 7.0+.
* mach_dep.c: Don't include ucontext.h with NO_GETCONTEXT.
* include/gc_gcj.h (GC_init_gcj_malloc): Improve descriptive
comment.
* allchblk.c (GC_merge_unmapped): Don't assume that adjacent
free blocks have different mapping status. Correctly handle gap
between blocks.
(GC_split_block): Remove dead code setting hb_flags. Add comment.
(GC_allochblk): Split blocks also in generational-only mode.
* os_dep.c (GC_unmap_gap): Don't really use munmap.
* include/private/gc_priv.h (GC_unmapped_bytes): Define as 0 for
not USE_MUNMAP case.
* Makefile.direct (MARK_BIT_PER_OBJ, PRINT_BLACK_LIST,
USE_PROC_FOR_LIBRARIES): Fix typo in the comments.
* Makefile.direct (USE_MMAP, USE_MUNMAP, THREAD_LOCAL_ALLOC,
PARALLEL_MARK, STATIC): Update the comments.
* include/private/gcconfig.h (GC_PREFER_MPROTECT_VDB): New macro
recognized (only if MPROTECT_VDB).
* Makefile.direct (DONT_USE_USER32_DLL, GC_PREFER_MPROTECT_VDB):
Add the comments for.
* os_dep.c (detect_GetWriteWatch): Recognize "GC_USE_GETWRITEWATCH"
environment variable (only if MPROTECT_VDB, if the variable is
unset when GC_PREFER_MPROTECT_VDB macro controls the strategy).
* doc/README.environment (GC_USE_GETWRITEWATCH): New variable.
* include/private/gcconfig.h (MPROTECT_VDB): Add FIXME for
USE_MUNMAP and PARALLEL_MARK cases (to relax the conditions in
the future).
* misc.c (GC_get_heap_size, GC_get_free_bytes): Ignore the memory
space returned to OS (GC_unmapped_bytes).
* include/gc.h (GC_get_heap_size, GC_get_free_bytes): Update the
comments.
* misc.c (GC_get_unmapped_bytes): New API function.
* include/gc.h (GC_get_unmapped_bytes): New API prototype.
* os_dep.c (GC_dirty_init): Move "ifdef GWW_VDB" block out of
"ifdef MSWIN32" one (for Cygwin).
* pthread_support.c (GC_allow_register_threads): New API function.
* win32_threads.c (GC_allow_register_threads): Likewise.
* include/gc.h (GC_allow_register_threads): New API prototype.
* include/gc.h (GC_register_my_thread, GC_unregister_my_thread):
Update the comments.
* pthread_support.c (GC_register_my_thread): Check the collector
is in the multi-threaded mode.
* win32_threads.c (GC_register_my_thread): Likewise.
* finalize.c (GC_finalize_all): Always call GC_invoke_finalizers
instead, following Ivan's original patch.
* allchblk.c (GC_allochblk_nth): Add assertion.
* checksums.c: Add GC_record_fault, GC_was_faulted,
CC_n_faulted_dirty_errors.
(GC_check_dirty): Remove register declarations, print
dirty bit errors on faulted pages.
* os_dep.c (GC_write_fault_handler): Call GC_record_fault().
* os_dep.c (GC_remove_protection): Compute index correctly.
== [7.2alpha2] 2009-06-12 ==
* dbg_mlc.c (GC_print_smashed_obj): Convert a group of printf()
calls into a single one (for output atomicity).
* typd_mlc.c (GC_calloc_explicitly_typed): Don't declare and use
GC_finalization_failures variable; check the result of
GC_general_register_disappearing_link() (for lack of memory)
instead.
* finalize.c (GC_finalization_failures): Remove unused global
variable.
* finalize.c (GC_general_register_disappearing_link,
GC_general_register_disappearing_link): Don't update the value of
GC_finalization_failures (since unused).
* include/private/gc_pmark.h (PUSH_ONE_CHECKED_STACK,
GC_PUSH_ONE_STACK, GC_PUSH_ONE_HEAP): The first parameter is of
word type now (as FIXUP_POINTER requires numeric argument).
* finalize.c (GC_ignore_self_finalize_mark_proc): GC_PUSH_ONE_HEAP
requires the first parameter of word type.
* mark.c (PUSH_GRANULE): Likewise.
* mark.c (GC_push_one, GC_push_all_eager): Likewise.
* finalize.c (GC_finalize_all): Call GC_invoke_finalizers() or
GC_finalizer_notifier directly, instead
of GC_INVOKE_FINALIZERS() to prevent infinite looping.
* include/javaxfc.h: Clarify GC_finalize_all comment.
* gcj_mlc.c: Include gc_pmark.h before "ifdef GC_GCJ_SUPPORT" (not
after) for configuration information.
* gcj_mlc.c (GC_gcj_malloc_ignore_off_page): Add comment.
* gcj_mlc.c (GC_gcj_malloc_ignore_off_page): Check "op" local
variable for NULL before dereferencing it, return GC_oom_fn() in
this case.
* typd_mlc.c (GC_malloc_explicitly_typed,
GC_malloc_explicitly_typed_ignore_off_page): Transform the code to
suppress compiler warning (for uninitialized "lg" variable).
* win32_threads.c (GC_unregister_my_thread): add false assertion
in unreachable code.
* pthread_support.c (GC_inner_start_routine): Don't release the
GC lock between GC_register_my_thread_inner() and
GC_init_thread_local() calls (post the "registered" even after
calling GC_init_thread_local()).
* win32_threads.c (GC_register_my_thread, GC_unregister_my_thread):
Use GC_lookup_thread_inner() instead of GC_lookup_thread() and
acquire the GC lock only once.
* win32_threads.c (GC_thr_init): Call GC_register_my_thread_inner()
directly instead of GC_register_my_thread() since I_HOLD_LOCK
and our (main) thread is not registered yet (add assertion for it).
* win32_threads.c (GC_init_parallel): Call GC_lookup_thread_inner()
directly instead of GC_lookup_thread() (since I_HOLD_LOCK).
* win32_threads.c (GC_lookup_thread): Remove unused function.
* win32_threads.c: Remove "#error GC_DLL untested with Cygwin".
* win32_threads.c (GC_win32_dll_threads): Define as FALSE macro
also if THREAD_LOCAL_ALLOC or GC_PTHREADS.
* win32_threads.c (GC_use_DllMain): Call ABORT also if GC_PTHREADS
(for Cygwin).
* win32_threads.c (GC_push_stack_for): Add parentheses around "&&"
(inside GC_ASSERT) to prevent compiler warning.
* win32_threads.c (GC_push_all_stacks): Remove FIXME for
PARALLEL_MARK.
* win32_threads.c (MAX_MARKERS, GC_markers): Move the definitions
to a place before GC_get_next_stack().
* win32_threads.c (marker_sp, marker_bsp): New static arrays (same
as in pthread_support.c).
* win32_threads.c (marker_last_stack_min): New static arrays (the
same semantics as for last_stack_min of GC_Thread_Rep).
* win32_threads.c (GC_get_next_stack): Handle marker threads.
* win32_threads.c (GC_mark_thread): Save the current stack pointer
to marker_[b]sp.
* win32_threads.c (start_mark_threads): Initialize
marker_last_stack_min elements (to "unset" value).
* misc.c (GC_set_oom_fn, GC_set_all_interior_pointers,
GC_set_finalize_on_demand, GC_set_java_finalization,
GC_set_finalizer_notifier, GC_set_dont_expand, GC_set_full_freq,
GC_set_no_dls, GC_set_free_space_divisor, GC_set_max_retries,
GC_set_dont_precollect, GC_set_time_limit, GC_set_warn_proc):
Change return type to void (these API functions no longer return
the old value).
* include/gc.h: Likewise.
* tests/test.c (main, WinMain, test): Remove explicit cast to void
for GC_set_warn_proc().
* misc.c (GC_get_oom_fn, GC_get_all_interior_pointers,
GC_get_finalize_on_demand, GC_get_java_finalization,
GC_get_finalizer_notifier, GC_get_dont_expand, GC_get_full_freq,
GC_get_no_dls, GC_get_free_space_divisor, GC_get_max_retries,
GC_get_dont_precollect, GC_get_time_limit, GC_get_warn_proc): New
API functions (to get the current value of the corresponding R/W
public variables).
* include/gc.h: Likewise.
* include/gc.h (GC_set_warn_proc, GC_set_free_space_divisor):
Update the comment.
* misc.c (GC_ignore_warn_proc): New API call-back function.
* include/gc.h (GC_ignore_warn_proc): Likewise.
* misc.c (GC_set_find_leak, GC_get_find_leak, GC_set_non_gc_bytes,
GC_get_non_gc_bytes): New API setter and getter functions (for the
public GC_find_leak and GC_non_gc_bytes variables, respectively).
* include/gc.h: Likewise.
* include/gc.h (GC_memalign): Add proto to GC API.
* mallocx.c (GC_memalign): Use GC_API, GC_CALL for the definition.
* tests/test.c (run_one_test): Test GC_memalign() on Win32 too,
remove GC_memalign() proto.
* misc.c (GC_write): Use multi-byte (A) variants of Win32
GetModuleFileName() and CreateFile().
* tests/test.c (main): Replace K&R-style function definition with the
ANSI C one.
* include/private/gcconfig.h (PLATFORM_ANDROID): New macro
recognized (for Linux on ARM32 without glibc).
* include/private/gcconfig.h (STRTOULL): Define for all targets
(define as "strtoul" for most targets except for LLP64/Win64).
* misc.c (GC_init_inner): Use STRTOULL instead of atoi/atol()
(cast the result to word type) to decode values of "GC_TRACE",
"GC_INITIAL_HEAP_SIZE", "GC_MAXIMUM_HEAP_SIZE" environment
variables.
* include/gc_allocator.h: Add gc_allocator_ignore_off_page.
* tests/test_cpp.cc: Add call to gc_allocator_ignore_off_page.
* win32_threads.c (GC_release_mark_lock): Correct misspelling of
AO_load in assertion.
* win32_threads.c (MAX_THREADS): Define as 1 if GC_win32_dll_threads
is defined as FALSE (otherwise the size of dll_thread_table is near
200 KiB for 32-bit).
* win32_threads.c (GC_use_DllMain): Optimize for THREAD_LOCAL_ALLOC.
* win32_threads.c (GC_Thread_Rep): Add backing_store_end and
backing_store_ptr fields for IA64 support.
* win32_threads.c (GC_register_my_thread_inner): Set
backing_store_end field to reg_base value for IA64 (same as in
pthread_support.c).
* win32_threads.c (SET_PTHREAD_MAP_CACHE): Put parentheses in the
"right" places, remove ';'.
* win32_threads.c (GC_fault_handler_lock): Declare only
if MPROTECT_VDB (and not WinCE).
* win32_threads.c (GC_suspend): Acquire and release
GC_fault_handler_lock only if MPROTECT_VDB (and not WinCE).
* win32_threads.c (GC_suspend): Define as STATIC.
* win32_threads.c (GC_push_stack_for): Fix WARN() format specifier
(should be word-compliant, "%p" is used w/o "0x"), don't cast sp.
* win32_threads.c (GC_push_all_stacks): Convert a group of printf()
calls into a single one (for output atomicity).
* win32_threads.c (GC_get_next_stack): Unprotect thread descriptor
before altering its last_stack_min ("thread" variable is added).
* win32_threads.c (GC_get_next_stack): Remove unnecessary checks for
"s" is non-NULL.
* win32_threads.c (GC_get_next_stack): Don't call GC_may_be_in_stack
if WinCE.
* win32_threads.c (GC_get_next_stack): Pass current_min value to
GC_get_stack_min as-is (without -1).
* win32_threads.c (GC_wait_marker): Remove FIXME and use "release"
version of AO_fetch_and_sub1().
* win32_threads.c (GC_win32_start_inner, GC_win32_start): convert int
to pointer (and vice versa) thru word type to suppress warnings.
* win32_threads.c (GC_mark_mutex_waitcnt): Fix comment, always
access atomically.
* misc.c: Change GC_THREADS tests back to THREADS.
* allchblk.c (GC_print_hblkfreelist, GC_dump_regions): Convert
a group of printf() calls into a single one (for output atomicity).
* include/gc.h (GC_set_all_interior_pointers, GC_set_full_freq,
GC_set_time_limit): New prototypes.
* misc.c (GC_set_all_interior_pointers, GC_set_full_freq,
GC_set_time_limit): New public setter/getter functions.
* include/gc.h: Fix (and remove outdated) comments for thread-local
allocation.
* include/gc.h: Fix typos in comments.
* misc.c (GC_init_inner, GC_printf): Likewise.
* include/gc.h (GC_unregister_disappearing_link): Refine comment.
* include/gc.h (GC_stack_base): Recognize _M_IA64 macro.
* misc.c (GC_stack_last_cleared, GC_min_sp, GC_high_water,
GC_bytes_allocd_at_reset, DEGRADE_RATE): Define only if THREADS.
* misc.c (GC_stack_last_cleared, GC_min_sp, GC_high_water,
GC_bytes_allocd_at_reset): Define as STATIC.
* misc.c (GC_get_heap_size, GC_get_free_bytes,
GC_get_bytes_since_gc, GC_get_total_bytes): Acquire the GC lock to
avoid data races.
* misc.c (GC_write_cs): Define only if THREADS (Win32/WinCE only).
* misc.c (GC_init_inner): Initialize GC_write_cs only if THREADS.
* misc.c (GC_init_inner): Use GC_INITIAL_HEAP_SIZE (if available) to
set the default initial value of initial_heap_sz.
* misc.c (GC_deinit): Destroy GC_write_cs only if THREADS.
* misc.c (GC_init_inner): Fix WARN() format specifier (should be
word-compliant, "%p" is used w/o "0x").
* misc.c (GC_init_inner): Don't recognize "GC_PAUSE_TIME_TARGET"
environment variable if SMALL_CONFIG.
* misc.c (GC_init_inner): Recognize "GC_FULL_FREQUENCY" environment
variable to set initial GC_full_freq value (if not SMALL_CONFIG).
* doc/README.environment (GC_FULL_FREQUENCY): Add information.
* doc/README.environment (GC_MARKERS): Refine information.
* misc.c (GC_init_inner): Change GC_ASSERT to GC_STATIC_ASSERT where
possible.
* misc.c (IF_NEED_TO_LOCK): New macro (instead of GC_need_to_lock).
* misc.c (GC_write): Use IF_NEED_TO_LOCK for handling GC_write_cs.
* misc.c (GC_abort): Don't define if SMALL_CONFIG.
* misc.c (GC_abort): Directly use WRITE() instead of GC_err_printf()
(to prevent possible infinite recursion).
* finalize.c (finalization_mark_proc): Replace K&R-style declaration
with ANSI C one.
* finalize.c (GC_grow_table, GC_register_finalizer_inner,
GC_enqueue_all_finalizers): Remove outdated comments about disabling
signals.
* finalize.c (GC_general_register_disappearing_link): Fix assertion
to catch NULL "obj" value.
* finalize.c (GC_unregister_disappearing_link): Check "link"
alignment before gaining the lock.
* finalize.c (GC_finalize): Refine comment.
* finalize.c (GC_finalize): Fix WARN() format specifier (should be
word-compliant, "%p" is used w/o "0x").
* finalize.c (GC_invoke_finalizers): Initialize "bytes_freed_before"
variable (to 0) to suppress compiler warning.
* include/gc_gcj.h (MARK_DESCR_OFFSET): Move to private/gc_pmark.h.
* include/gc_gcj.h: add "extern C" header and tail.
* include/private/gc_pmark.h: Remove GC_do_parallel_mark(),
GC_help_wanted, GC_helper_count, GC_active_count declarations (move
the comments to the place where these symbols are defined in mark.c).
* mark.c: Add STATIC GC_do_parallel_mark() declaration (for use by
GC_mark_some_inner, if PARALLEL_MARK only).
* mark.c (GC_mark_some_inner, GC_help_wanted, GC_helper_count,
GC_active_count, GC_do_parallel_mark): Define as STATIC.
* pthread_support.c (GC_mark_thread): Likewise.
* typd_mlc.c (GC_explicit_typing_initialized, GC_explicit_kind,
GC_array_kind, GC_ext_descriptors, GC_ed_size, GC_avail_descr,
GC_typed_mark_proc_index, GC_array_mark_proc_index, GC_eobjfreelist,
GC_arobjfreelist): Likewise.
* include/private/gc_pmark.h (PUSH_CONTENTS_HDR): Change GC_ASSERT
for HBLKSIZE to GC_STATIC_ASSERT.
* mark.c (GC_noop): Define for Borland C the same as for Watcom.
* mark.c (GC_noop, GC_mark_and_push): Add ARGSUSED tag.
* pthread_support.c (GC_do_blocking_inner): Likewise.
* mark.c (GC_mark_from): Initialize "limit" (to 0) in the default
switch branch to suppress compiler warning.
* mark.c (GC_return_mark_stack): Append new-line to printf message.
* mark.c: Remove unused GC_true_func(), GC_PUSH_ALL().
* pthread_support.c (GC_mark_thread): Add dummy "return 0" to
suppress compiler warning.
* pthread_support.c (start_mark_threads): Move the code limiting
"GC_markers" value (and printing a warning) to GC_thr_init().
* pthread_support.c (GC_thr_init): Silently limit "GC_markers" value
if based on the number of CPUs.
* pthread_support.c (GC_thr_init): Treat incorrect "GC_markers"
values as one.
* pthread_support.c (GC_register_my_thread_inner): Add a check for
"stack_end" is non-NULL (the same as in win32_threads.c).
* pthread_support.c (pthread_create): Call GC_oom_fn before giving up
with ENOMEM.
* thread_local_alloc.c (return_single_freelist): Convert "for" loop
to "while" one to suppress "possible extraneous ';'" warning.
* darwin_stop_world.c (GC_push_all_stacks): Recognize ARM32.
* include/private/gc_priv.h (GC_THREAD_STATE_T): Define for ARM32
(Darwin only).
* include/private/gcconfig.h: Add machine-specific part for DARWIN.
* include/private/gcconfig.h (ARM32): Define config parameters for
DARWIN (iPhone).
* alloc.c (GC_FULL_FREQ, GC_DONT_EXPAND, GC_FREE_SPACE_DIVISOR,
GC_TIME_LIMIT): New macros (used to control the default initial
values of GC_full_freq variable, GC_dont_expand,
GC_free_space_divisor, GC_time_limit respectively).
* include/private/gc_priv.h (TIME_LIMIT): Remove macro (replaced
with GC_TIME_LIMIT in alloc.c).
* alloc.c (GC_need_full_gc, GC_stopped_mark, GC_finish_collection):
Define as STATIC.
* mark_rts.c (GC_push_current_stack, GC_push_gc_structures): Likewise.
* include/private/gc_priv.h (GC_stopped_mark, GC_finish_collection):
Move the prototypes to alloc.c, make STATIC.
* include/private/gc_priv.h (GC_push_current_stack,
GC_push_gc_structures, GC_push_regs_and_stack): Remove prototypes
(move the comments to the places where these functions are defined).
* mach_dep.c (GC_push_regs_and_stack): Move to mark_rts.c and define
as STATIC.
* alloc.c (GC_timeout_stop_func, GC_stopped_mark,
GC_print_heap_sects): Convert a group of printf() calls into
a single one (for output atomicity).
* mark_rts.c (GC_print_static_roots): Likewise.
* alloc.c (GC_stopped_mark): Output blank line (when logging) for
convenience to delimit collections.
* alloc.c (GC_clear_a_few_frames): Rename NWORDS to CLEAR_NWORDS;
make "frames" local variable volatile (to prevent optimization).
* alloc.c (GC_try_to_collect_inner, GC_stopped_mark,
GC_finish_collection, GC_allocobj): Remove outdated comments about
disabling signals.
* include/private/gc_priv.h (GC_register_displacement_inner,
GC_gcollect_inner): Likewise.
* alloc.c (GC_try_to_collect_inner, GC_stopped_mark,
GC_finish_collection): Initialize "start_time" local variable (to 0)
to suppress compiler warning.
* mark_rts.c (GC_add_roots_inner): Likewise.
* alloc.c (GC_RATE, MAX_PRIOR_ATTEMPTS): Guard with "ifndef".
* include/private/gc_priv.h (clock, GC_stop_world, GC_start_world,
GC_acquire_mark_lock, GC_release_mark_lock, GC_notify_all_builder,
GC_wait_for_reclaim, GC_notify_all_marker, GC_wait_marker): Replace
K&R-style function prototypes with ANSI C one.
* include/private/gc_priv.h (ABORT): Define as DebugBreak() for
Win32/WinCE if SMALL_CONFIG (the same as in GC_abort()).
* include/private/gc_priv.h (ROUNDED_UP_WORDS, abs): Remove unused
macros.
* include/private/gc_priv.h (GC_noop): Declare for Borland C the
same as for Watcom.
* mark_rts.c (GC_push_conditional_with_exclusions): Add ARGSUSED tag.
* dbg_mlc.c (GC_store_debug_info, GC_store_debug_info_inner): Remove
outdated comment about disabling signals.
* mallocx.c (GC_malloc_uncollectable,
GC_malloc_atomic_uncollectable): Likewise.
* os_dep.c: Likewise.
* dbg_mlc.c (GC_debug_change_stubborn, GC_debug_end_stubborn_change):
Add ARGSUSED tag.
* pthread_stop_world.c (GC_suspend_handler,
GC_suspend_handler_inner): Likewise.
* dbg_mlc.c (GC_debug_free, GC_debug_realloc): Fix printf message.
* dbg_mlc.c (GC_debug_realloc): Set "result" to NULL in the default
switch branch to suppress compiler warning.
* dyn_load.c (GC_init_dyld): Use ABORT() instead of GC_abort().
* include/private/darwin_semaphore.h (sem_init): Likewise.
* include/javaxfc.h: Replace "GC_H" with "_GC_H".
* include/private/dbg_mlc.h (GC_has_other_debug_info,
GC_store_debug_info): Replace K&R-style function prototypes with ANSI
C one.
* include/private/gcconfig.h (GC_FreeBSDGetDataStart, real_malloc,
GC_win32_get_mem, GC_wince_get_mem, GC_unix_get_mem): Likewise.
* include/private/pthread_support.h (GC_stop_init): Likewise.
* include/private/gcconfig.h: Refine comment about setting
GC_stackbottom.
* include/private/gcconfig.h (FIXUP_POINTER): Put parentheses in the
"right" places.
* include/private/pthread_support.h (GC_Thread_Rep): Refine comment
for "stack_end" field.
* mallocx.c (GC_malloc_uncollectable,
GC_malloc_atomic_uncollectable): Remove cast to undefined "hbklk".
* os_dep.c (GC_USE_MEM_TOP_DOWN): New macro (for setting
GC_mem_top_down to MEM_TOP_DOWN for debug purposes).
* os_dep.c (GC_gww_read_dirty, catch_exception_raise): Fix WARN()
format specifier (should be word-compliant, "%p" is used w/o "0x").
* pthread_stop_world.c (GC_suspend_handler_inner): Likewise.
* os_dep.c (GC_dirty_init): Append new-line to printf messages.
* os_dep.c (GC_mprotect_thread): Fix GC_err_printf message.
* os_dep.c (GC_save_callers): Change GC_ASSERT to GC_STATIC_ASSERT.
* pthread_stop_world.c (GC_retry_signals, GC_suspend_ack_sem): Define
as STATIC.
* pthread_stop_world.c (GC_push_all_stacks): Add assertion for that
"thread_blocked" is not set for the current thread.
* real_malloc.c: Add "extern GC_quiet" to suppress compiler warning.
* reclaim.c (GC_reclaim_all): Initialize "start_time" (to 0) to
suppress compiler warning.
* tests/test.c (check_heap_stats): Avoid unbalanced brackets in ifdef.
* win32_threads.c: restructure parallel marking mutex initialization.
* win32_threads.c, alloc.c, darwin_stop_world.c, mallocx.c, mark.c,
pthread_stop_world.c, pthread_support.c: Add runtime conditions
on GC_parallel were appropriate.
* pthread_support.c: Condition marker_bsp on ia64.
(GC_segment_is_thread_stack): Fix loop upper bound.
* reclaim.c: Limit some assertions to PARALLEL_MARK.
* pthread_support.c: Don't acquire mark lock for thread-local
allocation.
* include/private/gc_priv.h: Don't define parallel mark sync
support just for THREAD_LOCAL_ALLOC.
* include/private/gcconfig.h: refine MINGW32 test.
* mark.c: Add win64/gcc tests.
* test.c (fork_a_thread, reverse_test, alloc8bytes, tree_test,
typed_test, run_one_test, check_heap_stats, main, test): Replace
all K&R-style function definitions with ANSI C ones.
* trace_test.c (main): Likewise.
* test.c (GC_COND_INIT): Define as GC_INIT() also in case of
THREAD_LOCAL_ALLOC.
* test.c (reverse_test): Call fork_a_thread() only if GC_PTHREADS
or GC_WIN32_THREADS; remove fork_a_thread() macros definition.
* test.c (reverse_test): Use "volatile" when clearing "b" and "c"
local variables (to suppress "assigned value is never used"
compiler warning).
* test.c (tree_test): Use public GC_noop1() instead of private
GC_noop().
* test.c (typed_test): Likewise.
* test.c (check_heap_stats): Define and assign value to
"late_finalize_count" local variable only if its value is used
(if FINALIZE_ON_DEMAND defined).
* test.c (main): Remove DJGPP-specific initialization of
GC_stackbottom (not needed anymore, handled in gcconfig.h).
* trace_test.c: Guard #define GC_DEBUG with #ifndef.
* trace_test.c: Include "gc_backptr.h".
* trace_test.c (main): Call GC_INIT().
* trace_test.c (main): Add "return 0" statement.
* dyn_load.c (GC_register_dynlib_callback): Use new index j
instead of i in the inner loop.
* tests/test.c: Increment n_tests with fetch_and_add when possible,
avoiding need to export lock.
* include/gc_pthread_redirects.h:
- dlfcn.h is included for dlopen() proto before undefining
"dlopen" (so, it's possible now to include dlfcn.h after
gc.h from user code);
- GC_dlopen() proto is added (except for Darwin as
it's missing there);
- "dlopen" is explicitly undefined (before its redefinition).
* include/gc.h:
- "process.h" is included besides "windows.h"
(for _beginthreadex/_endthreadex); win32 only.
- GC_NO_THREAD_DECLS is moved to the right place
(before closing "extern C").
* pthread_support.c: Fix out of memory handling for Thread_Reps.
* win32_threads.c: Don't include process.h on winCE,
improve out of memory handling for thread structures, don't
define GC_beginthreadex and GC_endthreadex for winCE.
* tests/test.c: Change gcj vtable decriptor type from size_t to
GC_word.
* gcj_mlc.c: Add comment.
* tests/test.c: Change NTEST to NTHREADS. Fork 5 threads by default.
Run reverse_test a second time in each thread.Add comments.
Don't rely on AO_fetch_and_add.
* dyn_load.c (GC_register_dynlib_callback,
GC_register_dynamic_libraries_dl_iterate_phdr): Add support
for GNU_PT_RELRO relocations.
* Makefile, Makefile.direct: GC_SOLARIS_PTHREADS was replaced
by GC_SOLARIS_THREADS.
* include/gc.h: Improve finalizer documentation.
* mips_sgi_mach_dep.s: Replace _MIPS_SIM_ABI32 with _ABIO32.
* pthread_stop_world.c, Makefile.dj: Fix typos.
* win32_threads.c (GC_new_thread): Make first_thread
visible to the whole file.
(UNPROTECT): New macro.
(GC_push_stack_for, GC_suspend, GC_start_world): unprotect
thread structures before writing.
(GC_suspend): Acquire GC_fault_handler_lock before suspending
thread.
* os_dep.c: export GC_fault_handler_lock.
(GC_remove_protection): Check if already unprotected.
* doc/README.win32: Add OpenWatcom warning.
* include/private/gcconfig.h: Really check it in.
* os_dep.c (GC_get_stack_base, windows): Replace with Dave Korn's
code from gcc version.
* os_dep.c: make gc compilable (optionally) for Cygwin with
GetWriteWatch-based virtual dirty bit implementation ("os_dep.c" file).
* os_dep.c: Make non-win32 GC_write_fault_handler STATIC.
* mark.c (GC_noop): fix declaration definition mismatch for DMC.
* include/private/gcconfig.h: Enable MPROTECT_VDB and GWW_VDB for
Watcom (Win32 only). It works.
* mach_dep.c: Don't use __builtin_unwind_init for register
state on PowerPC/Darwin.
* doc/gcdescr.html: Improve description of object freelist
structure.
* include/private/gc_priv.h: Fix comment for _size_map.
* os_dep.c (GC_linux_stack_base): Relax sanity test.
* include/private/gc_pmark.h (PUSH_CONTENTS_HDR for
MARK_BIT_PER_OBJ): Add missing backslash before eoln.
* misc.c (GC_set_warn_proc): Implicitly intialize GC on
non-Cygwin win32.
* configure.ac: Enable thread-local allocation for sparc-linux.
* alloc.c (GC_try_to_collect): Remove duplicate initialization
check.
* malloc.c (GC_generic_malloc): Remove lw to eliminate single-
threaded warnings.
* mallocx.c (GC_generic_malloc_ignore_off_page): Likewise.
* allchblk.c, backgraph.c, dbg_mlc.c, dyn_load.c,
finalize.c, include/private/gc_pmark.h, malloc.c, mark.c,
os_dep.c, pthread_stop_world.c, pthread_support.c, reclaim.c,
thread_local_alloc.c.
* misc.c: Refine comment.
* os_dep.c: Define GC_GWW_BUF_LEN more intelligently. Add FIXME
comment.
* win32_threads.c (GC_push_stack_for): Yet another attempt
at the stack_min finding logic. Try to clean up the existing code
while minimizing VirtualQuery calls.
(GC_win32_start_inner): Register thread before GC_printf.
Produce more output with DEBUG_THREADS.
*include/gc.h: Update obsolete comments.
* tests/test.c:
(gcj_class_struct2): Use cast instead of l suffix.
Cast GetLastError to int in various places.
Avoid unused result warning from incr/decr macros.
Add cast for fake_gcj_mark_proc.
Cast GC_gc_no to unsigned in printf.
* include/gc.h: Fix two typos in comments.
* finalize.c: Fix typo in comment.
* blacklst.c (GC_print_source_pointer): Don't call GC_print_heap_obj
with lock.
* reclaim.c: (GC_reclaim_block): Scan even nearly full blocks
if we are checking for leaks.
* win32_threads.c: Remove mark lock spinning.
* win32_threads.c, pthread_support.c: Update GC_unlocked_count,
GC_spin_count, and GC_block_count using atomic operations.
* tests/test.c: Declare n_tests as AO_t only if we have threads.
* win32_threads.c: Support PARALLEL_MARK. Make printf arg
types agree with format specifiers.
Add STATIC for GC_threads.
* include/private/gcconfig.h: Add FIXME comment.
* tests/test.c (run_ine_test): Replace LOCK/UNLOCK use with
AO_fetch_and_add1_full. Declare n_tests as AO_t.
(WinMain): Don't call GC_use_DllMain.
with PARALLEL_MARK or THREAD_LOCAL_ALLOC.
* alloc.c (GC_try_to_collect_inner): Don't print redundant
GC_bytes_allocd and GC_gc_no.
(GC_stopped_mark): Print average world stop time.
* include/private/gc_priv.h (MS_TIME_DIFF): Add cast.
* misc.c, doc/README.environment: Add support for
GC_FREE_SPACE_DIVISOR and GC-disable-incremental.
* include/gc.h: Make GC_set_free_space_divisor correspond to
(somewhat unfortunate) reality.
(Mostly improves LLP64 support.)
* backgraph.c, checksums.c, dbg_mlc.c, finalize.c, mark.c,
misc.c, reclaim.c: Changed some int and long type to word or size_t
(and vice versa where appropriate)
* gcj_mlc.c, include/private/dbg_mlc.h, include/private/gcconfig.h,
include/private/thread_local_alloc.h, mark.c,
misc.c, thread_local_alloc.c, win32_threads.c: Added intermediate
casts to word type when casting from int to pointer (or pointer
to int, or data pointer to code pointer) - just to remove the
corresponding compiler warning.
* ptr_chck.c (GC_is_visible): cast int const to word type to
prevent left shift overflow.
* os_dep.c: change the type of GC_mem_top_down global variable
(containing a flag) to DWORD.
* include/gc_config_macros.h: define GC_SOLARIS_THREADS if GC_THREADS
is defined on SunOS x86_64.
* misc.c (GC_init_size_map): Ifdef out GC_ASSERT as a workaround
for VC++ 2008 amd64 (v15.00.21022.08 for x64) compiler bug
(the compiler gets hung if invoked with -Ox -D
ALL_INTERIOR_POINTERS -D GC_ASSERTIONS)
* backgraph.c: cast GC_gc_no value to unsigned short when
assigned/compared to height_gc_no field of back_edges.
* os_dep.c (GC_remove_protection): Add ARGSUSED.
* win32_threads.c (GC_thread_exit_proc): Remove unused local
variable.
* mark.c (GC_check_dirty): Move declaration out of func body.
* doc/gcinterface.html: Improve REDIRECT_MALLOC documentation.
* include/gc.h (GC_register_my_thread): Improve comment.
* Makefile.direct: Add comment for -DCHECKSUMS.
* thread_local_alloc.c, include/private/thread_local_alloc.h:
Fix typos in comments.
* finalize.c: Declare mark_procs and GC_register_finalizer_inner
STATIC.
* malloc.c (GC_free): Move size calculation below assertion.
* win32_threads.c (GC_get_stack_min, GC_may_be_in_stack):
Add one entry VirtualQuery cache, I_HOLD_LOCK assertions.
(GC_push_stack_for, GC_get_next_stack) : Hopefully fix WINCE support.
* finalize.c (GC_general_register_disappearing_link): Add
assertion.
* malloc.c (GC_generic_malloc): Round lb to granules, not words.
* mallocx.c (GC_generic_malloc_ignore_off_page): Round lb to
granules, not words.
* mach_dep.c (NO_GETCONTEXT): Define for sparc linux.
* configure.ac: Define mach_dep for sparc-linux.
* mark_rts.c (GC_approx_sp): Use volatile to avoid common
warning.
* dyn_load.c (GC_cond_add_roots): Fix GC_get_next_stack argument
order.
* alloc.c, dbg_mlc.c, dyn_load.c, finalize.c, gcj_mlc.c,
include/gc.h, include/gc_config_macros.h, include/gc_cpp.h,
include/gc_gcj.h, include/gc_mark.h, include/gc_typed.h,
include/javaxfc.h, include/private/gc_locks.h,
include/private/gc_priv.h, malloc.c, mallocx.c, mark.c, mark_rts.c,
misc.c, obj_map.c, os_dep.c, pthread_support.c, ptr_chck.c,
stubborn.c, tests/test.c, thread_local_alloc.c, typd_mlc.c
win32_threads.c: Add GC_CALL and GC_CALLBACK macro invocations.
* test.c: Remove some old K&R code.
* win32_threads.c (GC_may_be_in_stack): New. (GC_Thread_Rep):
Add last_stack_min. (GC_push_stack_for): Use last_stack_min.
(GC_get_next_stack): Add limit argument, use_last_stack_min.
(GC_suspend): make stack_base assignment conditional.
* dyn_load.c (win32 GC_cod_add_roots): Pass limit to
GC_get_next_stack.
* configure_atomic_ops.sh: Remove.
* build_atomic_ops.sh, build_atomic_ops.sh.cygwin, doc/README.win32,
Makefile.direct: Partially support build directories whose path
name contains blanks.
* Makefile.am: Support new files (build_atomic_ops.sh,
build_atomic_ops.sh.cygwin)
* include/private/gc_locks.h, include/private/gc_pmark.h,
include/private/gc_priv.h, include/private/gcconfig.h,
mach_dep.c, mark_rts.c, misc.c, os_dep.c, pthread_stop_world.c,
pthread_support.c, thread_local_alloc.c, typd_mlc.c, win32_threads.c:
Fix comments.
* pthread_support.c: Comment out LOCK_STATS.
* include/gc.h: Fix comments.
* misc.c (GC_init_inner): Enable GC_LOG_FILE on Cygwin.
* include/private/gcconfig.h: Consider USE_MMAP for Cygwin.
* os_dep.c (GC_get_main_stack_base): Use alternate definition
with USE_MMAP.
* include/private/gc_priv.h: Sometimes define SETJMP on Cygwin.
* doc/README: Make it clearer when Makefile.direct is assumed.
* cord/cord.am: install include/cord.h.
* win32_threads.c (GC_pthread_join, GC_pthread_start_inner):
Remove unused variables.
* darwin_stop_world.c: Always declare GC_thr_init().
* dbg_mlc.c (GC_debug_free_inner): Don't touch oh_sz if
SHORT_DBG_HDRS is defined.
* include/private/gc_pmark.h (OR_WORD_EXIT_IF_SET, parallel
mark, USE_MARK_BITS version): Refer to correct parameter name.
* finalize.c (GC_general_register_disappearing_link): Remove
redundant code.
* gcj_mlc.c (GC_init_gcj_malloc): Add cast to signed.
* os_dep.c: (GC_write_fault_handler): Remove remaining
references to deleted variable "code". Remove redundant
FREEBSD definitions.
* include/private/gcconfig.h (GWW_VDB): Define for X86_64 when
defined for X86. (STATIC): Define as "static" with NO_DEBUGGING.
* include/private/gc_priv.h: Update MAX_HEAP_SECTS.
* dbg_mlc.c (GC_print_smashed_obj): Increase robustness with
smashed string, (GC_debug_free_inner): Mark as free.
* mallocx.c (GC_malloc_many): Always clear new block if
GC_debugging_started.
* reclaim.c: Move GC_debugging_started from
GC_reclaim_small_nonempty_block() to GC_reclaim_generic(),
which is also called directly.
* doc/README: Fix spelling error. Update license summary.
* include/gc.h (GC_PRE_INCR3, GC_POST_INCR3): add (void **) casts.
* tests/test.c: Don't define GC_DEBUG if already defined.
* doc/simple_example.html: update --enable-full-debug reference,
Make HTML formatting standards compliant.
* doc/debugging.html, doc/leak.html: Fix HTML formatting bugs.
* doc/gcinterface.html: specify encoding.
* doc/simple_example.html: Update thread-local allocation
description.
* configure.ac: Check for gc-debug earlier; replace remaining
full-debug tests.
* include/gc.h, ptr_chck.c (GC_pre_incr, GC_post_incr):
Use signed offset type. Use ptr_t internally.
* doc/gcinterface.html: Update LOCAL_MALLOC description.
* doc/README.autoconf, doc/leak.html, doc/README.DGUX386:
Fix full-debug reference.
* include/gc.h: Rewrite GC_..._INCR and friends.
* tests/test.c: Minimally test GC_..._INCR and friends.
* mark.c: (GC_push_next_marked, GC_push_next_marked_dirty,
GC_push_next_marked_uncollectable): Never invoke GC_push_marked
on free hblk.
* headers.c: Test COUNT_HDR_CACHE_HITS not USE_HDR_CACHE.
(GC_header_cache_miss): Always blacklist pointers for free
hblks. Add assertion and comment.
* pthread_support.c (GC_register_my_thread): Fix #if indentation.
* include/private/gc_hdrs.h: USE_HDR_CACHE is no longer tested.
Delete it.
* include/private/gc_pmark.h: (PUSH_OBJ): Add assertion.
* alloc.c, include/gc_mark.h, Makefile.direct: Improve comments.
* configure.ac: Set win32_threads on MinGW.
Ivan's description of the patch follows. Note that a few pieces like
the GC_malloc(0) patch, were not applied since an alternate had been
previously applied. A few differed stylistically from the rest of
the code (mostly casts to void * instead of target type),
or were classified as too minor to bother. Note that
all of Ivan's static declarations which did not correct outright
naming bugs (as a few did), where replaced by STATIC, which is
ignored by default.
- minor bug fixing (for FreeBSD, for THREAD_LOCAL_ALLOC and for
GC_malloc(0));
- addition of missing getter/setter functions for public variables
(may be useful if compiled as Win32 DLL);
- addition of missing GC_API for some exported functions;
- addition of missing "static" declarator for internal functions
and variables (where possible);
- replacement of all remaining K&R-style definitions with ANSI
C ones (__STDC__ macro is not used anymore);
- addition of some Win32 macro definitions (that may be missing in
the standard headers supplied with a compiler) for GWW_VDB mode;
- elimination of most compiler warnings (except for
"uninitialized data" warning);
- several typos correction;
- missing parenthesis addition in macros in some header files of
"libatomic_ops" module.
My highlights based on reading the patch:
* allchblk.c: Remove GC_freehblk_ptr decl.
Make free_list_index_of() static.
* include/gc.h: Use __int64 on win64, define GC_oom_func,
GC_finalizer_notifier_proc, GC_finalizer_notifier_proc,
add getter and setters: GC_get_gc_no, GC_get_parallel,
GC_set_oom_fn, GC_set_finalize_on_demand,
GC_set_java_finalization, GC_set_dont_expand,
GC_set_no_dls, GC_set_max_retries, GC_set_dont_precollect,
GC_set_finalizer_notifier. Always define GC_win32_free_heap.
gc_config_macros.h: Define _REENTRANT after processing
GC_THREADS.
* include/gc_cpp.h: Improve GC_PLACEMENT_DELETE test,
handling of operator new[] for old Windows compilers.
* include/gc_inline.h (GC_MALLOC_FAST_GRANS): Add parentheses
around arguments.
* dbg_mlc.c, malloc.c, misc.c: Add many GC_API specs.
* mark.c (GC_mark_and_push_stack): Fix source argument for
blacklist printing.
* misc.c: Fix log file naming based on environment variable
for Windows. Make GC_set_warn_proc and GC_set_free_space_divisor
just return current value with 0 argument. Add DONT_USE_USER32_DLL.
Add various getters and setters as in gc.h.
* os_dep.c: Remove no longer used GC_disable/enable_signals
implementations. (GC_get_stack_base): Add pthread_attr_destroy
call. No longer set GC_old_bus_handler in DARWIN workaround.
* pthread_support.c: GC_register_my_thread must also
call GC_init_thread_local.
* Makefile.direct, mach_dep.c: Add support for NO_GETCONTEXT.
* mach_dep.c: Include signal.h.
* gc_priv.h: Factor out INLINE declaration.
* include/private/gcconfig.h: Update MIPS/LINUX config.
* doc/gcdescr.html: Fix typo.
* mach_dep.c (GC_with_callee_saves_pushed): Don't rely on getcontext
for MIPS/LINUX.
* configure.ac: SPARC fixes.
* thread_local_alloc.c(GC_mark_thread_local_fls_for): Include
size 0, except for gcj.
* doc/gc.man: Expand C++ cautions.
* include/gc_inline.h: Fix comments.
== [7.1] 2008-05-03 ==
* doc/gcinterface.html: Improve C++ interface documentation.
* allchblk.c (GC_allochblk): Check for overflow during size
rounding.
* tests/huge_test.c: New.
* Makefile.direct, tests/tests.am: Add huge_test.c
* pthread_support.c: Fix typo in comment.
* os_dep.c (GC_win32_get_mem): Add heap section only if
allocation succeeded.
* malloc.c: (free replacement) Fix caller address space check.
* finalize.c (GC_grow_table): Dereference table in null-check.
* win32_threads.c (GC_delete_gc_thread, GC_delete_thread):
Consistently call CloseHandle. (GC_suspend): Call
GC_delete_gc_thread.
* tests/test.c: Don't reference GC_print_stats if not exported.
* tests/test.c (run_one_test): Don't mention pthread_self().
* misc.c: Declare GC_thr_init().
* allchblk.c (add_to_fl): disable assertions with USE_MUNMAP,
and refine assertions to handle huge unmergable blocks.
(GC_allochblk_nth): Add comment.
* include/private/gcconfig.h: Add missing FREEBSD macro
consistency test.
* allchblk.c (GC_enough_large_bytes_left): No longer take
parameters; return free list index bound.
(GC_merge_unmapped): Don't access nexthdr until after null test.
(Fixes bug in 1/29/08 check-in.) (GC_allochblk): Calculate
when splitting is allowable only once here, not when considering each
block. (GC_allchblk_nth): Accept new may_split parameter.
Avoid some redundant tests for exact size matches.
* alloc.c (GC_should_collect): Cache min_bytes_allocd.
(GC_maybe_gc): Make locking assertion testable.
* mark_rts.c: Fix indentation.
* pthread_stop_world.c: Replace old GC_err_printf1 reference.
* tests/test.c: Remove (void) casts. Optionally print some
timing information.
* windows-untested/gc.def: Remove CreateThread line.
* windows-untested/README: New file.
* win32_threads.c (GC_use_DllMain): Force collector initialization.
* include/gc.h (GC_use_DllMain): Clarify usage rules in comment.
* mark.c (GC_mark_from): Slightly simplify GC_DS_PER_OBJECT code.
* include/gc_cpp.h: Add matching placement delete overloads
everywhere.
* include/private/gc_locks.h (NO_THREAD): Add cast.
* include/private/gcconfig.h: Add test for __HP_aCC.
* configure.ac, tests/tests.am: Avoid libgccpp on HP/UX.
* doc/README.win32: Fix typo.
* configure.ac: Fix printing of enable-shared result.
* misc.c (GC_init_inner): Assert !GC_need_to_lock only when
defined. (GC_call_with_stack_base): Add GC_API.
* os_dep.c (GC_get_stack_base): Add GC_API.
* win32_threads.c: (GC_register_my_thread, GC_unregister_my_thread):
Add GC_API.
* include/gc.h: Add GC_API annotations.
* include/private/gc_locks.h: Define UNCOND_LOCK etc. also for
PCR.
* include/private/gc_pmark.h: Fix comments.
* include/private/gc_priv.h, mark_rts.c, typd_mlc.c:
Add GC_push_typed_structures() to push GC_ext_descriptors.
* tests/test.c: Call GC_INIT for DARWIN; test system type using
gcconfig.h-defined macros.
* allchblk.c (GC_merge_unmapped, GC_freehblk): Refuse to create
blocks large enough that their size, when interpreted as a signed
value, would be negative.
* include/private/gc_priv.h: Comment hb_sz range limit.
* mark.c (GC_push_next_marked): correct comment.
* Makefile.direct: document NO_PROC_STAT.
* include/private/gcconfig.h: Accomodate NO_PROC_STAT.
== [7.1alpha2] 2008-01-10 ==
* Makefile.am: Mention atomic_ops.c and atomic_ops_sysdeps.S
again. Refer to build directory as ".".
* configure.ac: Ignore --enable-parallel-mark on Darwin for now.
* darwin_stop_world.c: Add FIXME comment for parallel marker.
* include/private/gc_priv.h: Update MAX_ROOT_SETS
and LOG_PHT_ENTRIES to handle larger heaps.
* include/gc.h (GC_INIT,GC_init): Update comments.
* allchblk.c, alloc.c, include/private/gc_priv.h:
Track GC_bytes_dropped and use in GC triggering decisions.
* alloc.c (min_bytes_allocd): Weight atomic blocks less.
* alloc.c (GC_add_to_heap): Call GC_install_header(p) AFTER
adjusting p.
* Makefile.am: Add NT_X64_THREADS_MAKEFILE.
* NT_X64_STATIC_THREADS_MAKEFILE: Clean up obsolete comment.
* alloc.c: Add declaration for GC_add_current_malloc_heap.
* win32_threads.c (GC_beginthreadex): Clean up error
return code.
* doc/README.win64, NT_X64_THREADS_MAKEFILE, Makefile.direct:
Add NT_X64_THREADS_MAKEFILE.
* alloc.c: Define GC_version instead of in version.h.
* version.h: Remove.
* include/gc_version.h: Move most of version.h here.
* include/gc.h: Include gc_version.h.
* gcname.c, add_gc_prefix.c: include gc.h instead of version.h.
* Makefile.direct, Makefile.dj, Makefile.am, include/include.am:
Adjust for version.h rename.
* configure.ac: Put libatomic_ops links in build directory.
* Makefile.am: Don't mention atomic_ops.c and atomic_ops_sysdeps.S
as nodist sources.
* include/gc.h, doc/README.macros: Add GC_NO_THREAD_REDIRECTS,
GC_NO_THREAD_DECLS, don't test explicitly for GC_SOLARIS_THREADS.
* alloc.c: Deal correctly with address wrapping for
GC_greatest_plausible_heap_addr and GC_least_plausible_heap_addr.
* finalize.c, include/gc.h (GC_register_disappearing_link,
GC_register_finalizer_inner): Improve out-of-memory handling.
* include/private/gc_pmark.h: Fix comment spelling.
* include/gc_inline.h, include/gc_tiny_fl.h: cleanups to make usable
in other contexts.
* include/gc.h: Don't define GC_HAVE_BUILTIN_BACKTRACE for uclibc.
* gc_cpp.cc: Don't include gc_cpp.h from local directory.
* allchblk.c, configure.ac (add --enable-munmap)
* dyn_load.c (GC_dyld_image_add): Remove ifdef clause and use the macro
GC_GETSECTBYNAME instead.
* include/private/gc_priv.h: Define GC_GETSECTBYNAME according to the
architecture (Darwin).
* reclaim.c (GC_bytes_found): Expand comment.
* thread_local_alloc.c (GC_malloc_atomic, GC_gcj_malloc): Pass
granules, not bytes, to GC_FAST_MALLOC_GRANS.
* include/gc.h: Never include gc_local_alloc.h.
* tests/test.c: Add size zero allocation tests.
* malloc.c: Update GC_large_allocd_bytes on explicit deallocation.
* allchblk.c: Sanity check GC_max_large_allocd_bytes.
* Makefile.direct: Invoke $(MAKE) instead of make.
* doc/scale.html: Reflect gc7 thread local allocation behavior.
* include/extra/gc.h, include/extra/gc_cpp.h: New.
* include/include.am: Install gc.h and gc_cpp.h in $(prefix)/include
again.
* pthread_support.c (GC_thr_init): Use sysconf(_SC_NPROCESSORS_ONLN)
for HURD.
* include/private/gcconfig.h: Add Linux/mips-64 support.
* dbg_mlc.c: Use random() on all glibc systems.
* mach_dep.c (GC_with_callee_saves_pushed): Don't use getcontext() on
HURD. Add comment.
* pthread_stop_world.c (GC_suspend_handler, GC_stop_init): Accomodate
systems without SA_SIGINFO.
* include/gc.h (GC_PTR_STORE): Fix non-DEBUG parentheses.
* tests/test.c (run_one_test): Add GC_PTR_STORE test.
No longer test for RS6000.
* alloc.c, backgraph.c, headers.c, include/private/gc_priv.h:
Maintain GC_our_memory and GC_n_memory.
* dbg_mlc.c (GC_print_smashed_obj): Improve message.
(GC_print_all_smashed_proc): Pass client object address instead of
base.
* dyn_load.c (sort_heap_sects): New. (GC_register_map_entries):
Register sections that are contiguous and merged with our heap.
* malloc.c, os_dep.c (GC_text_mapping): Check for just base name
of libraries.
* malloc.c (calloc): Check for special callers even with
USE_PROC_FOR_LIBRARIES. Move assertion. Add rudimentary
malloc/free tracing.
* misc.c: No longer call GC_init_lib_bounds explicitly.
* thread_local_alloc.c (GC_malloc, GC_malloc_atomic): Always
initialize on demand.
* tests/test.c: Call GC_INIT only when required.
* Makefile.direct: Remove comment fragment.
* tests/tests.am: Add smashtest.
* configure.ac: Define GC_USE_DLOPEN_WRAP with redirect-malloc.
* pthread_support.c: Fix comment spelling.
* include/private/gcconfig.h: Define USE_PROC_FOR_LIBRARIES with
GC_LINUX_THREADS and REDIRECT_MALLOC.
* tests/smash_test.c: Initial check-in.
* obj_map.c: Print log entry to correct file.
* include/private/thread_local_alloc.h: Add TlsAlloc error check.
* alloc.c (GC_stopped_mark): Call GC_add_current_malloc_heap()
while world is still running.
* os_dep.c (GC_is_heap_base): Don't call GC_add_current_malloc_heap()
with world stopped.
* include/gc.h (GC_INIT for cygwin): Always call GC_add_roots.
* misc.c (GC_init/GC_init_inner): Perform all work in
GC_init_inner.
* Makefile.direct: Expand -DUSE_MUNMAP comment.
* include/gc.h: Define uintptr_t explicitly for VC++6.
* msvc_dbg.c (GetModuleBase): Revert to strcat if strcat_s doesn't
exist.
== [7.0] 2007-07-02 ==
* include/gc_config_macros.h: Also check for IA64 when setting
GC_HPUX_THREADS.
* mallocx.c: Change my_bytes_allocd to signed_word.
* include/gc_pthread_redirects.h: Remove obsolete Solaris threads
(as opposed to pthreads) support.
* mach_dep.c (GC_with_callee_saves_pushed): Don't use getcontext()
on ARM/Linux. Check getcontext() return value.
* backgraph.c (per_object_func): Make argument types consistent.
(GC_traverse_back_graph): Mark GC_deepest_obj.
* finalize.c (GC_finalize): Change dl_size and fo_size to size_t.
* os_dep.c (GC_win32_get_mem): Add GC_mem_top_down option.
* doc/README.win32, doc/README, README.QUICK: Fix some of the worst
anachronisms.
* dyn_load.c: Partially support cygwin, but don't enable it yet.
* Makefile.am: Use -no-undefined for libgc.
* Makefile.direct: Document USE_PROC_FOR_LIBRARIES.
* dyn_load.c (GC_register_map_entries): Rename prot_buf to prot
consistently.
* misc.c: Fix some WARN calls. Move GC_is_initialized setting and
GC_thr_init() call.
* os_dep.c: Consistently use WARN where appropriate.
* thread_local_alloc.c: Revert change to GC_WIN32_THREADS test. Instead
remove inappropriate pthread.h include.
* doc/README.linux: Remove some anachronisms.
* alloc.c: Also use GC_check_tls on non-Linux systems.
* mallocx.c (GC_reclaim_generic): Remove bogus declaration.
* include/private/gc_priv.h (GC_reclaim_generic): Declare correctly
with prototype.
* alloc.c (GC_adj_bytes_allocd): Avoid (long) casts, fix comment.
(GC_print_heap_sects): Use size_t instead of unsigned long.
* thread_local_alloc.c (GC_lookup_thread): Define in the correct
context.
* win32_threads.c, include/gc_config_macros.h: The last of Romano
Paolo Tenca's patch. Move stdint.h include to gc_config_macros.h.
* include/gc_inline.h: Avoid gc_priv.h dependencies.
* tests/test.c (check_heap_stats): Replace unsigned long with size_t.
* NT_X64_STATIC_THREADS_MAKEFILE: Replace obsolete -debugtype:cv.
* mark_rts.c (GC_push_roots): Fix kind type.
* doc/README.win64: New file.
* doc/doc.am, Makefile.direct: Add README.win64.
* Makefile.am, Makefile.direct: Add NT_X64_STATIC_THREADS_MAKEFILE.
* NT_X64_STATIC_THREADS_MAKEFILE: Fix warning flags.
* allochblk.c, alloc.c, blacklst.c, dbg_mlc.c, dyn_load.c,
finalize.c, headers.c, mach_dep.c, malloc.c, mark.c, misc.c,
obj_map.c, os_dep.c, ptr_chck.c, reclaim.c, typd_mlc.c,
win32_threads.c, cord/de_win.c, include/gc_mark.h,
include/private/gc_hdrs.h, include/private/gc_pmark.h,
include/private/gc_priv.h, tests/test_cpp.cc:
Replace old style function declarations. Clean up integral types.
Remove register declarations. The change in malloc.c and the
"int descr" declaration in mark.c are the most likely to have
been real bugs outside of win64.
* msvc_dbg.c: Disable on win64.
* win32_threads.c: Add AMD64 support.
* include/gc.h: no backtrace on AMD64 for now.
* msvc_dbg.c(GetModuleBase): Replace strcat with strcat_s.
* include/gc.h: (GC_word, GC_signed_word): Fix win64 definitions.
Don't include windows.h in an extern "C" context.
* include/private/gcconfig.h: Fix win64/X86_64 configuration.
* tests/test.c: Eliminate more old style function definitions.
Cleanup pointer and integer casts for win64.
* tests/test_cpp.cc: Don't include gc_priv.h.
* NT_STATIC_THREADS_MAKEFILE: Restrict suffixes for VC++ 2005.
* NT_X64_STATIC_THREADS_MAKEFILE: New.
* win32_threads.c: Separate out DEBUG_WIN32_PTHREADS_STACK. Ignore
FINISHED threads for suspension. (GC_pthread_join): Add
pthread_self() cast. (GC_pthread_start_inner): Execute cleanup
handler when popping it.
* include/private/gc_locks.h: Inline THREAD_EQUAL for
GC_WIN32_PTHREADS. Define USE_PTHREAD_LOCKS only if we have
pthreads.
* gc_dlopen.c, thread_local_alloc.c, threadlibs.c, win32_threads.c,
tests/test.c: Accomodate GC_WIN32_PTHREADS.
* include/gc.h: Don't include windows.h for GC_WIN32_PTHREADS.
* include/gc_config_macros.h: Define both PTHREADS and
GC_WIN32_THREADS.
* include/private/gc_locks.h: Nonstandard definitions of
NUMERIC_THREAD_ID for GC_WIN32_PTHREADS.
* doc/README.win32, Makefile.direct: Include documentation
for GC_WIN32_PTHREADS.
* Makefile.direct: Remove some anachronisms in the documentation.
* Makefile.am: Move includes to bottom. Add better library
dependencies. Increment library version. Remove "SUBDIRS += .".
* cord/cord.am, tests/tests.am: Add better library dependencies.
Remove now unnecessary dependencies.
* include/gc.h (GC_beginthreadex, GC_endthreadex, GC_ExitThread):
Move to define on all Windows platforms. (_beginthread): define
to generate error if used.
* include/private/gc_locks.h: Format to 80 columns.
* malloc.c(GC_free): Ignore bad frees on MSWIN32 with REDIRECT_MALLOC.
* NT_MAKEFILE: msvc_dbg.h is in include/private. Don't use cvars
rc.
* misc.c (WIN32 GC_write): Define GC_need_to_lock in single-threaded
case.
* win32_threads.c: Test for __MINGW32__ in addition to _MINGW_VER.
(GC_CreateThread, GC_beginthreadex): Deallocate args even if we fail.
* include/gc.h: Add GC_reachable_here(). (GC_WinMain): Add GC_API.
(GC_beginthreadex, GC_endthreadex, GC_ExitThread): Declare.
* tests/test.c: Add GC_reachable_here() call.
* alloc.c (GC_try_to_collect): Call GC_init if necessary.
* tests/thread_leak_test.c: Don't unconditionally define
GC_LINUX_THREADS.
* Makefile.am: Remove extra_ldflags_libgc definition.
* include/private/gc_priv.h: Define AO_REQUIRE_CAS.
* finalize.c (GC_unreachable_finalize_mark_proc): Don't return void
value.
== [7.0alpha9] 2007-05-15 ==
* Some gc6.9 changes.
* Change FindTopOfStack decl in darwin_stop_world.c.
* Move some static tests from misc.c to gcconfig.h. Use #error.
* Add GC_print_free_list() function.
* Add GC_GNU_THREADS support on HURD.
* __GNUC__ was misspelled as __GNUC in thread_local_alloc.h.
* Integrated various MacOSX patches and tried to reconcile them.
* Added some casts to powerpc.h in libatomic_ops to silence warnings.
* Makefile.am: Include NT_STSTIC_THREADS_MAKEFILE in dist.
* include/private/gc_locks.h: GC_compare_and_exchange, GC_atomic_add:
remove. NUMERIC_THREAD_ID, THREAD_EQUAL: New. GC_lock_holder: now
unsigned long. I_DONT_HOLD_LOCK, I_HOLD_LOCK: Update.
* pthread_stop_world.c, pthread_support.c, win32_threads.c: Use
NUMERIC_THREAD_ID, THREAD_EQUAL.
* include/private/gcconfig.h: GENERIC_COMPARE_AND_SWAP: Remove.
* include/private/thread_local_alloc.h: Don't USE_COMPILER_TLS on
ARM.
* dbg_mlc.c, include/gc.h, finalize.c: Merge Alexandre Oliva's
GC_debug_register_finalizer_unreachable() patch from gcc tree.
* thread_local_alloc.c (GC_malloc, GC_malloc_atomic): Add assertions
to check GC has been initialized.
* include/gc_cpp.h: Documentation updates.
* include/gc_config_macros.h: Don't check for __ppc__ to set
DARWIN_THREADS.
* Makefile.am: Include configure_atomic_ops.sh in dist.
* Makefile.am: Don't distribute copied atomic_ops files. Include
libatomic_ops with "make dist".
* configure.ac: Enable THREAD_LOCAL_ALLOC for Cygwin with threads.
* win32_threads.c: Report error for Cygwin + GC_DLL.
* Makefile.direct: Update THREAD_LOCAL_ALLOC documentation.
* cord/de_win.c: Rename and move AboutBox. Call GC_INIT. Remove
MakeProcInstance anachronism.
* doc/README.macros: Officially remove elif prohibition.
Remove documentation for defunct SRC_M3 support.
* include/gc.h: Remove more SRC_M3 references.
* include/private/gcconfig.h: Remove still more SRC_M3 references.
GC_SOLARIS_THREADS no longer needs to be checked separately.
* thread_local_alloc.c, include/private/thread_local_alloc.h:
Spell __declspec correctly.
* NT_STATIC_THREADS_MAKEFILE: Enable thread-local allocation.
* doc/README.win32: Adjust GC_win32_dll_threads rules again.
* mark.c (GC_mark_some wrapper): Restructure for readability, handle
GC_started_thread_while_stopped.
* misc.c (Win32 GC_write): Lock GC_write_cs only if needed.
* win32_threads.c: (client_has_run): remove,
GC_started_thread_while_stopped, GC_attached_thread: add.
(GC_push_all_stacks): Add verbose output.
(DllMain): Avoid initializing collector or the like.
Never update both thread tables.
* doc/README.win32: Adjust GC_win32_dll_threads rules.
* pthread_stop_world.c (GC_push_all_stacks): Print thread count with
GC_PRINT_VERBOSE_STATS.
* configure.ac: Comment out redundant
AC_DEFINE(NO_EXECUTE_PERMISSION).
* sparc_mach_dep.S: Remove single quote in comment.
* include/private/gcconfig.h: Fix DATAEND for NONSTOP.
* win32_threads.c: Include stdint.h for Mingw. Add GC_API for DllMain.
(GC_use_DllMain): Fix assertion.
* configure.ac: Introduce extra_ldflags_libgc. Use it for Darwin.
* Makefile.am (libgc_la_LDFLAGS): Use extra_ldflags_libgc.
* include/private/gcconfig.h: Enable MPROTECT_VDB for all Darwin
targets. Remove comments.
Prepare ppc64 support for Darwin.
* darwin_stop_world.c (GC_push_all_stacks): Fix compiler warnings.
Make i unsigned.
(GC_stop_world): Likewise. Remove unused GC_thread p.
(GC_start_world): Likewise.
* os_dep.c: Define GC_darwin_register_mach_handler_thread extern.
Remove double SIG_HNDLR_PTR definition.
(GC_forward_exception): Fix compiler warnings, make i unsigned.
Initialize thread_state to NULL.
(catch_exception_raise): Fix compiler warnings, make i unsigned.
* include/private/gc_priv.h (NEED_FIND_LIMIT, FREEBSD variant):
also define for X86_64.
* configure.ac: Move generic gnu (Hurd) case to below kfreebsd case.
* README.changes: Point to ChangeLog.
* darwin_stop_world.c: Move THREAD_FLD defines to ...
* include/private/gc_priv.h: ... here.
Fix THREAD_STATE definitions for ppc64.
* os_dep.c (catch_exception_raise): Use THREAD_FLD for exc_state member
access.
* configure.ac (i586-darwin): Replaced HAS_I386_THREAD_STATE_* with
HAS_X86_THREAD_STATE32_*.
(x86_64-*-darwin*): Extended the above check for x86_64-*-darwin* with
HAS_X86_THREAD_STATE64_*.
Added value 1 in the above AC_DEFINE's. Important for the upcoming
Leopard.
* include/private/gcconfig.h: Modified X86_64 define for Darwin.
Removed __x86_64__ check in POWERPC section. Added base definitions
for the X86_64 Darwin port.
* include/private/gc_priv.h: Added GC_MACH_HEADER and GC_MACH_SECTION
to distinguish between 32 and 64-bit applications. Added definitions
for X86_64 Darwin.
* darwin_stop_world.c: Added HAS_X86_THREAD_STATE64___RAX. And
replaced HAS_I386_THREAD_STATE___EAX with HAS_X86_THREAD_STATE32___EAX.
(GC_push_all_stacks): Added code for X86_64 Darwin. Even for the
!DARWIN_DONT_PARSE_STACK. Maybe obsolete.
* dyn_load.c (GC_dyld_name_for_hdr): Use GC_MACH_HEADER.
(GC_dyld_image_add): Use GC_MACH_HEADER and GC_MACH_SECTION.
Distinguish between getsectbynamefromheader_64 and
getsectbynamefromheader.
* os_dep.c (catch_exception_raise): Introduce exception definition for
X86_64 Darwin. Replaced old i386_EXCEPTION_STATE_* definition with
x86_EXCEPTION_STATE32_*. Add X86_64 for exc_state.faultvaddr.
== [7.0alpha7] 2006-09-19 ==
* More 6.7 changes.
* Declare GC_dump() in gc.h.
* Add --enable-large-config, which just defines the LARGE_CONFIG macro.
* Make GlobalAlloc address alignment a bit more intuitive.
* Use #elif in the definitions of GET_MEM.
* Overhaul porting.html. Remove corresponding text from README.
* Fix typo in DARWIN section of gcconfig.h.
* Fix Darwin thread memory leak.
* Update x86 AO_test_and_set implementation to use "=q".
* Add $(EXEEXT) to many tests in tests/tests.am. (Corresponds to a
6.7 fix, which no longer applied.)
* Fix Darwin/PPC port.
* Fix Cygwin/threads port.
* Fix gcj malloc support.
* For GNU-style make, don't build libatomic_ops unless threads are requested.
This should allow single-threaded builds on platforms which do not
currently support libatomic_ops.
* Clean up and hopefully fix the CFLAGS calculation for GNU build.
(Substantially improves things on HP/UX.)
* Integrated Andrei Polushin's Visual C++ patches. These provide for
stack traces, better C++ debug support, and better log file handling.
Note that these change the location of the log file to a the path of the
executable with a .log extension. To get the old behavior back, define
OLD_WIN32_LOG_FILE. For the time being, I'm checking his project
files and the like into a windows-untested subdirectory. They
are almost certainly already out of date, but better than what we had
before.
* Fixed some win32 threads bugs, and added support for _beginthreadex.
* Fix zero size thread local allocation so that explicit deallocation
works correctly.
* Removed serious bug in GC_malloc_uncollectable(large size).
* Do not try to do thread-local gcj allocation in incremental mode. There
are races in setting up the descriptor.
* Add GC_INIT() to middle.c, fix some more GC_printfn calls.
* Some assertions erroneously used I_HOLD_LOCK() negatively, even though
it can now spuriously return TRUE.
* Rename SUNOS5 macro and OS name to SOLARIS and SUNOS5DL to SOLARISDL.
* On Linux and some Un*x variants, allocate memory by first trying sbrk,
and then switching to mmap if that fails.
* Fixed /proc/x/maps reading to deal with asynchronous deletions.
* Fix REDIRECT_MALLOC with threads on Linux. It now usually seems to work
with ugly hacks that include having calloc behave differently when it is
called from ld.so or the pthreads library. A reasonable amount of
infrastructure was added to support some of this.
* Import various updated build scripts.
* Add GC_register_has_static_roots_callback.
* Fix serious bugs in GC_malloc_atomic_uncollectable().
* Return GC_SUCCESS form GC_get_stack_base().
* Fix several atomic_ops problems on IA64 with HP Compiler.
* Update to atomic_ops-1.2.
* Fix hb_n_marks description and reclaim.c assertion.
* Various additional win32 threads fixes.
* Enable GC_ASSERTIONS for Debug build with NT_THREADS_MAKEFILE.
== [7.0alpha5] ==
* More 6.6, 6.7 changes.
* Some Solaris fixes, including some more general changes in how
the assembly pieces of mach_dep.c are handled.
* Removed a lot of SOLARIS_THREADS-specific code that was only
needed with the old implementation. This included many (mostly no-op)
versions of GC_is_fresh.
* Don't use atomic_ops in gc_locks.h unless we need threads.
* Fixed USE_MARK_BITS, which is once again the default without PARALLEL_MARK.
* Removed Solaris GC_INIT hack. It's a workaround for a long dead bug,
and it seemed to be wrong anyway.
* Changed win32_threads.c to require preprocessor-based interception
of thread routines by default. A client call to GC_use_DllMain is
now required to get the old behavior in which DllMain is used to implicitly
register threads. This was done for uniformity with other platforms, and
because the DllMain solution seemed to require very tricky code which,
at least in the past, imposed hard bounds on the number of threads.
* Many small changes to make thread support work again on Cygwin.
* Moved definition of allocator lock etc. to pthread_support.c and
win32_threads.c for those two cases.
* Got rid of the FASTLOCK() machinery. It doesn't seem useful on modern
platforms.
* Cleaned up the uncollectable allocation routines, speeding up the
slower paths. The code did enough unnecessary work off the critical path
that the underlying logic was getting hard to extract.
* No longer turn off THREAD_LOCAL_ALLOC with DBG_HDRS_ALL. Indications
are it just works, and I think the reasons for it not working disappeared
a while ago.
* Fixed bugs in hb_n_marks calculation and assertion.
* Don't use __builtin_expect for pre-3.0 gcc.
* Define GWW_VDB only for recent Microsoft tool chains.
* Add overview.html to doc directory.
* Fix NT_STATIC_THREADS_MAKEFILE, various compiler warnings.
* Made thread local allocation sort of work with Cygwin. The code should
be there to deal with other Windows variants, But non-Cygwin Windows
threads need more bug fixes.
== [7.0alpha4] ==
* Various 6.5, 6.6 changes.
* Removed GC_brief_async_signal_safe_sleep and used atomic_ops instead.
* Integrated build patches from David Angelocola and Petter Urkedal.
* Fix dynamic-linker-based pthread call redirection.
* Renamed RS6000 to POWERPC/AIX.
* Allow recovery from SIGSEGV in marker on Linux. This works around
a race in thread stack marking if /proc is used to find roots. We do
that by default with malloc redirection and threads. This involved
moving some GC_find_limit and SETJMP related declarations to gc_priv.h.
* Added doc/porting.html file.
* Added ADD_HEAP_GUARD_PAGES for sbrk/*nix platforms to debug extreme
memory overwrite errors.
* Added trivial NO_INCREMENTAL flag to facilitate debugging.
* Added GC_getattr_np-based GC_get_stack_base (untested).
* Separated thread local allocation into a separate file and added the
beginning of win32 support for that.
== [7.0alpha3] ==
* Added support for dlopen-based interception of pthread functions.
This is only half done. The gc.h redefinitions currently interfere.
* Integrated major automake overhaul from Petter Urkedal.
== [7.0alpha2] ==
* GC_bytes_allocd was incremented by a possibly uninitialized variable
in GC_generic_malloc_inner. (Bug introduced in gc7.0alpha1.)
* Win32 fixes.
* Integrated Ben Hutchings' GetWriteWatch-based virtual dirty bit
implementation for win32.
* Removed pc_gc.tar and floppy targets in Makefile.direct. Removed
pc_excludes file.
* No longer include GC_bytes_wasted when evaluating allocation progress.
Since we are now counting live memory, it no longer makes sense.
* Applied Davide Angelocola's configure patch. There are now separate
Makefile.am's in the cord and tests subdirectory, more tests, etc.
* Renamed configure.in to configure.ac.
* Merged a very small number of Nathanael Nerode's configure.ac
cleanups from the gcc tree. Unfortunately, that file is a bit
different from ours.
* Changed EINTR handling in sem_wait slightly.
* Restructure the root marking code. Remove all traces of
USE_GENERIC_PUSH_REGS, and effectively make it the default.
Make it easier to pass a context pointer to the mark routine, in
case we ever want to do precise stack marking.
* Replace GC_start_blocking() and GC_end_blocking() with GC_do_blocking().
This remains undocumented, and only implemented for pthreads. But it
removes an otherwise unavoidable race with stores of callee-save
registers.
* Fix GC_n_mark_bits for the default MARK_BIT_PER_GRANULE case. This
resulted in bogus complaints in heap dumps.
* Upgrade to libatomic_ops-1.0, and update build structure to match.
* Remove SRC_M3 support. Clean up lock initialization code in misc.c.
* Removed gc_local_alloc.h. If THREAD_LOCAL_ALLOC is defined, the
thread local allocation routines are now called automatically.
* Renamed gc_inl.h back to gc_inline.h. Changed the interface appreciably
since locking has turned into a dominant issue, and in-line allocation
only makes sense if it's no worse than thread-local allocation.
Gc_inline.h is now also used to implement thread-local allocation.
* Finished replacing stubborn allocation with manual write barrier.
Untested.
* Use thread-local allocation code by default.
* Added GC_register_my_thread and friends for Posix and win32.
* Patch for GWW_VDB from Ben Hutchings.
* Removed explicit THREAD_LOCAL_ALLOC tests, since that now always
redefines GC_malloc.
* Removed now unused AIX memory allocation code.
* Various minor fixes for bugs introduced in 7.0alpha1.
== [7.0alpha1] ==
* Remove GC_PROTO, VOLATILE, GC_PTR, and GC_CONST. Assume ANSI C compiler
and use ANSI constructs unconditionally.
* Introduce #elif and #error in some of the appropriate places.
* Remove GC_printf cruft. Use stdargs.
* Remove separate Solaris threads support. Use the more generic Posix
implementation.
* Use atomic_ops for atomic operations and memory barriers.
* Clean up MPROTECT_VDB implementation. Use SA_SIGINFO wherever
possible.
* Remove broken SIGNALS stuff.
* Use size_t instead of word, where appropriate.
* Add .S.o rule to Makefile.am.
* Officially discontinue SunOS4, several old flavors of M68K (SunOS4,
A/UX, HP), IBM PC/RTs and RISCOS/Irix4. (I doubt the old code worked.
If anyone cares, these should be easy to resurrect.)
* Add EXPECT() in some critical places.
* Redefined hb_sz and hb_body to deal with bytes rather than words.
This affected a great deal of code. I would like to consistently use
byte offsets and sizes where there's not a convincing reason to do
otherwise.
* Redefined several other variables (GC_mem_found, GC_words_allocd)
etc. to use units of bytes. Most of these were also renamed to
reflect that fact.
* Killed as many "register" declarations as possible.
* Partially replaced stubborn allocation with manual write barrier.
It's currently broken.
* Restructured mark code, to allow mark bits to be kept either on
a per allocation granule or per object basis. The emphasis is
now on the -DUSE_MARK_BYTES option, since individual bits perform
quite badly on hyper-threaded P4s, and are probably suboptimal on
other architectures. -DUSE_MARK_BITS is currently broken, and may
be resurrected only for the single-threaded case. This significantly
reduced the cache footprint required by auxiliary GC data structures.
It also reduces space overhead for small heaps. It probably slows
things down slightly if interior pointers are very common.
* As part of the above, we now maintain an approximate count of set
mark bits in each heap block.
* As part of the above, the semantics of hb_map changed drastically.
For MARK_BIT_PER_OBJ, it doesn't exist. For MARK_BIT_PER_GRANULE,
it is purely a way to replace a mod instruction with a table lookup.
(Somewhat to my surprise, this still wins on modern hardware.)
* Removed PRINTSTATS, GATHERSTATS, and SILENT macros. Everything is
now controlled by GC_print_stats variable and GC_PRINT_STATS
and new GC_PRINT_VERBOSE_STATS environment variables.
* Add GC_log_printf and use it consistently for logging output.
* Unconditionally count the objects we reclaim in the sweep phase.
For thread local allocation, we need that anyway, and we expect
that's increasingly the only case that matters. And it simplifies
the code. In general expect minor performance hacks that benefit
only the single-threaded case to disappear.
* Remove GC_quiet from gc.h and elsewhere.
* Changed the heap expansion heuristic, and the definition of
GC_free_space_divisor, to refer to live data size, instead of total
heap size. I believe this is much more robust. It wasn't previously
possible, because we didn't have access to live data size.
* Thread local allocation added the extra byte in twice: Once in
thread_local_alloc, and once in malloc_many.
* Removed GC_malloc_words_small and GC_gcj_fast_malloc. A new
mechanism based on the thread local allocation data structures
is expected to be added instead. This should allow inlined code
that is both fast and doesn't rely on collector internals.
* Changed both free lists and reclaim lists to be indexed by granules
instead of words, norming halving their size.
* MERGE_SIZE is now the only option, and the macro was removed.
(Without it, we need a memory reference to GC_all_interior_pointers
anyway. Thus it costs us nothing.)
* Change GC_size_map to map to granules instead of words. Make sure
that every possible size up to TINY_FREELISTS is present.
* Split of macros need for fast inline allocation into gc_tiny_fl.h
in anticipation of a new inline allocator that doesn't rely on GC
internals.
* Changed thread local allocation to use GRANULE_BYTES and TINY_FREELISTS
in anticipation of a merge with the inline allocation code.
* Removed ALIGN_DOUBLE. This is mostly handled by GRANULE_BYTES.
* Make locking on most platforms conditional on GC_need_to_lock.
== [6.9] ==
* Fix typo in PREFETCH implementation for X86_64.
* Fix M68K LINUX port.
* __GNUC__ was misspelled as __GNUC in new_gc_alloc.h.
* Integrated Allan Hsu's patch for OS X VM deallocation problems.
* Applied FreeBSD/X86_64 patch.
== [6.8] ==
* Added some support for Dragonfly BSD.
* Improvements to the HP/UX section of configure.in/configure.ac.
* GC_unix_get_mem could neglect to release the malloc lock on Irix, under
extremely unlikely circumstances.
* Added support for kFreeBSD + glibc
* Fix more MacOS threads memory leaks
* Added initial Solaris/X86-64 support
== [6.7] ==
* Add "int" to Solaris "end" and "etext" declaration in gc.h. Declared
the symbols with underscores and as arrays, since that's what's actually
used. Perhaps this could all just be removed.
* Fixed ARM GC_test_and_set code.
* Added casts for assignments to hb_last_reclaimed, which truncate the
value. Added a cast to GC_adj_words_allocd. Use GetModuleHandleA
when retrieving a handle to kernel32.dll under win32.
* Added Tandem S-Series support.
* Remove spurious gc:: qualifier for operator delete[] in gc_cpp.h.
* Changed a test for LINUX in config_macros.h to one for __linux__.
* Add prototypes for GC_finalizer_notifier and GC_thr_init.
* Use ld instead of nonexistent ldz instruction in Darwin FindTopOfStack.
* Add support for Darwin/X86.
* Merge in some recent gcc fixes. Add ppc64 asm code.
* Scan MEM_PRIVATE sections under Windows ME and predecessors.
* Interior pointers with some largish offsets into large objects could
be ignored, if GC_all_interior_pointers was set. (Oddly this worked
correctly for stack references if it was not set. Otherwise it failed
for both stack and heap references.)
* Integrated Tatsuya Bizenn's NETBSD threads support, with some
untested changes.
* Added GC_strdup and friends to make leak detection work correctly
for strdup clients. Fixed the existing strdup
with malloc redirection to handle a null malloc return correctly.
== [6.6] ==
* Fix CPU count detection for Irix and FreeBSD.
* Integrate Dan Bonachea's patch for the IBM XLC compiler on Darwin.
* Integrated Andreas Tobler's FreeBSD/PowerPC patch.
* Don't access the GC thread structure from the restart handler. It's
unsafe, since the handler may run too late.
* Applied Christian Thalinger's patch to change comment syntax in
alpha_mach_dep.S.
* Added test for GC_no_dls in GC_dyld_image_add for DARWIN.
* Use LINUX_STACKBOTTOM for Linux/SH and LINUX/ARM.
* Rewrote GC_parse_map_entry. This assumed a fixed column layout of
/proc/self/maps on Linux. This ceased to be true about 2 years ago.
The old code is probably quite problematic with -DREDIRECT_MALLOC. It
is also used by default for IA64, though I haven't seen actual failures
there.
* More consistently define HBLKSIZE to 4096 on 64 bit architectures with
4K pages.
* With win32 threads, GC_stop_world needs to acquire GC_write_cs.
* Move up struct callinfo declaration to make gcc 4.0.2. happy.
== [6.5] ==
* Integrated Paolo Molaro's patch to deal with EINTR in sem_wait.
* Make GC_approx_sp() write to dummy location to ensure that stack
is grown here, when sp looks reasonable, rather than later, when
it might look like a bad memory reference. (Problem was never
observed that I know of. But on rereading the code it seemed
dubious.)
* Separate out GC_with_callee_saves_pushed and sometimes call
it from GC_suspend_handler in pthread_stop_world.c. Callee-save
register values sometimes failed to get traced under HP/UX on
PA-RISC. Linux/IA64 had the same problem, though non-stacked
callee-save registers seem to be so rarely used there that nobody
ever noticed.
* Integrated an ancient Darwin powerpc_darwin_machine_dep.s patch
from Andreas Tobler, which I had lost.
* Fix compare_and_exchange implementation for gcc/IA64 to deal with
pickier compiler versions.
* Fixed Itanium 32-bit ABI support (HP/UX). In particular, the
compare_and_exchange implementation didn't consider that possibility.
* Undefine GC_pthread_detach in win32_threads.c.
* Fixed inclusion of frame.h for NETBSD in os_dep.c.
* Applied Dan Bonachea's patch to use mmap on AIX.
* Several fixes to resurrect the Irix port on recent OS versions.
* Change ALPHA to use LINUX_STACKBOTTOM.
* Change SPARC64/LINUX to also use LINUX_STACKBOTTOM. Deal with potential
bad values of __libc_stack_end on that platform.
* Relax gctest to allow larger heap if ALIGN_DOUBLE isn't set.
(Unnecessary in 7.0)
* Force a define of __STDC__=0 for the IBM compiler on AIX, so that
we get prototypes. (Unnecessary in 7.0)
* GC_INIT definition for AIX and CYGWIN referred to DATASTART and DATAEND
which are only defined in private include files.
* Integrated some small gcconfig.h patches from Dan Bonachea. Also
relaxed assertion about FreeBSD stack size in pthread_support.c.
* Integrated Andrew Begel's darwin_stop_world.c patch for 64-bit
support. This may need additional work.
* Avoided potentially infinite recursion in GC_save_callers if
the system backtrace calls malloc. The workaround currently requires
__thread support if this code is used with threads.
* Avoided another similar infinite recursion by conditionally
invoking GC_save_callers in alloc.c.
* Removed all traces of aix_irix_threads.c. AIX and Irix now use
pthread_support.c and pthread_stop_world.c. The old code appeared
to be unreliable for AIX, and was not regularly maintained.
* On Irix, ignore segments with MA_FETCHOP or MA_NOTCACHED attributed;
they're not always safe to read.
* Fixed a previously vacuous assertion (diagnosed by the SGI compiler)
in GC_remove_from_fl.
* Fix stack_size assertion in GC_pthread_create.
* Fix assertion in GC_steal_mark_stack.
== [6.4] ==
* Merge gcconfig.h changes from gcc tree.
* Unconditionally include gc_priv.h in solaris_pthreads.c, win32_threads.h,
aix_irix_threads.c, and solaris_threads.c to get thread definitions.
* Start marker threads in GC_thr_init, so that they get started even
if no other threads are ever started. (Oddly enough, the parallel
collector worked correctly, though not well, with no helper threads.)
* Go ahead and split large blocks in GC_allochblk_nth if GC_dont_gc
is set.
* GC_PRINT_BACK_HEIGHT would deadlock with thread support.
* Let in_progress_space in backgraph.s grow dynamically.
* Fix README.solaris2. The GC_thr_init() hack doesn't work anymore.
* Convert GC_finalizer_mem_freed to bytes in allchblk.c.
* Add missing declaration for GC_generic_malloc_words_small_inner.
Without it, s390x breaks.
* Applied several MacOSX patches to support older tool chains.
* Bug fix for NetBSD/amd64. Add NetBSD/sh3 support.
* Fixed an uninitialized variable in cordprnt.c.
* Eliminated some, but not all, gcc -Wall warnings.
* Changed some old style casts to reinterpret_cast in new_gc_alloc.h.
* GC_extend_size_map shouldn't adjust for GC_all_interior_pointers if
GC_DONT_ADD_BYTE_AT_END is set.
* Changed some (long) casts to (word) in preparation for win64.
* Changed "int stack_size" declaration in pthread_support.c to use
size_t. (Only mattered with GC_ASSERTIONS enabled.)
* Added CRIS (etrax) support.
* Removed GC_IGNORE_FB frame buffer recognition, and replaced
it with a check that the mapping type is MEM_IMAGE.
In theory, this should work much better, but it is a high
risk change for win32.
* GC_allochblk_nth incremented GC_words_wasted by bytes rather than
words.
* Consider GC_words_wasted in GC_adj_words_allocd only if it is within
reason. (A hack to avoid some extremely unlikely scenarios in which
we manage to allocate only "wasted" space. 7.0 has a better fix.)
* Changed PowerPC GC_clear implementation to use lwsync instead of
eieio, since the documentation recommends against eieio, and
it seems to be incorrect if the preceding memory op is a load.
* Fixed print_block_list to print the correct kind number for
STUBBORN.
* Have configure.in generate an error if it is asked to support
pthreads, but doesn't know how to.
* Added Kazuhiro Inaoka's patch for Renesas M32R support.
* Have the GNU build mechanism link with -ldl. Rename THREADLIBS
to THREADDLLIBS to reflect this.
* Added Hannes Mehnert's patch for FreeBSD/SPARC support.
* Merged some FreeBSD specific patches to threadlibs.c and dyn_load.c.
* Define MPROTECT_VDB on MACOSX only if threads are being used, since the
dirty page tracking mechanism uses threads. (This avoids an undefined
reference to _GC_darwin_register_mach_handler_thread.)
* By popular demand, use __libc symbols only if we are built with
USE_LIBC_PRIVATES, which is off by default, and not otherwise documented.
* Ignore GC_enable_incremental() requests when KEEP_BACK_PTRS is set.
The GC itself will dirty lots of pages in this cases, probably making
it counterproductive on all platforms. And the DARWIN port crashes.
== [6.3] ==
* Compile test_cpp.cc with CXXCOMPILE instead of COMPILE.
* Very large allocations could cause a collector hang. Correct
calculation of GC_collect_at_heapsize.
* GC_print_hblkfreelist printed some bogus results if USE_MUNMAP
was defined.
* Include gc_config_macros.h in threadlibs.c.
* Correct MacOSX thread stop code.
* SMALL_OBJ definition was off by one. This could cause crashes
at startup.
* Integrate Paolo Molara's patch to deal with a race in the Darwin
thread stopping code.
* Changed X86_64 implementation to use SA_SIGINFO in the MPROTECT_VDB
implementation. The old approach appears to have been broken by
recent kernels.
* Added GC_ATTR_UNUSED to eliminate a warning in gc_allocator.h.
* Fix GC_task_self declaration in os_dep.c.
* Increase INITIAL_BUF_SZ in os_dep.c for Solaris /proc reads.
== [6.3alpha6] ==
* Define USE_GENERIC_PUSH_REGS for NetBSD/M68K.
* Fixed the X86_64 PREFETCH macros to correctly handle ia32e (which uses
different prefetch instructions from AMD64).
* GC_config_macros.h did not correctly define GC_WIN32_THREADS from
GC_THREADS.
* Added simple_example.html.
* Merged Andrew Gray's patch to correctly restore signal handlers on
FreeBSD.
* Merged a patch from Andreas Jaeger to deal with prefetch-related warnings
on x86-64. Added some other casts so that the PREFETCH macros
always get a ptr_t argument. Removed some casts in the PREFETCH
implementations.
* Added a header guard for gc_allocator.h
and changed GC_debug_free to clobber contents of deallocated object.
* The signal masking code in pthread_stop_world.c contained some errors.
In particular SIGSEGV was masked in the handler, in spite of the fact that
it wrote to the heap. This could lead to an uncaught SIGSEGV, which
apparently became much more likely in Linux 2.6. Also fixed some
typos, and reduced code duplication in the same area.
* Remove ltconfig, clean up configure messages for DGUX.
* Integrated NetBSD/OpenBSD patches from Marc Recht and Matthias Drochner.
== [6.3alpha5] ==
* Fix & vs && typo in GC_generic_malloc and
GC_generic_malloc_ignore_off_page. (Propagated from the gcc tree.)
* Removed SA_NODEFER hack from NetBSD and Solaris write-protect handler.
(According to Christian Limpach, the NetBSD problem is fixed.
Presumably so is the Solaris 2.3 problem.)
* Removed placement delete from gc_cpp.h for the SGI compiler.
* Changed semantics of the GC_IGNORE_FB environment variable.
We still need help in identifying win32
graphics memory mappings. The current "solution" is a hack.
* Removed "MAKEOVERRIDES =" from Makefile.am and thus Makefile.in.
It probably made more sense in the gcc context.
* Explicitly ensure that NEED_FIND_LIMIT is defined for {Open,Net}BSD/ELF.
* Replaced USE_HPUX_TLS macro by USE_COMPILER_TLS, since gcc often
supports the same extension on various platforms.
* Added some basic (completely untested) defines for win64, in support
of future work.
* Declared GC_jmp_buf in os_dep.s as JMP_BUF instead of jmp_buf, fixing
a memory overwrite bug on Solaris and perhaps other platforms.
* Added 0 != __libc_stack_end test to GC_linux_stack_base.
Otherwise pre-linking could cause the collector to fail.
* Changed default thread local storage implementation to USE_PTHREAD_SPECIFIC
for HP/UX with gcc. The compiler-based implementation appears to work
only with the vendor compiler.
* Export GC_debug_header_size and GC_USR_PTR_FROM_BASE from gc_mark.h,
making client mark code cleaner and less dependent on GC version.
* Export several new procedures and GC_generic_malloc from gc_mark.h
to support user-defined kinds. Use the new procedures to replace existing
code in gcj_mlc.c and typd_mlc.c.
* Added support for GC_BACKTRACES.
* Fixed a remaining problem in CORD_str with signed characters.
* Removed supposedly redundant, but very buggy, definitions of finalizer
macros from javaxfc.h. Fortunately this file probably has no users.
The correct declarations were already in gc.h.
* Also need to set GC_in_thread_creation while waiting for GC during
thread termination, since it is also possible to collect from an
unregistered thread in that case.
* Define NO_GETENV for Windows CE, since getenv doesn't appear to exist.
Plus some other minor WinCE fixes.
* Added GC_register_describe_type_fn.
* Arrange for debugging finalizer registration to ignore non-heap
registrations, since the regular version of the routine also behaves
that way.
* GC_gcj_malloc and friends need to check for finalizers waiting to be run.
One of the more obscure allocation routines with missing a LOCK() call.
* Fixed cvtres invocations in NT_MAKEFILE and NT_STATIC_THREADS_MAKEFILE
to work with VS.NET.
* Cleaned up GC_INIT calls in test. Updated gc.man to encourage GC_INIT
use in portable code.
* Taught the GC to use libunwind if --enable-full-debug is specified on
IA64 and libunwind is present.
* The USE_MUNMAP code could get confused about the age of a block and
prematurely unmap it. GC_unmap_old had a bug related to wrapping of
GC_gc_no. GC_freehblk and GC_merge_unmapped didn't maintain
hb_last_reclaimed reasonably when blocks were merged. The code was
fixed to reflect original intent, but that may not always be an
improvement.
== [6.3alpha4] ==
* USE_MMAP was broken by confusion in the code dealing with USE_MMAP_ANON.
* Darwin support was broken in alpha3 as a result of my mis-integration of
Andrew Begel's patches. Fixed with another patch from Andrew Begel.
* A new sanity check in pthread_stop_world.c:GC_push_all_stacks() was
overly aggressive. We may collect from an unregistered thread during
thread creation. Fixed by explicitly checking for that case. (Added
GC_in_thread_creation.)
== [6.3alpha3] ==
* Removed -DSMALL_CONFIG from BCC_MAKEFILE.
* Changed macros to test for an ARM processor (Patch from Richard Earnshaw.)
* Mostly applied a DJGPP patch from Doug Kaufman. Especially Makefile.dj
had suffered from serious bit rot.
* Rewrote GC_apply_to_maps, eliminating an off-by-one subscript error,
and a call to alloca (for lcc compatibility).
* Changed USE_MUNMAP behavior on POSIX platforms to immediately remap
the memory with PROT_NONE instead of unmapping it. The latter risks
an intervening mmap grabbing the address space out from underneath us.
Updated this code to reflect a cleaner patch from Ulrich Drepper.
* Replaced _T with _Tp in new_gc_alloc.h to avoid a MACOS X conflict.
(Patch from Andrew Begel.)
* Dynamically choose whether or not lock should spin on win32.
This may be a significant performance improvement for win32.
* Fix Makefile.direct to actually include NT_STATIC_THREADS_MAKEFILE
in the distribution.
* Maybe_install_looping_handler() was accidentally exported, violating
our name space convention.
* Made os_dep.c use sigsetjmp and SA_NODEFER for NetBSD.
* Integrated Andrew Begel's Darwin threads patch, adjusted according to
some of Fergus Hendersons's comments. (Patch didn't apply cleanly,
errors are possible.)
* Added another test or two for the Intel 8.0 compiler to avoid
confusing it with gcc. The single-threaded collector should now build
with icc, at least on ia64.
== [6.3alpha2] ==
* Re-enabled I_HOLD_LOCK assertion in aix_irix_threads.h.
* Put back the WINABI qualifier for GC_CreateThread.
* Sometimes explicitly define __private_extern__ before DARWIN dyld.h
include.
* Included signal.h from pthread_support.c. Removed GC_looping_handler,
which was dead code.
* GC_find_start was misdeclared by gc_pmark.h if PRINT_BLACK_LIST was
defined.
Changed GC_find_start to never just return 0. According to its
comment it doesn't, and it's unclear that's correct.
* GC_alloc_large had several largely compensating bugs in the
computation of GC_words_wasted. (It was confused about bytes vs.
words in two places.)
* Integrated Slava Sysoltev's patch to support more recent versions of
the Intel compiler on IA64/Linux.
* Changed win32 spinlock initialization to conditionally set a spin count.
(Emmanual Stumpf pointed out that enabling this makes a large performance
difference on win32 multiprocessors.) Also cleaned up the win32 spinlock
initialization code a bit.
* Fixed thread support for HP/UX/IA64. The register backing store base for
the main thread was sometimes not set correctly.
* Added -DEMPTY_GETENV_RESULTS flag to work around Wine problem.
* Declare GC_stack_alloc and GC_stack_free in solaris_threads.h to
avoid 64-bit size mismatches.
* Fixed GC_generic_push_regs to avoid a potential and very unfortunate
tail call optimization. This could lead to prematurely reclaimed
objects on configurations that used the generic routine and the new
build infrastructure (which potentially optimizes mach_dep.c).
This was a serious bug, but it's unclear whether it has resulted in
any real failures.
* Fixed CORD_str to deal with signed characters.
* Merged a couple of NOSYS/ECOS tests into os_dep.c from gcj.
* Partially merged a win32 patch from Ben Hutchings, and substantially
revised other parts of win32_threads.c. It had several problems.
Under MinGW with a statically linked library, the main thread was
not registered. Cygwin detached threads leaked thread descriptors.
There were several race conditions. For now, unfortunately the
static threads limit remains, though we increased it, and made table
traversal cost depend on the actual thread count.
There is also still some code duplication with pthread_support.c.
(Thread descriptors did become much smaller, since Ben Hutchings
removed the thread context from them.)
* Integrated a Solaris configure.in patch from Rainer Orth.
* Added GC_IGNORE_FB and associated warning to very partially address
the issue of the collector treating a mapped frame buffer as part
of the root set.
== [6.3alpha1] ==
* Integrated some NetBSD patches forwarded to me by Marc Recht. These
were already in the NetBSD package.
* GC_pthread_create waited for the semaphore even if pthread_create failed.
Applied the analogous fix for aix_irix_threads.c.
* Added Rainer Orth's Tru64 fixes.
* The check for exceeding the thread table size in win32 threadDetach
was incorrect.
* Applied Andrew Begel's patch to correct some reentrancy issues
with dynamic loading on Darwin.
* GC_CreateThread() was neglecting to duplicate the thread handle in
the table.
* Pass +ESdbgasm only on PA-RISC machines with vendor compiler.
* Applied more AIX threads patches from Scott Ananian.
== [6.2] ==
* Integrated a second round of Irix/AIX patches from Dan Bonachea.
Renamed mips_sgi_mach_dep.S back to mips_sgi_mach_dep.s, since it requires
the Irix assembler to do the C preprocessing; gcc -E doesn't work.
* Fixed Makefile.direct for DARWIN.
* There was a race between GC_pthread_detach and thread exit that could
result in a thread structure being deallocated by GC_pthread_detach
even though it was still needed by the thread exit code.
* Fixed version parsing for non-alpha versions in acinclude.m4 and
version checking in version.h.
== [6.2alpha6] ==
* There was an extra underscore in the name of GC_save_registers_in_stack
for NetBSD/SPARC.
* Integrated Brian Alliet's patch for Darwin. This restructured the
linuxthreads/pthreads support to separate generic pthreads support
from more the system-dependent thread-stopping code. I believe this
should make it easier to eliminate the code duplication between
pthreads platforms in the future. The patch included some other
code cleanups.
* Integrated Dan Bonachea's patch to support AIX threads. This required
substantial manual integration, mostly due to conflicts with other
recent threads changes. It may take another iteration to
get it to work.
* Removed HPUX/PA-RISC support from aix_irix_threads.c. It wasn't used
anyway and it cluttered up the code. And anything we can do to migrate
towards generic pthreads support is a good thing.
* Added a more explicit test for tracing of function arguments to test.c.
* Added Akira Tagoh's PowerPC64 patch.
* Fixed some bit rot in the Cygwin port.
gc.h now includes just windows.h, not winbase.h.
* Declared GC_save_regs_in_stack() in gc_priv.h. Remove other declarations.
* Changed --enable-cplusplus to use automake consistently. The old way
confused libtool. "Make install" didn't work correctly for the old version.
Previously --enable-cplusplus was broken on cygwin.
* Changed the C version of GC_push_regs to fail at compile time if it is
generated with an empty body. This seems to have been the cause of one
or two subtle failures on unusual platforms. Those failures should
now occur at build time and be easily fixable.
== [6.2alpha5] ==
* GC_invoke_finalizers could, under rare conditions, set
GC_finalizer_mem_freed to an essentially random value. This could
possibly cause unbounded heap growth for long-running applications
under some conditions. (The bug was introduced in 6.1alpha5, and
is not in gcc3.3.)
* Attempted to sanitize the various DLL macros. GC_USE_DLL disappeared.
GC_DLL is used instead. All internal tests are now on GC_DLL.
README.macros is now more precise about the intended meaning.
* Include DllMain in the multithreaded win32 version only if the
collector is actually built as a dll.
* Hide the cygwin threadAttach/Detach functions. They were violating our
namespace rules.
* Fixed an assertion in GC_check_heap_proc. Added GC_STATIC_ASSERT.
* Removed some obsolete definitions for Linux/PowerPC in gcconfig.h.
* CORD_cat was not rebalancing unbalanced trees in some cases, violating
a CORD invariant. Also tweaked the re-balancing rule for
CORD_cat_char_star.
* Added hand-coded structured exception handling support to mark.c.
This should enable support of dynamic libraries under win32 with
gcc-compiled code.
Turned on dynamic library scanning for win32/gcc.
* Removed some remnants of read wrapping.
GC_USE_LD_WRAP ws probably broken in recent versions.
* The build could fail on some platforms since gcconfig.h could include
declarations mentioning ptr_t, which was not defined, e.g. when if_mach
was built. Also
cleaned up tests for GC_PRIVATE_H in gcconfig.h a bit.
* The GC_LOOP_ON_ABORT environment variable interfered with incremental
collection, since the write fault handler was erroneously overridden.
Handlers are now set up in the correct order.
* It used to be possible to call GC_mark_thread_local_free_lists() while
the world was not stopped during an incremental GC. This was not safe.
Fortunately, it was also unnecessary. Added GC_world_stopped flag
to avoid it. (This caused occasional crashes in GC_set_fl_marks
with thread local allocation and incremental GC. This probably happened
primarily on old, slow multiprocessors.)
* Allowed overriding of MAX_THREADS in win32_threads.c from the build
command line.
* Taught the IA64/linux code to determine the register backing store base from
/proc/self/maps after checking the __libc symbol, but before guessing.
(__libc symbols are on the endangered list, and the guess is likely to not
always be right for 2.6 kernels.) Restructured the code to read and parse
/proc/self/maps so it only exists in one place (all platforms).
* The -DUSE_PROC_FOR_LIBRARIES code was broken on Linux. It claimed that it
also registered the main data segment, but didn't actually do so. (I don't
think anyone actually uses this configuration, but ...)
* Made another attempt to get --enablecplusplus to do the right thing.
Since there are unavoidable problems with C programs linking against a
dynamic library that includes C++ code, I separated out the c++ code into
libgccpp.
== [6.2alpha4] ==
* Use LINUX_STACKBOTTOM for >= glibc2.2 on Linux/MIPS. (See Debian bug
# 177204)
* Integrated Jeff Sturm and Jesse Rosenstock's MACOSX threads patches.
* Integrated Grzegorz Jakacki's substantial GNU build patch. "Make dist"
should now work for the GNU build process. Documentation files
are installed under share/gc.
* Tweaked gc_cpp.h to again support the Borland compiler.
* Updated BCC_MAKEFILE.
* Added GC_ASSERT check for minimum thread stack size.
* Added --enable-gc-assertions.
* Added some web documentation to the distribution. Updated it in the
process.
* Separate gc_conf_macros.h from gc.h.
* Added generic GC_THREADS client-defined macro to set the appropriate
GC_XXX_THREADS internal macro. (gc_config_macros.h.)
* Add debugging versions of _ignore_off_page allocation primitves.
* Moved declarations of GC_make_closure and GC_debug_invoke_finalizer
from gc.h to gc_priv.h.
* Reset GC_fail_count even if only a small allocation succeeds.
* Integrated Brian Alliet's patch for dynamic library support on Darwin.
* gc_cpp.h's gc_cleanup destructor called GC_REGISTER_FINALIZER_IGNORE_SELF
when it should have called the lower case version, since it was
explicitly computing a base pointer.
== [6.2alpha3] ==
* Don't include execinfo.h in os_dep.c when it's not needed, and may not
exist.
== [6.2alpha2] ==
* Fixed the completely broken FreeBSD code in 6.2alpha1.
* Changed IRIX reference in dbg_mlc.c to IRIX5.
* Attempted to work around the problems with .S filenames and the SGI
compiler. (Untested.)
* Worked around an HP/UX make issue with the GNU-style build process.
* Fixed the --enable-cplusplus build machinery to allow builds without
a C++ compiler. (That was always the intent ...)
* Changed the debugging allocation macros to explicitly pass the return
address for Linux and XXXBSD on hardware for which we can't get stack
traces. Use __builtin_return_address(0) to generate it when possible.
Some of the configuration work was cleaned up (good) and moved to gc.h
(bad, but necessary). This should make leak detection more useful
on a number of platforms.
* Fixed compilation problems in dbg_mlc.c with GC_ADD_CALLER.
* Bumped revision number for dynamic library.
== [6.2alpha1] ==
* Guard the test for GC_DUMP_REGULARLY in misc.c with
"#ifndef NO_DEBUGGING". Otherwise it fails to build with NO_DEBUGGING
defined.
* Message about retrying suspend signals was incorrectly generated even when
flag was not set.
* Cleaned up MACOSX/NEXT root registration code. There was apparently a
separate ifdef case in GC_register_data_segments() for no reason.
* Removed MPROTECT_VDB for MACOSX port, based on one negative report.
* Arrange for gc.h and friends to be correctly installed with GNU-style
"make install".
* Enable the GNU-style build facility include C++ support in the library
with --enable-cplusplus.
* Mark from GC_thread_key in linux_threads.c, in case that's allocated
from the garbage collected heap, as it is with our own thread-specific
storage implementation.
* Mark all free list header blocks if they are heap allocated. This avoids
some unnecessary tracing. And it remains correct if we clear the
root set.
* Improved S390/Linux support. Add S390/Linux 64-bit support.
* Corrected the spelling of GC_{M,C}ALLOC_EXPLICTLY_TYPED to
GC_{M,C}ALLOC_EXPLICITLY_TYPED in gc_typed.h. This is technically
an interface change. Based on the fact that nobody reported this,
I suspect/hope there were no clients.
* Cleaned up gc_typed.h so that (1) it adds an extern "C" declaration
when appropriate, (2) doesn't generate references to undefined internal
macros, and (3) allows easier manual construction of descriptors.
* Close the file descriptor used by GC_print_address_map().
* Set the "close-on-exec" bit for various file descriptors maintained
for the collector's internal use.
* Added a hack to find memory segments owned by the system allocator
under win32. Based on my tests, this tends to eventually find all
segments, though it may take a while. There appear to be cleaner,
but slower solutions under NT/XP. But they rely on an API that's
unsupported under 9X.
* Changed Linux PowerPC stack finding to LINUX_STACKBOTTOM.
* Added GC_set_free_space_divisor to avoid some Windows dll issues.
* Added FIXUP_POINTER, POINTER_SHIFT, POINTER_MASK to allow preprocessing
of candidate pointers for tagging, etc.
* Always lock around GC_notify_full_gc(). Simplified code for
invoking GC_notify_full_gc().
* Changed the way DATASTART is defined on FreeBSD to be robust against
an unmapped page after etext.
* Made GC_enable() and GC_disable() official. Deprecated direct update
of GC_dont_gc. Changed GC_gcollect to be a noop when garbage collection
is disabled.
* Call GC_register_dynamic_libraries before stopping the world on Linux,
in order to avoid a potential deadlock due to the dl_iterate_phdr lock.
* Introduced a more general mechanism for platform-dependent code to
decide whether the main data segment should be handled separately
from dynamic libraries, or registered by GC_register_dynamic_libraries.
The latter is more reliable and easier on Linux with dl_iterate_phdr.
== [6.1] ==
* Added GC_MAXIMUM_HEAP_SIZE environment variable.
* Fix configure.in for MIPS/LINUX.
* Double page hash table size for -DLARGE_CONFIG.
* Integrated Bo Thorsen's X86-64 support.
* STACKBOTTOM definition for LINUX/MIPS was partially changed back.
* Replaced all occurrences of LINUX_DATA_START in gcconfig.h with
SEARCH_FOR_DATA_START. It doesn't hurt to falll back to a search.
And __data_start doesn't seem to get defined correctly of the GC
library is loaded with LD_PRELOAD, e.g. for leak detection.
* If the GC_find_leak environment variable is set, do a
atexit(GC_gcollect) to give us at least one chance to detect leaks.
This may report some very benign leaks, but ...
* Addeded REDIRECT_FREE. It's necessary if we want leak detection with
LD_PRELOAD.
* Defer printing of leaked objects, as for smashed objects.
* Fixed process and descriptor leak in GC_print_callers. Try for
line number even if we got function name.)
* Ported parallel GC support and thread local allocation to Alpha.
Not yet well-tested.
* Added GC_DUMP_REGULARLY and added finalization statistics to GC_dump().
* Fixed Makefile.am to mention alpha_mach_dep.S instead of the defunct
alpha_mach_dep.s.
* Incorporated a change to new_gc_alloc.h,
which should make it work with gcc3.1.
* Use alpha_mach_dep.S only on Linux. (It's not clear that this is
optimal, but it otherwise didn't build on Tru64.)
* Added ifdef to guard free() in os_dep.c. Otherwise we get a
compilation error on Irix.
* Added an experimental version of GC_memalign to mallocx.c. This can't
always work, since we don't handle alignment requests in the hblk-level
allocator, and we can't handle arbitrary pointer displacements unless
GC_all_interior_pointers is enabled. But it should work for alignment
requests up to HBLKSIZE. This is not yet documented in the standard
places.
* Finally debugged the OSF1/Tru64 thread support. This needs more testing,
since I needed to add a somewhat unconvincing workaround for signal
delivery issues that I don't yet completely understand. But it does
pass my tests, even in parallel GC mode. Incremental GC support is
disabled if thread support is enabled, due to the signal issues.
* Eliminated name-space-incorrect definition of _cdecl from gc_cpp.h.
* Added GC_debug_malloc_replacement and GC_debug_realloc_replacement
declarations to gc.h. On IA64, this is required for REDIRECT_MALLOC
to work correctly with these.
* Fixed Linux USE_PROC_FOR_LIBRARIES to work with a 64-bit /proc format.
== [6.1alpha5] ==
* Added GC_finalizer_mem_freed, and changed some of the code that
decided on heap expansion to look at it. Memory explicitly
deallocated by finalizers essentially needs to be counted as reclaimed
by the GC. Otherwise there are cases in which the heap can grow
infinitely.
* Integrated Adam Megacz patches to not scan dynamic libraries if
we are compiling with gcc on win32. Otherwise we need structured
exception handling to deal with asynchronously unmapped root
segments, and gcc doesn't directly support that.
* Integrated Anthony Green's patch to support Wine.
* GC_OPERATOR_NEW_ARRAY was misspelled OPERATOR_NEW_ARRAY in several
places, including gc_cpp.cc.
* Integrated Loren James Rittle's Alpha FreeBSD patches. These also
changed the declarations of symbols like _end on many platforms to
that they wouldn't mistakenly be declared as short data symbols.
* Integrated changes from the Debian distribution.
Fix C++ comments in POWERPC port. Add ARM32
incremental GC support. Get rid of USE_GENERIC_PUSH_REGS for alpha/Linux,
this time for real. Use va_copy to get rid of cord printf problems
(finally).
* Close file descriptor used to count cpus.
* Don't just drop gcj free lists in GC_start_reclaim, since that can
eventually cause the marker to see a bogus mark descriptor in the
dropped objects. The usual symptom was a very intermittent segmentation
fault in the marker. This mattered only if one of the GC_gcj_malloc
variants was used.
* Fixed Linux and Solaris/64 SPARC configuration.
* Fixed a typo in strdup definition.
* Changed Makefile.direct to invoke $(CC) to assemble alpha_mach_dep.S.
This is needed on Linux. I'm not sure whether it's better or worse
on Tru64.
* Changed gc_cpp.h once more to declare operator new and friends only in
a Microsoft environment. This may need further fine tuning.
* Don't ever override strdup if it's already macro defined.
* Changed gc_cpp.h yet again to also overload placement new. Due to the
C++ overloading rules, the other overloaded new operations otherwise hide
placement new, which causes many STL uses to break.
* Integrated cygwin pthreads support from Dan Bonachea.
* Turn on DYNAMIC_LOADING for NetBSD.
* Changed printing code to print more complete GC times.
* Applied Mark Mitchell's Irix patch to correct some bitrot.
* Clarified which object-printing routines in dbg_mlc.c should hold
the allocation lock. Restructured the code to allow reasonable object
printing with -DREDIRECT_MALLOC.
* Fix the Linux mmap code to always start with 0x1000 as the initial hint.
Minor patches for 64-bit AIX, particularly to STACKBOTTOM.
* Renamed "SUSPENDED" flag for Solaris threads support to avoid a conflict
with a system header.
* Cause win32_threads.c to handle an out of range stack pointer correctly,
though currently with a warning.
== [6.1alpha4] ==
* Fixed typo in sparc_mach_dep.S, preventing the 64-bit version from
building. Increased 64-bit heap size limit in test.c slightly, since
a functional SPARC collector seems to slightly exceed the old limits.
* Use NPRGREG in solaris_threads.c, thus printing all registers if things
go wrong.
* Added GC_MARKERS environment variable to allow use of a single marker
thread on an MP without confusing the lock implementation.
* Collect much less aggressively in incremental mode with GC_TIME_UNLIMITED.
This is really a purely generational mode, and we can afford to
postpone the collection until the heap is (nearly) full.
* Remove read() wrapper for MPROTECT_VDB. It was causing more harm than
good. It is often no longer needed if system calls avoid writing to
pointerfull heap objects.
* Fix MACOSX test in gcconfig.h.
* Change GC_test_and_set so that it consistently has one argument.
Add spaces to ::: in powerpc assembly code in gc_locks.h.
* Fixed a formatting error in dbg_mlc.c. Added prototype to GC_abort()
declaration.
* Removed "source" argument to GC_find_start(). Eliminate GC_FIND_START().
* Added win32 recognition code in configure.in. Changed some of the
dllimport/export defines in gc.h.
* GC_malloc_many didn't set hb_last_reclaimed when it called
GC_reclaim_generic. (I'm not sure this matters much, but ...)
* Allocating uncollectable objects with debug information sometimes
allocated objects that were one byte too small, since uncollectable
objects don't have the extra byte added at the end.
* Added a bit more assertion checking to make sure that gcj objects
on free lists never have a nonzero second word.
* Replaced BCC_MAKEFILE with an up-to-date one.
* Upgraded libtool, cinfigure.in and some related files to hopefully
support NetBSD/SPARC. Unfortunately,
libtool 1.4.2 seemed to be buggy due to missing quotes in several
"test" invocations. Fixed those in the ltmain.sh script.
* Some win32-specific patches, including the introduction of
GC_CreateThread.
* Merged in gcj changes from Anthony Green to support embedded systems.
* Tried to consistently rename preprocessed assembly files with a capital
.S extension.
* Use alpha_mach_dep.S on ALPHA again. It doesn't really matter, but this
makes our distribution consistent with the gcc one, avoiding future merge
problems.
* Move GET_MEM definition into gcconfig.h. Include gcconfig.h slightly
later in gc_priv.h to avoid forward references to ptr_t.
* Add some testing of local allocation to test.c.
* Change definition of INVALID_QTID in specific.h. The -1 value was used
inconsistently, and too likely to collide with a valid stack address.
Some general clean-up of specific.[ch]. Added assertions.
* On Pthread systems it was not safe to call GC_malloc() between fork()
and exec(). According to the applicable standards, it doesn't appear
to be safe to call malloc() or many other libc functions either, thus
it's not clear this is fixable. Added experimental support for
-DHANDLE_FORK in linux_threads.c which tries to support it. It may
succeed if libc does the right thing. I'm not sure whether it does.
* Documented thread local allocation primitives to require an
explicit GC_init call. GC_init_parallel is no longer declared to
be a constructor function, since that isn't portable and often
seems to lead to initialization order problems.
* Changed gc_cpp.cc and gc_cpp.h in one more attempt to make them
compatible with Visual C++ 6.
* Some more patches for Linux on HP PA-RISC.
* Added include/gc_allocator.h. It implements (hopefully) standard
conforming (as opposed to SGI-style) allocators that allocate
collectable (gc_allocator) or GC-traceable, but not collectable
(traceable_allocator) objects. This borrows heavily from libstc++,
which borrows heavily from the SGI implementation, this part of
which was written by Matt Austern. Changed test_cpp.cc to very
minimally test this.
* On Linux/X86, retry mmap with a different start argument. That should
allow the collector to use more (closer to 3GB) of the address space.
* Force 64 bit alignment with GCJ support.
* Refined the choice of sa_handler vs. sa_sigaction in GC_dirty_init
to accommodate some glibc5 systems.
* Compensated for the fact that current versions of glibc set
__libc_stack_end incorrectly on Linux/IA64 while initialization code
is running. This could cause the collector to miss 16 bytes of
the memory stack if GC_malloc or friends where called before main().
* Mostly integrated Takis Psarogiannakopoulos' port to DG/UX Inix 86.
This will probably take another iteration to work, since his
patch conflicted with the libtool upgrade.
* Added README.arm.cross containing some information about cross-
compiling to an ARM processor from Margaret Fleck.
== [6.1alpha3] ==
* Minor cleanup on the gcconfig.h section for SPARC.
* Minor fix to support Intel compiler for I386/Linux.
* Added SPARC V9 (64-bit) support.
* Restructured the way in which we determine whether or not to keep
call stacks for debug allocation. By default SAVE_CALL_COUNT is
now zero on all platforms. Added SAVE_CALL_NARGS parameters.
If possible, use execinfo.h to capture call stack. (This should
add support for a number of new platforms, though often at
considerable runtime expense.)
* Try to print symbolic information for call stacks. On Linux, we
do this with a combination of execinfo.h and running addr2line in
a separate process. This is both much more expensive and much more
useful. Amazingly, it seems to be fast enough for most purposes.
* Redefined strdup if -DREDIRECT_MALLOC is given.
* Changed incremental collector and MPROTECT_VDB implementation so that,
under favorable conditions, pointer-free objects are not protected.
Added GC_incremental_protection_needs() to determine ahead of time whether
pointer-free objects may be protected. Replaced GC_write_hint() with
GC_remove_protection().
* Added test for GC_ENABLE_INCREMENTAL environment variable.
* Made GC_time_limit runtime configurable. Added GC_PAUSE_TIME_TARGET
environment variable.
* Eliminated GC_page_sz, a duplicate of GC_page_size.
* Caused the Solaris and Irix thread creation primitives to call
GC_init_inner().
== [6.1alpha2] ==
* No longer wrap read by default in multi-threaded applications. It was
pointed out on the libgcj list that this holds the allocation lock for
way too long if the read blocks. For now, reads into the heap are
broken with incremental collection. It's possible to turn this back on
if you make sure that read calls don't block (e.g. by calling select
first).
* Fix ifdef in Solaris_threads.h to refer to GC_SOLARIS_THREADS.
* Added check for environment variable GC_IGNORE_GCJ_INFO.
* Added printing of stop-the-world GC times if GC_PRINT_STATS environment
variable is set.
* The calloc definition in leak_detector.h was missing parentheses, and
realloc was missing a second argument to GC_REALLOC.
* Added GC_PRINT_BACK_HEIGHT environment variable and associated
code, mostly in the new file backgraph.c. See doc/README.environment.
* Added -DUSE_GLOBAL_ALLOC to work around a Windows NT issue.
* Integrated port to NEC EWS4800 (MIPS-based workstation, with somewhat
different address-space layout). This may help for other machines with
holes in the data segment.
* Changed the order in which GC_push_roots and friends push things onto
the mark stack. GC_push_all calls need to come first, since we can't
necessarily recover if those overflow the mark stack.
* Some minor cleanups to mostly support the Intel compiler on Linux/IA64.
== [6.1alpha1] ==
* Non-debug, atomic allocations could result in bogus smashed object
reports with debugging on.
* Fixed GC_get_register_stack_base (Itanium only) to work around a glibc
2.2.4 bug.
* Initial port to HP/UX on Itanium. Thread support and both 32 and 64
bit ABIs appear to work. Parallel mark support doesn't yet, due to
some inline assembly code issues. Thread local allocation does appear
to work.
* ifdef'ed out glibc2.1/Itanium workaround. I suspect nobody is using
that combination anymore.
* Added a patch to make new_gc_alloc.h usable with gcc3.0.
* Debugged 64-bit support on HP/UX PA-RISC.
* Turned on dynamic loading support for FreeBSD/ELF.
* Unregistering of finalizers with debugging allocation was broken.
* Old finalizers were not returned correctly from GC_debug_register_finalizer.
* Disabled MPROTECT_VDB for Linux/M68K based on a report that it doesn't work.
* Cleaned up some statistics gathering code in reclaim.c.
* Added some support for OpenBSD/ELF/Linux.
* Added Jakub Jelinek's patch to use dl_iterate_phdr for dynamic library
traversal to dyn_load.c. Changed it to weakly reference dl_iterate_phdr,
so that the old code is stilll used with old versions of glibc.
* Cleaned up feature test macros for various threads packages and
integrated (partially functional) FreeBSD threads code from Loren Rittle.
It's likely that the cleanup broke something, since it touched lots of
code. It's also likelly that it fixed some unreported bugs in the
less common thread implementations, since some of the original code
didn't stand up to close scrutiny. Support for the next pthreads
implementation should be easier to add.
== [6.0] ==
* Two more bug fixes for KEEP_BACK_PTRS and DBG_HDRS_ALL.
* Fixed a stack clearing problem that resulted in SIGILL with a
misaligned stack pointer for multi-threaded SPARC builds.
* Integrated another HURD patch.
== [6.0alpha9] ==
* added README.macros.
* Made gc.mak a symbolic link to work around winzip's tendency to ignore
hard links.
* Simplified the setting of NEED_FIND_LIMIT in os_dep.c, possibly breaking
it on untested platforms.
* Integrated initial GNU HURD port.
* A few more fixes for Digital Mars compiler (Walter Bright).
* Fixed gcc version recognition. Renamed OPERATOR_NEW_ARRAY to
GC_OPERATOR_NEW_ARRAY. Changed GC_OPERATOR_NEW_ARRAY to be the default.
It can be overridden with -DGC_NO_OPERATOR_NEW_ARRAY.
* Changed the byte size to free-list mapping in thread local allocation
so that size 0 allocations are handled correctly.
* Fixed Linux/MIPS stackbottom for new toolchain.
* Changed finalization registration to invoke GC_oom_fn when it runs out
of memory.
* Removed lvalue cast in finalize.c. This caused some debug configurations
not to build with some non-gcc compilers.
== [6.0alpha8] ==
* Changed GC_debug_malloc_replacement and GC_debug_realloc_replacement
so that they compile under Irix.
* Updated powerpc_macosx_mach_dep.s so that it works if the collector
is in a dynamic library.
* Transformed README.debugging into debugging.html, updating and
expanding it in the process. Added gcdescr.html and tree.html
from the web site to the GC distribution.
* Fixed several problems related to PRINT_BLACK_LIST. This involved
restructuring some of the marker macros.
* Fixed some problems with the sizing of objects with debug information.
Finalization was broken KEEP_BACK_PTRS or PRINT_BLACK_LIST. Reduced the
object size with SHORT_DEBUG_HDRS by another word.
* The "Needed to allocate blacklisted ..." warning had inadvertently
been turned off by default, due to a buggy test in allchblk.c. Turned
it back on.
* Removed the marker macros to deal with 2 pointers in interleaved fashion.
They were messy and the performance improvement seemed minimal. We'll
leave such scheduling issues to the compiler.
* Changed Linux/PowerPC test to also check for __powerpc__ in response
to a discussion on the gcc mailing list.
* Removed the "static" from the jmp_buf
declaration in GC_generic_push_regs. This was causing problems in
systems that register all of their own roots. It looks far more correct
to me without the "static" anyway.
* Fixed several problems with thread local allocation of pointer-free or
typed objects. The collector was reclaiming thread-local free lists, since
it wasn't following the link fields.
* There was apparently a long-standing race condition related to
multi-threaded incremental collection. A collection could be started and
a thread stopped between the memory unprotect system call and the setting of
the corresponding dirt bit. I believe this did not affect Solaris or PCR,
which use a different dirty-bit implementation. Fixed this by installing
signal handlers with sigaction instead of signal, and disabling the thread
suspend signal while in the write-protect handler. (It is unclear
whether this scenario ever actually occurred. I found it while tracking
down the following:)
* Incremental collection did not cooperate correctly with the PARALLEL_MARK
implementation of GC_malloc_many or the local_malloc primitives. It still
doesn't work well, but it shouldn't lose memory anymore.
* Integrated some changes from the gcc source tree that I had previously
missed.
* Added Makefile.direct as a copy of the default Makefile, which would
normally be overwritten if configure is run.
* Changed the gc.tar target in Makefile.direct to embed the version number
in the gc directory name. This will affect future tar file distributions.
* Changed the Irix dynamic library finding code to no longer try to
eliminate writable text segments under Irix6.x, since that is probably no
longer necessary, and can apparently be unsafe on occasion.
* GC_cleanup with GC_DEBUG enabled passed a real object base address to
GC_debug_register_finalizer_ignore_self, which expected a pointer past the
debug header. Call GC_register_finalizer_ignore_self instead, even with
debugging enabled.
* The collector didn't build with call chain saving enabled but NARGS=0.
* Fixed up the GNU-style build files enough so that they work in some
obvious cases.
* Added initial port to Digital Mars compiler for win32.
== [6.0alpha7] ==
* Added GC_finalizer_notifier. Fixed GC_finalize_on_demand. (The variable
actually wasn't being tested at the right points. The build-time flag
was.)
* Added Tom Tromey's S390 Linux patch.
* Added code to push GC_finalize_now in GC_push_finalizer_structures.
* Added GC_push_gc_structures() to push all GC internal roots.
* Integrated some FreeBSD changes from Matthew Flatt.
* It looks like USRSTACK is not always correctly defined under Solaris.
Hacked gcconfig.h to attempt to work around the problem. The result
is not well tested.
* Added Ji-Yong Chung's win32 threads and C++ fixes.
* Arranged for hpux_test_and_clear.s to no longer be needed or built.
It was causing build problems with gas, and it's not clear this is
better than the pthreads alternative on this platform.
* Some MINGW32 fixes from Hubert Garavel.
* Added Initial Hitachi SH4 port from Kaz Kojima.
* Ported thread-local allocation and parallel mark code to HP/UX on PA_RISC.
* Made include/gc_mark.h more public and separated out the really private
pieces. This is probably still not quite sufficient for clients that
want to supply their own kind of type information. But it's a start.
This involved lots of identifier renaming to make it namespace clean.
* Added GC_dont_precollect for clients that need complete control over
the root set.
* GC_is_visible didn't do the right thing with gcj objects. (Not that
many people are likely to care, but ...)
* Don't redefine read with GC_USE_LD_WRAP.
* Initial port to LINUX/HP_PA. Incremental collection and threads are not
yet supported. (Incremental collection should work if you have the
right kernel. Threads may work with a sufficiently patched pthread
library.)
* Changed gcconfig.h to recognize __i386__ as an alternative to i386 in
many places.
* Made win32_threads.c more tolerant of detaching a thread that it didn't
know about.
* Added Makefile.am and configure.in from gcc to the distribution, with
minimal changes. For the moment, those are just placeholders. In the
future, we're planning to switch to a GNU-style build environment for
Un*x-like systems, though the old Makefile will remain as a backup.
* Turned off STUBBORN_ALLOC by default, and added it back as a Makefile
option.
* Redistributed some functions between malloc.c and mallocx.c, so that
simple statically linked apps no longer pull in mallocx.o.
* Changed large object allocation to clear the first and last few words
of each block before releasing the lock. Otherwise the marker could see
objects with nonsensical type descriptors.
* Fixed a couple of subtle problems that could result in not recognizing
interior pointers from the stack. (I believe these were introduced
in 6.0alpha6.)
* GC_debug_free_inner called GC_free, which tried to reacquire the
allocator lock, and hence deadlocked. (DBG_HDRS_ALL probably never worked
with threads.)
* Fixed several problems with back traces. Accidental references to a free
list could cause the free list pointer to be overwritten by a back pointer.
There seemed to be some problems with the encoding of root and finalizer
references.
== [6.0alpha6] ==
* Changed the definition of DATASTART on ALPHA and IA64, where data_start
and __data_start are not defined by earlier versions of glibc. This might
need to be fixed on other platforms as well.
* Changed the way the stack base and backing store base are found on IA64.
This should now remain reliable on future kernels. But since it relies
on /proc, it will no longer work in the simulated NUE environment.
* Made the call to random() in dbg_mlc.c with -DKEEP_BACK_PTRS dependent
on the OS. On non-Unix systems, rand() should be used instead. Handled
small RAND_MAX.
* Fixed the cord make rules to create the cord subdirectory, if necessary.
* Changed fo_object_size calculation in finalize.c. Turned finalization
of non-heap object into a no-op. Removed anachronism from GC_size()
implementation.
* Changed GC_push_dirty call in solaris_threads.c to GC_push_selected.
It was missed in a previous renaming.
* Arranged to not not mask SIGABRT in linux_threads.c.
* Added GC_no_dls hook for applications that want to register their own
roots.
* Integrated Kjetil Matheussen's Amiga changes.
* Added FREEBSD_STACKBOTTOM. Changed the X86/FreeBSD port to use it.
* Added pthread_detach interception for platforms supported by linux_threads.c
and irix_threads.c.
* Changed the USE_MMAP code to check for the case in which we got the
high end of the address space, i.e. mem_ptr + mem_sz == 0. It appears
that this can happen under Solaris 7. It seems to be allowed by what
I would claim is an oversight in the mmap specification.
* Cleanup of linux_threads.c. Some code was originally cloned from
irix_threads.c and now unnecessary. Some comments were obviously wrong.
* (Mostly) fixed a longstanding problem with setting of dirty bits from
a signal handler. In the presence of threads, dirty bits could get lost,
since the etting of a bit in the bit vector was not atomic with respect
to other updates. The fix is 100% correct only for platforms for which
GC_test_and_set is defined. The goal is to make that all platforms with
thread support. Matters only if incremental GC and threads are both
enabled.
* made GC_all_interior_pointers (a.k.a. ALL_INTERIOR_POINTERS) an
initialization time, instead of build-time option. This is a
nontrivial, high risk change. It should slow down the code measurably
only if MERGE_SIZES is not defined, which is a very nonstandard
configuration.
* Added doc/README.environment, and implemented what it describes. This
allows a number of additional configuration options to be set through
the environment. It documents a few previously undocumented options.
* Integrated Eric Benson's leak testing improvements.
* Removed the option to throw away the beginning of each page (DISCARD_WORDS).
This became less and less useful as processors enforce stricter alignment.
And it hadn't been tested in ages, and was thus probably broken anyway.
== [6.0alpha5] ==
* Changed the definition of GC_pause in linux_threads.c to use a volatile
asm. Some versions of gcc apparently optimize away writes to local volatile
variables. This caused poor locking behavior starting at about
4 processors.
* Added GC_start_blocking(), GC_end_blocking() calls and wrapper for sleep
to linux_threads.c.
The first two calls could be used to generally avoid sending GC signals to
blocked threads, avoiding both premature wakeups and unnecessary overhead.
* Fixed a serious bug in thread-local allocation. At thread termination,
GC_free could get called on small integers. Changed the code for thread
termination to more efficiently return left-over free-lists.
* Integrated Kjetil Matheussen's BeOS support.
* Rearranged the directory structure to create the doc and tests
subdirectories.
* Sort of integrated Eric Benson's patch for OSF1. This provided basic
OSF1 thread support by suitably extending hpux_irix_threads.c. Based
on earlier email conversations with David Butenhof, I suspect that it
will be more reliable in the long run to base this on linux_threads.c
instead. Thus I attempted to patch up linux_threads.c based on Eric's code.
The result is almost certainly broken, but hopefully close enough that
someone with access to a machine can pick it up.
* Integrated lots of minor changes from the NetBSD distribution. (These
were supplied by David Brownlee. I'm not sure about the original
authors.)
* Hacked a bit more on the HP/UX thread-support in linux_threads.c. It
now appears to work in the absence of incremental collection. Renamed
hpux_irix_threads.c back to irix_threads.c, and removed the attempt to
support HPUX there.
* Changed gc.h to define _REENTRANT in cases in which it should already
have been defined. It is still safer to also define it on the command
line.
== [6.0alpha4] ==
* Moved up the detection of mostly full blocks to the initiation of the
sweep phase. This eliminates some lock contention in the PARALLEL_MARK case,
as multiple threads try to look at mostly full blocks concurrently.
* Restored the code in GC_malloc_many that grabs a prefix of the global
free list. This avoids the case in which every GC_malloc_many call
tries and fails to allocate a new heap block, and the returns a single
object from the global free list.
* Some minor fixes in new_hblk.c. (Attempted to build free lists in order
of increasing addresses instead of decreasing addresses for cache performance
reasons. But this seems to be only a very minor gain with -DEAGER_SWEEP,
and a loss in other cases. So the change was backed out.)
* Fixed some of the documentation.
* Fixed the Linux USE_PROC_FOR_LIBRARIES code to deal with apps that perform
large numbers of mmaps. Also fixed that code to
deal with short reads.
* Added GC_get_total_bytes().
* Fixed leak detection mode to avoid spurious messages under linuxthreads.
(This should also now be easy for the other supported threads packages.
But the code is tricky enough that I'm hesitant to do it without being able
to test. Everything allocated in the GC thread support itself should be
explicitly deallocated.)
* Made it possible (with luck) to redirect malloc to GC_local_malloc.
== [6.0alpha3] ==
* Fixed the /proc/self/maps code to not seek, since that apparently is not
reliable across all interesting kernels.
* Fixed some compilation problems in the absence of PARALLEL_MARK
(introduced in alpha2).
* Fixed an algorithmic problem with PARALLEL_MARK. If work needs to
be given back to the main mark "stack", the BOTTOM entries of the local
stack should be given away, not the top ones. This has substantial
performance impact, especially for > 2 processors, from what I can tell.
* Extracted gc_lock.h from gc_priv.h. This should eventually make it a
bit easier to avoid including gc_priv.h in clients.
* Moved all include files to include/ and removed duplicate links to the
same file. The old scheme was a bad idea because it was too easy to get the
copies out of sync, and many systems don't support hard links.
Unfortunately, it's likely that I broke some of the non-Unix Makefiles in
the process, although I tried to update them appropriately.
* Removed the partial support for a copied nursery. It's not clear that
this would be a tremendous win, since we don't consistently lose to
generational copying collectors. And it would significantly complicate
many things. May be reintroduced if/when it really turns out to win.
* Removed references to IRIX_JDK_THREADS, since I believe there never
were and never will be any clients.
* Added some code to linux_threads.c to possibly support HPUX threads
using the Linux code. Unfortunately, it doesn't work yet, and is
currently disabled.
* Added support under Linux/X86 for saving the call chain, both in (debug)
objects for client debugging, and in GC_arrays._last_stack for GC
debugging. This was previously supported only under Solaris. It is
not enabled by default under X86, since it requires that code be compiled
to explicitly gave frame pointers on the call stack. (With gcc this
currently happens by default, but is often turned off explicitly.)
To turn it on, define SAVE_CALL_CHAIN.
== [6.0alpha2] ==
* Added USE_MARK_BYTES to reduce the need for compare-and-swap on platforms
for which that's expensive.
* Fixed a locking bug ib GC_gcj_malloc and some locking assertion problems.
* Added a missing volatile to OR_WORD and renamed the parameter to
GC_compare_and_swap so it's not a C++ reserved word.
* Changed Linux dynamic library registration code to look at /proc/self/maps
instead of the rld data structures when REDIRECT_MALLOC is defined.
Otherwise some of the rld data data structures may be prematurely garbage
collected.
* Fixed USE_LD_WRAP a bit more, so it should now work without threads.
* Renamed XXX_THREADS macros to GC_XXX_THREADS for namespace correctness.
Temporarily added some backward compatibility definitions. Renamed
USE_LD_WRAP to GC_USE_LD_WRAP.
* Many MACOSX POWERPC changes, some additions to the gctest output, and
a few minor generic bug fixes.
== [6.0alpha1] ==
* Added HP/PA prefetch support.
* Added -DDBG_HDRS_ALL and -DSHORT_DBG_HDRS to reduce the cost and improve
the reliability of generating pointer backtrace information, e.g. in
the Bigloo environment.
* Added parallel marking support (-DPARALLEL_MARK). This currently
works only under IA32 and IA64 Linux, but it shouldn't be hard to adapt
to other platforms. This is intended to be a lighter-weight (less
new code, probably not as scalable) solution than the work by Toshio Endo
et al, at the University of Tokyo. A number of their ideas were
reused, though the code wasn't, and the underlying data structure
is significantly different. In particular, we keep the global mark
stack as a single shared data structure, but most of the work is done
on smaller thread-local mark stacks.
* Changed GC_malloc_many to be cheaper, and to require less mutual exclusion
with -DPARALLEL_MARK.
* Added full support for thread local allocation under Linux
(-DTHREAD_LOCAL_ALLOC). This is a thin veneer on GC_malloc_many, and
should be easily portable to other platforms, especially those that
support pthreads.
* CLEAR_DOUBLE was not always getting invoked when it should have been.
* GC_gcj_malloc and friends used different out of memory handling than
everything else, probably because I forgot about one when I implemented
the other. They now both call GC_oom_fn(), not GC_oom_action().
* Integrated Jakub Jelinek's fixes for Linux/SPARC.
* Moved GC_objfreelist, GC_aobjfreelist, and GC_words_allocd out of
GC_arrays, and separately registered the first two as excluded roots.
This makes code compiled with gc_inl.h less dependent on the
collector version. (It would be nice to remove the inclusion of
gc_priv.h by gc_inl.h completely, but we're not there yet. The
locking definitions in gc_priv.h are still referenced.)
This change was later conditioned on SEPARATE_GLOBALS, which
is not defined by default, since it involves a performance hit.
* Register GC_obj_kinds separately as an excluded root region. The
attempt to register it with GC_arrays was usually failing. (This wasn't
serious, but seemed to generate some confusion.)
* Moved backptr.h to gc_backptr.h.
== [5.4] ==
* Fixed a typo that prevented compilation with -DUSE_3DNOW_PREFETCH.
* Fixed GC_is_thread_stack in solaris_threads.c. It forgot to return a value
in the common case.
* Fixed another silly syntax problem in GC_double_descr.
* Fixed a GC_gcj_malloc bug: It tended to release the allocator lock twice.
== [5.3] ==
* Fixed _end declaration for OSF1.
* There were lots of spurious leak reports in leak detection mode, caused
by the fact that some pages were not being swept, and hence unmarked
objects weren't making it onto free lists. (This bug dated back to 5.0.)
* Fixed a typo in the liblinuxgc.so Makefile rule.
* Added the GetExitCodeThread to Win32 GC_stop_world to (mostly) work
around a Windows 95 GetOpenFileName problem.
== [5.2] ==
* dyn_load.c declared GC_scratch_last_end_ptr as an extern even if it
was defined as a macro. This prevented the collector from building on
Irix.
* We quietly assumed that indirect mark descriptors were never 0.
Our own typed allocation interface violated that. This could result
in segmentation faults in the marker with typed allocation.
* Fixed a _DUSE_MUNMAP bug in the heap block allocation code.
* Taught the collector about VC++ handling array operator new.
* The two copies of gc_hdrs.h had diverged. Made one a link to the other
again.
== [5.1] ==
* Fixed a gc.h header bug which showed up under Irix.
* Fixed a typo in GC_double_descr in typd_mlc.c.
This probably could result in objects described by array descriptors not
getting traced correctly.
* The block nearly full tests in reclaim.c were not correct for 64 bit
environments. This could result in unnecessary heap growth under unlikely
conditions.
== [5.0] ==
* Fixed threadlibs.c for linux threads. -DUSE_LD_WRAP was broken and
-ldl was omitted. Fixed Linux stack finding code to handle
-DUSE_LD_WRAP correctly.
* Added MSWIN32 exception handler around marker, so that the collector
can recover from root segments that are unmapped during the collection.
This caused occasional failures under Windows 98, and may also be
an issue under Windows NT/2000.
== [5.0alpha7] ==
* -DREDIRECT_MALLOC was broken in alpha6. Fixed.
* Cleaned up gc_ccp.h slightly, thus also causing the HP C++ compiler to
accept it.
* Removed accidental reference to dbg_mlc.c, which caused dbg_mlc.o to be
linked into every executable.
* Added PREFETCH to bitmap marker. Changed it to use the header cache.
* GC_push_marked sometimes pushed one object too many, resulting in a
segmentation fault in GC_mark_from_mark_stack. This was probably an old
bug. It finally showed up in gctest on win32.
* Gc_priv.h erroneously #defined GC_incremental to be TRUE instead of FALSE
when SMALL_CONFIG was defined. This was no doubt a major performance bug for
the default win32 configuration.
* Removed -DSMALL_CONFIG from NT_MAKEFILE. It seemed like an anachronism now
that the average PC has 64MB or so.
* Integrated Bryce McKinley's patches for linux threads and dynamic loading
from the libgcj tree. Turned on dynamic loading support for Linux/PPC.
* Changed the stack finding code to use environ on HP/UX. This should
probably be done on other platforms, too. Since I can't test those, that'll
wait until after 5.0.
== [5.0alpha6] ==
* GC_malloc_explicitly_typed and friends sometimes failed to
initialize first word.
* Added allocation routines and support in the marker for mark descriptors
in a type structure referenced by the first word of an object. This was
introduced to support gcj, but hopefully in a way that makes it
generically useful.
* Added GC_requested_heapsize, and inhibited collections in non-incremental
mode if the actual used heap size is less than what was explicitly
requested.
* The Solaris pthreads version of GC_pthread_create didn't handle a NULL
attribute pointer. Solaris thread support used the wrong default thread
stack size.
* Changed PUSH_CONTENTS macro to no longer modify first parameter.
This usually doesn't matter, but it was certainly an accident waiting
to happen ...
* Added GC_register_finalizer_no_order and friends to gc.h. They're
needed by Java implementations.
* Integrated a fix for a win32 deadlock resulting from clock() calling
malloc.
* Integrated Hiroshi Kawashima's port to Linux/MIPS. This was designed
for a handheld platform, and may or may not be sufficient for other
machines.
* Fixed a va_arg problem with the %c specifier in cordprnt.c. It appears
that this was always broken, but recent versions of gcc are the first to
report the (statically detectable) bug.
* Added an attempt at a more general solution to dlopen races/deadlocks.
GC_dlopen now temporarily disables collection. Still not ideal, but ...
* Added -DUSE_I686_PREFETCH, -DUSE_3DNOW_PREFETCH, and support for IA64
prefetch instructions. May improve performance measurably, but I'm not
sure the code will run correctly on processors that don't support the
instruction. Won't build except with very recent gcc.
* Added caching for header lookups in the marker. This seems to result
in a barely measurable performance gain. Added support for interleaved
lookups of two pointers, but unconfigured that since the performance
gain is currently near zero, and it adds to code size.
* Changed Linux DATA_START definition to check both data_start and
__data_start, since nothing else seems to be portable.
* Added -DUSE_LD_WRAP to optionally take advantage of the GNU ld function
wrapping mechanism. Probably currently useful only on Linux.
* Moved some variables for the scratch allocator into GC_arrays.
* Fixed a win32 threads bug that caused the collector to not look for
interior pointers from one of the thread stacks without
ALL_INTERIOR_POINTERS.
* Added Mingw32 support.
* Changed the alpha port to use the generic register scanning code instead
of alpha_mach_dep.s. Alpha_mach_dep.s doesn't look for pointers in fp
registers, but gcc sometimes spills pointers there. Changed the IA64 code to
do something similar for similar reasons.
== [5.0alpha4] ==
* Added protection fault handling patch for Linux/M68K from Fergus
Henderson and Roman Hodek.
* Removed the tests for SGI_SOURCE in new_gc_alloc.h. This was causing that
interface to fail on nonSGI platforms.
* Changed the Linux stack finding code to use /proc, after changing it
to use HEURISTIC1.
* Added HP/UX incremental GC support and HP/UX 11 thread support.
Thread support is currently still flakey.
* Added basic Linux/IA64 support.
* Integrated Anthony Green's PicoJava support.
* Integrated Scott Ananian's StrongARM/NetBSD support.
* Fixed some fairly serious performance bugs in the incremental
collector. These have probably been there essentially forever.
(Mark bits were sometimes set before scanning dirty pages.
The reclaim phase unnecessarily dirtied full small object pages.)
* Changed the reclaim phase to ignore nearly full pages to avoid
touching them.
* Limited GC_black_list_spacing to roughly the heap growth increment.
* Changed full collection triggering heuristic to decrease full GC
frequency by default, but to explicitly trigger full GCs during
heap growth. This doesn't always improve things, but on average it's
probably a win.
* GC_debug_free(0, ...) failed.
== [5.0alpha3] ==
* Added some highly incomplete code to support a copied young generation.
Comments on nursery.h are appreciated.
* Changed -DFIND_LEAK, -DJAVA_FINALIZATION, and -DFINALIZE_ON_DEMAND,
so the same effect could be obtained with a runtime switch. This is
a step towards standardizing on a single dynamic GC library.
* Significantly changed the way leak detection is handled, as a consequence
of the above.
== [5.0alpha2] ==
* Fixed bugs introduced in alpha1 (OpenBSD & large block initialization).
* Added -DKEEP_BACK_PTRS and backptr.h interface. (The implementation
idea came from Al Demers.)
== [5.0alpha1] ==
* Reworked large block allocator. Now uses multiple doubly linked free
lists to approximate best fit.
* Changed heap expansion heuristic. Entirely free blocks are no longer
counted towards the heap size. This seems to have a major impact on
heap size stability; the old version could expand the heap way too
much in the presence of large block fragmentation.
* added -DGC_ASSERTIONS and some simple assertions inside the collector.
This is mainlyt for collector debugging.
* added -DUSE_MUNMAP to allow the heap to shrink. Supported on only
a few UNIX-like platforms for now.
* added GC_dump_regions() for debugging of fragmentation issues.
* Changed PowerPC pointer alignment under Linux to 4.
* Changed the Linux/Alpha port to walk the data segment backwards until
it encounters a SIGSEGV. The old way to find the start of the data
segment broke with a recent release.
* cordxtra.c needed to call GC_REGISTER_FINALIZER instead of
GC_register_finalizer, so that it would continue to work with GC_DEBUG.
* allochblk sometimes cleared the wrong block for debugging purposes
when it dropped blacklisted blocks. This could result in spurious
error reports with GC_DEBUG.
* added MACOS X Server support.
* Changed the Solaris threads code to ignore stack limits > 8 MB with
a warning. Empirically, it is not safe to access arbitrary pages
in such large stacks. And the dirty bit implementation does not
guarantee that none of them will be accessed.
* Integrated Martin Tauchmann's Amiga changes.
* Integrated James Dominy's OpenBSD/SPARC port.
== [4.14] ==
* changed STACKBOTTOM for DJGPP.
== [4.14alpha2] ==
* -DSMALL_CONFIG did not work reliably with large (> 4K) pages.
Recycling the mark stack during expansion could result in a size
zero heap segment, which confused things. (This was probably also an
issue with the normal config and huge pages.)
* Did more work to make sure that callee-save registers were scanned
completely, even with the setjmp-based code. Added USE_GENERIC_PUSH_REGS
macro to facilitate testing on machines I have access to.
* Added code to explicitly push register contents for win32 threads.
This seems to be necessary.
== [4.14alpha1] ==
* Fixed GC_print_source_ptr to not use a prototype.
* generalized CYGWIN test.
* gc::new did the wrong thing with PointerFreeGC placement.
* In the ALL_INTERIOR_POINTERS (default) case, some callee-save register
values could fail to be scanned if the register was saved and
reused in a GC frame. This showed up in verbose mode with gctest
compiled with an unreleased SGI compiler. I vaguely recall an old
bug report that may have been related. The bug was probably quite old.
(The problem was that the stack scanning could be deferred until
after the relevant frame was overwritten, and the new save location
might be outside the scanned area. Fixed by more eager stack scanning.)
* PRINT_BLACK_LIST had some problems. A few source addresses were garbage.
* Replaced Makefile.dj and added -I flags to cord make targets.
* GC_try_to_collect was broken with the non-incremental collector.
* gc_cleanup destructors could pass the wrong address to
GC_register_finalizer_ignore_self in the presence of multiple
inheritance.
* Changed PowerPC Linux stack finding code.
== [4.13] ==
* Fixed a crucial bug in the Watcom port. There was a redundant declaration
of GC_push_one in gc_priv.h.
* Added FINALIZE_ON_DEMAND.
* Fixed some pre-ANSI cc problems in test.c.
* Removed getpagesize() use for Solaris. It seems to be missing in one
or two versions.
* Fixed bool handling for SPARCCompiler version 4.2.
* Fixed some files in include that had gotten unlinked from the main
copy.
* Some RS/6000 fixes (missing casts).
* Fixed several problems in GC_debug_realloc, affecting mostly the
FIND_LEAK case.
* GC_exclude_static_roots contained a buggy unsigned comparison to
terminate a loop.
* CORD_str failed if the substring occurred at the last possible position.
(Only affects cord users.)
* Fixed Linux code to deal with RedHat 5.0 and integrated Peter Bigot's
os_dep.c code for dealing with various Linux versions.
* Added workaround for Irix pthreads sigaction bug and possible signal
misdirection problems.
Since alpha1:
* Changed RS6000 STACKBOTTOM.
* Integrated Patrick Beard's Mac changes.
* Alpha1 didn't compile on Irix m.n, m < 6.
* Replaced Makefile.dj with a new one from Gary Leavens.
* Added Andrew Stitcher's changes to support SCO OpenServer.
* Added PRINT_BLACK_LIST, to allow debugging of high densities of false
pointers.
* Added code to debug allocator to keep track of return address
in GC_malloc caller, thus giving a bit more context.
* Changed default behavior of large block allocator to more
aggressively avoid fragmentation. This is likely to slow down the
collector when it succeeds at reducing space cost.
* Integrated Fergus Henderson's CYGWIN32 changes. They are untested,
but needed for newer versions.
* USE_MMAP had some serious bugs. This caused the collector to fail
consistently on Solaris with -DSMALL_CONFIG.
* Added Linux threads support.
* Fixed more Linux threads problems.
* Changed default GC_free_space_divisor to 3 with new large block allocation.
* More CYGWIN32 fixes.
* Integrated Tyson-Dowd's Linux-M68K port.
* Minor HP PA and DEC UNIX fixes from Fergus Henderson.
* Integrated Christoffe Raffali's Linux-SPARC changes.
* Allowed for one more GC fixup iteration after a full GC in incremental
mode. Some quick measurements suggested that this significantly
reduces pause times even with smaller GC_RATE values.
* Moved some more GC data structures into GC_arrays. This decreases
pause times and GC overhead, but makes debugging slightly less convenient.
* Fixed namespace pollution problem ("excl_table").
* Made GC_incremental a constant for -DSMALL_CONFIG, hopefully shrinking
that slightly.
* Added some win32 threads fixes.
* Integrated Ivan Demakov and David Stes' Watcom fixes.
* Various other minor fixes contributed by many people.
* Renamed config.h to gcconfig.h, since config.h tends to be used for
many other things.
* Integrated Matthew Flatt's support for 68K MacOS "far globals".
* Fixed up some of the dynamic library Makefile targets for consistency
across platforms.
* Fixed a USE_MMAP typo that caused out-of-memory handling to fail
on Solaris.
* Added code to test.c to test thread creation a bit more.
* Integrated GC_win32_free_heap.
* Fixed Solaris 2.7 stack base finding problem. (This may actually
have been done in an earlier alpha release.)
Since alpha3:
* Fixed MSWIN32 recognition test, which interfered with cygwin.
* Removed unnecessary gc_watcom.asm from distribution. Removed
some obsolete README.win32 text.
* Added Alpha Linux incremental GC support.
Changed Linux signal handler context argument to be a pointer.
* Took care of some new warnings generated by the 7.3 SGI compiler.
* Integrated Phillip Musumeci's FreeBSD/ELF fixes.
* -DIRIX_THREADS was broken with the -o32 ABI (typo in gc_priv.h>
== [4.12] ==
* Fixed ElfW definition in dyn_load.c.
This prevented the dynamic library support from compiling on some
older ELF Linux systems.
* Fixed UTS4 port (which I apparently mangled during the integration)
* "Make C++" failed on Suns with SC4.0, due to a problem with "bool".
Fixed in gc_priv.h.
* Added more pieces for GNU win32.
The current state of things should suffice for at least some
applications.
* Changed the out of memory retry count handling. (This matters only
if GC_max_retries > 0, which is no longer the default.)
* If a /proc read failed repeatedly, GC_written_pages was not updated
correctly.
* Under unlikely circumstances, the allocator could infinite loop in
an out of memory situation.
* Fixed a syntactic error in the DJGPP code. Also fixed a test program
problem with DJGPP.
* Atomic uncollectable objects were not treated correctly by the
incremental collector. This resulted in weird log statistics and
occasional performance problems.
* Fixed some problems resulting from compilers that don't define
__STDC__. In this case void * and char * were used inconsistently
in some cases. (Void * should not have been used at all. If
you have an ANSI superset compiler that does not define __STDC__,
please compile with -D__STDC__=0.)
* Fixed a compilation problem on Irix with -n32 and -DIRIX_THREADS.
Also fixed some other IRIX_THREADS problems which may or may not have
had observable symptoms.
* Fixed an HP PA compilation problem in dyn_load.c.
* SEGV fault handlers sometimes did not get reset correctly.
* Added a fix for SOLARIS_THREADS on Intel.
This probably needs more work to become functional.
* Fixed struct sigcontext_struct in os_dep.c for compilation under
Linux 2.1.X.
* Changed the DJGPP STACKBOTTOM and DATASTART values to those ones suggested.
These may still not be right, but it is
it is likely to work more often than what was there before. They may
even be exactly right.
* Added a #include <string.h> to test_cpp.cc. This appears to help
with HP/UX and gcc.
* Version 4.11 failed to run in incremental mode on recent 64-bit Irix
kernels. This was a problem related to page unaligned heap segments.
Changed the code to page align heap sections on all platforms.
(I had mistakenly identified this as a kernel problem earlier.
It was not.)
* Version 4.11 did not make allocated storage executable, except on
one or two platforms, due to a bug in a #if test.
* Added sparc_sunos4_mach_dep.s to support Sun's compilers under SunOS4.
* Added GC_exclude_static_roots.
* Fixed the object size mapping algorithm. This shouldn't matter,
but the old code was ugly.
* Heap checking code could die if one of the allocated objects was
larger than its base address. (Unsigned underflow problem.)
* Added RS6000 (AIX) dynamic library support and fixed STACK_BOTTOM.
* Added Fergus Henderson's patches for improved robustness with large
heaps and lots of blacklisting.
* Added Peter Chubb's changes to support Solaris Pthreads, to support
MMAP allocation in Solaris, to allow Solaris to find dynamic libraries
through /proc, to add malloc_typed_ignore_off_page, and a few other
minor features and bug fixes.
* The Solaris 2 port should not use sbrk. I received confirmation from
Sun that the use of sbrk and malloc in the same program is not
supported. The collector now defines USE_MMAP by default on Solaris.
* Replaced the djgpp makefile with Gary Leavens' version.
* Fixed MSWIN32 detection test.
* Added Fergus Henderson's patches to allow putting the collector into
a DLL under GNU win32.
* Added Ivan V. Demakov's port to Watcom C on X86.
* Added Ian Piumarta's Linux/PowerPC port.
* Added PointerFreeGC to the placement
options in gc_cpp.h. This is of course unsafe, and may be controversial.
On the other hand, it seems to be needed often enough that it's worth
adding as a standard facility.
== [4.11] ==
* Rationalized (hopefully) GC_try_to_collect in an incremental collection
environment. It appeared to not handle a call while a collection was in
progress, and was otherwise too conservative.
* Merged GC_reclaim_or_delete_all into GC_reclaim_all to get rid of some
code.
* Added Patrick Beard's Mac fixes, with substantial completely untested
modifications.
* Fixed the MPROTECT_VDB code to deal with large pages and imprecise
fault addresses (as on an UltraSPARC running Solaris 2.5). Note that this
was not a problem in the default configuration, which uses PROC_VDB.
* The DEC Alpha assembly code needed to restore $gp between calls.
* The write command for "de" was completely broken for large files.
I used the easiest portable fix, which involved changing the semantics
so that f.new is written instead of overwriting f. That's safer anyway.
* Added README.solaris2 with a discussion of the possible problems of
mixing the collector's sbrk allocation with malloc/realloc.
* Changed the data segment starting address for SGI machines. The
old code failed under IRIX6.
* Required double word alignment for MIPS.
* Various minor fixes to remove warnings.
* Attempted to fix some Solaris threads problems.
In particular, the collector could try to fork a thread with the
world stopped as part of GC_thr_init. It also failed to deal with
the case in which the original thread terminated before the whole
process did.
* Added -DNO_EXECUTE_PERMISSION. This has a major performance impact
on the incremental collector under Irix, and perhaps under other
operating systems.
* Added some code to support allocating the heap with mmap. This may
be preferable under some circumstances.
* Integrated dynamic library support for HP.
* Integrated James Clark's win32 threads support, and made a number
of changes to it. This is still not 100% solid.
* Integrated Alistair Crooks' support for UTS4 running on an Amdahl
370-class machine.
* Fixed a serious bug in explicitly typed allocation. Objects requiring
large descriptors where handled in a way that usually resulted in
a segmentation fault in the marker.
* Added partial support for GNU win32 development.
* Added optional support for Java-style finalization semantics.
This is recommended only for Java implementations.
* GC_malloc_uncollectable faulted instead of returning 0 when out of
memory.
* Calls to GC_base before the collector was initialized failed on a
DEC Alpha.
* Added base pointer checking to GC_REGISTER_FINALIZER in debugging mode.
* GC_debug_realloc failed for uncollectable objects.
* Explicitly typed allocation could crash if it ran out of memory.
* Added minimal support for a DEC Alpha running Linux.
* Fixed a problem with allocation of objects whose size overflowed
ptrdiff_t. (This now fails unconditionally, as it should.)
* Added the beginning of Irix pthread support.
* Integrated Xiaokun Zhu's fixes for djgpp 2.01.
* Added SGI-style STL allocator support (gc_alloc.h).
* Fixed a serious bug in README.solaris2.
Multi-threaded programs must include
gc.h with SOLARIS_THREADS defined.
* Changed GC_free so it actually deallocates uncollectable objects.
* Added Linux ELF support for dynamic libraries.
* Changed the Borland cc configuration so that the assembler is not
required.
* Fixed a bug in the C++ test that caused it to fail in 64-bit
environments.
== [4.10] ==
* Fixed a typo around a call to GC_collect_or_expand in alloc.c. It broke
handling of out of memory.
== [4.9] ==
* More README.debugging fixes.
* Objects ready for finalization, but not finalized in the same GC
cycle, could be prematurely collected. This occasionally happened
in test_cpp.
* Too little memory was obtained from the system for very large
objects. That could cause a heap explosion if these objects were
not contiguous (e.g. under PCR), and too much of them was blacklisted.
* Due to an improper initialization, the collector was too hesitant to
allocate blacklisted objects immediately after system startup.
* Moved GC_arrays from the data into the bss segment by not explicitly
initializing it to zero. This significantly
reduces the size of executables, and probably avoids some disk accesses
on program startup. It's conceivable that it might break a port that I
didn't test.
* Fixed EMX_MAKEFILE to reflect the gc_c++.h to gc_cpp.h renaming which
occurred a while ago.
== [4.8] ==
* Changed a "comment" in a MacOS specific part of mach_dep.c that caused
gcc to fail on other platforms.
== [4.7] ==
* Fixed some compilation problems with -DCHECKSUMS.
* Updated some Mac specific files.
* Fixed a serious bug for machines with non-word-aligned pointers.
== [4.6] ==
* Added Linux ELF support.
* GC_base crashed if it was called before any other GC_ routines.
This could happen if a gc_cleanup object was allocated outside the heap
before any heap allocation.
* The heap expansion heuristic was not stable if all objects had finalization
enabled. Fixed finalize.c to count memory in finalization queue and
avoid explicit deallocation. Changed alloc.c to also consider this count.
(This is still not recommended. It's expensive if nothing else.)
* GC_malloc_uncollectable(0) was broken.
* The collector didn't compile under Linux 1.3.X.
The current workaround is ugly, but expected to be temporary.
* Fixed a formatting problem for SPARC stack traces.
* Fixed some '=='s in os_dep.c that should have been assignments.
Fortunately these were in code that should never be executed anyway.
* Fixed the heap block allocator to only drop blacklisted blocks in small
chunks. Made BL_LIMIT self adjusting. (Both of these were in response
to heap growth observed by Paul Graham.)
* Fixed the Metrowerks/68K Mac code to also mark from a6.
* Significantly updated README.debugging.
* Fixed some problems with longjmps out of signal handlers, especially under
Solaris. Added a workaround for the fact that siglongjmp doesn't appear to
do the right thing with -lthread under Solaris.
* Added MSDOS/djgpp port.
* Added "make reserved_namespace" and "make user_namespace". The
first renames ALL "GC_xxx" identifiers as "_GC_xxx". The second is the
inverse transformation. Note that doing this is guaranteed to break all
clients written for the other names.
* descriptor field for kind NORMAL in GC_obj_kinds with ADD_BYTE_AT_END
defined should be -ALIGNMENT not WORDS_TO_BYTES(-1). This is
a serious bug on machines with pointer alignment of less than a word.
* GC_ignore_self_finalize_mark_proc didn't handle pointers to very near the
end of the object correctly. Caused failures of the C++ test on a DEC Alpha
with g++.
* gc_inl.h still had problems. Partially fixed. Added warnings at the
beginning to hopefully specify the remaining dangers.
* Added DATAEND definition to config.h.
* Fixed some of the .h file organization. Fixed "make floppy".
== [4.5] ==
* Fixed many minor and one major README bugs.
* Fixed ALPHA/OSF/1 dynamic library support.
* Added incremental GC support (MPROTECT_VDB) for Linux (with some
help from Bruno Haible).
* Altered SPARC recognition tests in gc.h and config.h.
* Added basic incremental GC support for win32, as implemented by
Windows NT and Windows 95. GC_enable_incremental is a no-op
under win32s, which doesn't implement enough of the VM interface.
* Added -DLARGE_CONFIG.
* Fixed GC_..._ignore_off_page to also function without
-DALL_INTERIOR_POINTERS.
* (Hopefully) fixed RS/6000 port. (Only the test was broken.)
* Fixed a performance bug in the non-incremental collector running
on machines supporting incremental collection with MPROTECT_VDB
(e.g. SunOS 4, DEC AXP). This turned into a correctness bug under
win32s with win32 incremental collection. (Not all memory protection
was disabled.)
* Fixed some ppcr related bit rot.
* Caused dynamic libraries to be unregistered before re-registering.
The old way turned out to be a performance bug on some machines.
* GC_root_size was not properly maintained under MSWIN32.
* Added -DNO_DEBUGGING and GC_dump.
* Fixed a couple of bugs arising with SOLARIS_THREADS +
REDIRECT_MALLOC.
* Added NetBSD/M68K port.
* Fixed a serious realloc bug. For certain object sizes, the collector
wouldn't scan the expanded part of the object.
== [4.4] ==
* ASM_CLEAR_CODE was erroneously defined for HP
PA machines, resulting in a compile error.
* Fixed OS/2 Makefile to create a library.
* Gc_cleanup objects didn't work if they were created on
the stack. Fixed.
* One copy of Gc_cpp.h in the distribution was out of
synch, and failed to document some known compiler
problems with explicit destructor invocation. Partially
fixed. There are probably other compilers on which
gc_cleanup is miscompiled.
* Fixed Makefile to pass C compiler flags to C++ compiler.
* Added Mac fixes.
* Fixed os_dep.c to work around what appears to be
a new and different VirtualQuery bug under newer
versions of win32S.
* GC_non_gc_bytes was not correctly maintained by
GC_free. Fixed.
* Added GC_set_max_heap_size.
* Changed allocation code to ignore blacklisting if it is preventing
use of a very large block of memory. This has the advantage
that naive code allocating very large objects is much more
likely to work. The downside is you might no
longer find out that such code should really use
GC_malloc_ignore_off_page.
* Changed GC_printf under win32 to close and reopen the file
between calls. FAT file systems otherwise make the log file
useless for debugging.
* Added GC_try_to_collect and GC_get_bytes_since_gc. These
allow starting an abortable collection during idle times.
This facility does not require special OS support.
* Added some support for the Borland development environment.
* Removed a misfeature from checksums.c that caused unexpected
heap growth.
* Changed finalize.c to call WARN if it encounters a finalization cycle.
WARN is defined in gc_priv.h to write a message, usually to stdout.
In many environments, this may be inappropriate.
* Renamed NO_PARAMS in gc.h to GC_NO_PARAMS, thus adhering to my own
naming convention.
* Added GC_set_warn_proc to intercept warnings.
* Fixed Amiga port.
* Fixed a bug in mark.c that could result in an access to unmapped
memory from GC_mark_from_mark_stack on machines with unaligned
pointers.
* Fixed a win32 specific performance bug that could result in scanning of
objects allocated with the system malloc.
* Added REDIRECT_MALLOC.
== [4.3] ==
* Fixed SPARC alignment problem with GC_DEBUG.
* Fixed Solaris threads /proc workaround. The real
problem was an interaction with mprotect.
* Incorporated fix from Patrick Beard for gc_c++.h (now gc_cpp.h).
* Slightly improved allocator space utilization by
fixing the GC_size_map mechanism.
* Integrated some Sony News and MIPS RISCos 4.51
patches.
* Fixed HP_PA alignment problem.
* Added GC_same_obj and friends. Changed GC_base
to return 0 for pointers past the end of large objects.
Improved GC_base performance with ALL_INTERIOR_POINTERS
on machines with a slow integer mod operation.
Added GC_PTR_ADD, GC_PTR_STORE, etc. to prepare
for preprocessor.
* changed the default on most UNIX machines to be that
signals are not disabled during critical GC operations.
This is still ANSI-conforming, though somewhat dangerous
in the presence of signal handlers. But the performance
cost of the alternative is sometimes problematic.
Can be changed back with a minor Makefile edit.
* renamed IS_STRING in gc.h, to CORD_IS_STRING, thus
following my own naming convention. Added the function
CORD_to_const_char_star.
* Fixed a gross bug in GC_finalize. Symptom: occasional
address faults in that function.
* Added port to ICL DRS6000 running DRS/NX. Restructured
things a bit to factor out common code, and remove obsolete
code. Collector should now run under SUNOS5 with either
mprotect or /proc dirty bits.
* More bug fixes and workarounds for Solaris 2.X. (These were
mostly related to putting the collector in a dynamic library,
which didn't really work before. Also SOLARIS_THREADS
didn't interact well with dl_open.)
* Fixed a serious performance bug on the DEC Alpha. The text
segment was getting registered as part of the root set.
(Amazingly, the result was still fast enough that the bug
was not conspicuous.) The fix works on OSF/1, version 1.3.
Hopefully it also works on other versions of OSF/1 ...
* Fixed a bug in GC_clear_roots.
* Fixed a bug in GC_generic_malloc_words_small that broke
gc_inl.h.
* Fixed some problems with cord/de under Linux.
* Fixed some cord problems, notably with CORD_riter4.
* Added DG/UX port.
* Added finalization registration routines with weaker ordering
constraints. (This is necessary for C++ finalization with
multiple inheritance, since the compiler often adds self-cycles.)
* Filled the holes in the SCO port.
* John Ellis' additions to the C++ support: From John:
* I completely rewrote the documentation in the interface gc_c++.h
(later renamed gc_cpp.h). I've tried to make it both clearer and more
precise.
* The definition of accessibility now ignores pointers from an
finalizable object (an object with a clean-up function) to itself.
This allows objects with virtual base classes to be finalizable by the
collector. Compilers typically implement virtual base classes using
pointers from an object to itself, which under the old definition of
accessibility prevented objects with virtual base classes from ever
being collected or finalized.
* gc_cleanup now includes gc as a virtual base. This was enabled by
the change in the definition of accessibility.
* I added support for operator new[]. Since most compilers
don't yet support operator new[], it is conditionalized on
-DOPERATOR_NEW_ARRAY. The code is untested, but its trivial and looks
correct.
* The test program test_gc_c++ (later renamed test_cpp.cc)
tries to test for the C++-specific functionality not tested by the
other programs.
* Added unistd.h include to misc.c. (Needed for ppcr.)
* Added PowerMac port.
* Fixed "srcdir"-related Makefile problems. Changed things so
that all externally visible include files always appear in the
include subdirectory of the source. Made gc.h directly
includable from C++ code.
* Changed Intel code to also mark from ebp
* Renamed C++ related files so they could live in a FAT
file system.
* Changed Windows NT Makefile to include C++ support in
gc.lib. Added C++ test as Makefile target.
== [4.2] ==
* Multiple bug fixes/workarounds in the Solaris threads version.
(It occasionally failed to locate some register contents for
marking. It also turns out that thr_suspend and friends are
unreliable in Solaris 2.3. Dirty bit reads appear
to be unreliable under some weird
circumstances. My stack marking code
contained a serious performance bug. The new code is
extremely defensive, and has not failed in several CPU
hours of testing. But no guarantees ...)
* Added MacOS support.
* Fixed several syntactic bugs in gc_c++.h and friends. (These
didn't bother g++, but did bother most other compilers.)
Fixed gc_c++.h finalization interface.
* 64 bit alignment for allocated objects was not guaranteed in a
few cases in which it should have been.
* Added GC_malloc_atomic_ignore_off_page.
* Added GC_collect_a_little.
* Added some prototypes to gc.h.
* Some other minor bug fixes (notably in Makefile).
* Fixed OS/2 / EMX port.
* Fixed AmigaDOS port.
* Fixed the DATASTART definition under Solaris. There
was a 1 in 16K chance of the collector missing the first
64K of static data (and thus crashing).
* Fixed some blatant anachronisms in the README file.
* Fixed PCR-Makefile for upcoming PPCR release.
== [4.1] ==
* Changed finalization implementation to guarantee that
finalization procedures are called outside of the allocation
lock, making direct use of the interface a little less dangerous.
MAY BREAK EXISTING CLIENTS that assume finalizers
are protected by a lock. Since there seem to be few multi-threaded
clients that use finalization, this is hopefully not much of
a problem.
* Fixed a gross bug in CORD_prev.
* Fixed a bug in blacklst.c that could result in unbounded
heap growth during startup on machines that do not clear
memory obtained from the OS (e.g. win32S).
* Ported de editor to win32/win32S. (This is now the only
version with a mouse-sensitive UI.)
* Added GC_malloc_ignore_off_page to allocate large arrays
in the presence of ALL_INTERIOR_POINTERS.
* Changed GC_call_with_alloc_lock to not disable signals in
the single-threaded case.
* Reduced retry count in GC_collect_or_expand for garbage
collecting when out of memory.
* Made uncollectable allocations bypass black-listing, as they
should.
* Fixed a bug in typed_test in test.c that could cause (legitimate)
GC crashes.
* Fixed some potential synchronization problems in finalize.c
* Fixed a real locking problem in typd_mlc.c.
* Worked around an AIX 3.2 compiler feature that results in
out of bounds memory references.
* Partially worked around an IRIX5.2 beta problem (which may
or may not persist to the final release).
* Fixed a bug in the heap integrity checking code that could
result in explicitly deallocated objects being identified as
smashed. Fixed a bug in the dbg_mlc stack saving code
that caused old argument pointers to be considered live.
* Fixed a bug in CORD_ncmp (and hence CORD_str).
* Repaired the OS2 port, which had suffered from bit rot
in 4.0. Worked around what appears to be CSet/2 V1.0
optimizer bug.
* Fixed a Makefile bug for target "c++".
== [4.0] ==
* Added support for Solaris threads (which was possible
only by reimplementing some fraction of Solaris threads,
since Sun doesn't currently make the thread debugging
interface available).
* Added non-threads win32 and win32S support.
* (Grudgingly, with suitable muttering of obscenities) renamed
files so that the collector distribution could live on a FAT
file system. Files that are guaranteed to be useless on
a PC still have long names. Gc_inline.h and gc_private.h
still exist, but now just include gc_inl.h and gc_priv.h.
* Fixed a really obscure bug in finalization that could cause
undetected mark stack overflows. (I would be surprised if
any real code ever tickled this one.)
* Changed finalization code to dynamically resize the hash
tables it maintains. (This probably does not matter for well-
-written code. It no doubt does for C++ code that overuses
destructors.)
* Added typed allocation primitives. Rewrote the marker to
accommodate them with more reasonable efficiency. This
change should also speed up marking for GC_malloc allocated
objects a little. See gc_typed.h for new primitives.
* Improved debugging facilities slightly. Allocation time
stack traces are now kept by default on SPARC/SUNOS4.
* Added better support for small heap applications.
* Significantly extended cord package. Fixed a bug in the
implementation of lazily read files. Printf and friends now
have cord variants. Cord traversals are a bit faster.
* Made ALL_INTERIOR_POINTERS recognition the default.
* Fixed de so that it can run in constant space, independent
of file size. Added simple string searching to cords and de.
* Added the Hull-Ellis C++ interface.
* Added dynamic library support for OSF/1.
* Changed argument to GC_expand_hp to be expressed
in units of bytes instead of heap blocks. (Necessary
since the heap block size now varies depending on
configuration. The old version was never very clean.)
* Added GC_get_heap_size(). The previous "equivalent"
was broken.
* Restructured the Makefile a bit.
== [3.7] ==
* Added a workaround for an HP/UX compiler bug.
* Fixed another stack clearing performance bug. Reworked
that code once more.
== [3.6] ==
* fixed a bug in the mark stack growth code that was introduced
in 3.4.
* fixed Makefile to work around DEC AXP compiler tail recursion
bug.
== [3.5] ==
* Minor collections now mark from roots only once, if that
doesn't cause an excessive pause.
* The stack clearing heuristic was refined to prevent anomalies
with very heavily recursive programs and sparse stacks.
* Fixed a bug that prevented mark stack growth in some cases.
GC_objects_are_marked should be set to TRUE after a call
to GC_push_roots and as part of GC_push_marked, since
both can now set mark bits. I think this is only a performance
bug, but I wouldn't bet on it. It's certainly very hard to argue
that the old version was correct.
* Fixed an incremental collection bug that prevented it from
working at all when HBLKSIZE != getpagesize()
* Changed dynamic_loading.c to include gc_priv.h before testing
DYNAMIC_LOADING. SunOS dynamic library scanning
must have been broken in 3.4.
* Object size rounding now adapts to program behavior.
* Added a workaround (provided by Manuel Serrano and
colleagues) to a long-standing SunOS 4.X (and 3.X) ld bug
that I had incorrectly assumed to have been squished.
The collector was broken if the text segment size was within
32 bytes of a multiple of 8K bytes, and if the beginning of
the data segment contained interesting roots. The workaround
assumes a demand-loadable executable. The original may have
have "worked" in some other cases.
* Added dynamic library support under IRIX5.
* Added support for EMX under OS/2.
== [3.4] ==
* Fixed a performance bug in GC_realloc.
* Updated the amiga port.
* Added NetBSD and 386BSD ports.
* Added cord library.
* Added trivial performance enhancement for
ALL_INTERIOR_POINTERS. (Don't scan last word.)
== [3.3] ==
* PCR-specific bugs.
* Missing locking in GC_free, redundant FASTUNLOCK
in GC_malloc_stubborn, and 2 bugs in
GC_unregister_disappearing_link.
* Common symbols allocated by the SunOS4.X dynamic loader
were not included in the root set.
* Bug in GC_finalize
* Merged Amiga port from Jesper Peterson (untested)
* Merged NeXT port from Thomas Funke (significantly
modified and untested)
== [3.2] ==
Fixed a serious and not entirely repeatable bug in
the incremental collector. It appeared only when dirty bit info
on the roots was available, which is normally only under Solaris.
It also added GC_general_register_disappearing_link, and some
testing code. Interface.c disappeared.
== [3.1] ==
* A workaround for a SunOS 4.X SPARC C compiler
misfeature that caused problems when the collector was turned into
a dynamic library.
* A fix for a bug in GC_base that could result in a memory fault.
* A fix for a performance bug (and several other misfeatures) pointed
out by Dave Detlefs and Al Dosser.
* Use of dirty bit information for static data under Solaris 2.X.
* DEC Alpha/OSF1 support.
* Incremental collection on more platforms.
* A more refined heap expansion policy. Less space usage by default.
* Various minor enhancements to reduce space usage, and to reduce
the amount of memory scanned by the collector.
* Uncollectable allocation without per object overhead.
* More conscientious handling of out-of-memory conditions.
* Fixed a bug in debugging stubborn allocation.
* Fixed a bug that resulted in occasional erroneous reporting of smashed
objects with debugging allocation.
* Fixed bogus leak reports of size 4096 blocks with FIND_LEAK.
== [3.0] ==
Added generational/incremental collection and stubborn objects.
== [2.5] ==
* Removed an explicit call to exit(1)
* Fixed calls to GC_printf and GC_err_printf, so the correct number of
arguments are always supplied. The OS/2 C compiler gets confused if
the number of actuals and the number of formals differ. (ANSI C
doesn't require this to work. The ANSI sanctioned way of doing things
causes too many compatibility problems.)
== [2.4] ==
Added GC_free_space_divisor as a tuning knob, added
support for OS/2 and linux, and fixed the following bugs:
* On machines with unaligned pointers (e.g. Sun 3), every 128th word could
fail to be considered for marking.
* Dynamic_load.c erroneously added 4 bytes to the length of the data and
bss sections of the dynamic library. This could result in a bad memory
reference if the actual length was a multiple of a page. (Observed on
Sun 3. Can probably also happen on a Sun 4.)
(Dynamic library handling is still broken on Sun 3s
under 4.1.1U1, but apparently not 4.1.1. If you have such a machine,
use -Bstatic.)
== [2.3] ==
* Added ALL_INTERIOR_POINTERS.
* Missing declaration of etext in the A/UX version.
* Some PCR root-finding problems.
* Blacklisting was not 100% effective, because the plausible future
heap bounds were being miscalculated.
* GC_realloc didn't handle out-of-memory correctly.
* GC_base could return a nonzero value for addresses inside free blocks.
* test.c wasn't really thread safe, and could erroneously report failure
in a multi-threaded environment. (The locking primitives need to be
replaced for other threads packages.)
* GC_CONS was thoroughly broken.
* On a SPARC with dynamic linking, signals stayed disabled while the
client code was running.
== [2.2] ==
* GC_realloc could fail to extend the size of the object for certain large
object sizes.
* A blatant subscript range error in GC_printf, which unfortunately
wasn't exercised on machines with sufficient stack alignment constraints.
* GC_register_displacement did the wrong thing if it was called after
any allocation had taken place.
* The leak finding code would eventually break after 2048 byte
byte objects leaked.
* interface.c didn't compile.
* The heap size remained much too small for large stacks.
* The stack clearing code behaved badly for large stacks, and perhaps
on HP/PA machines.
== [2.1] ==
* The first stable version since 1.9.
* Added support for PPCR.
== [2.0] ==
* Introduced a consistent naming convention for collector
routines and added support for registering dynamic library data segments
in the standard mark_roots.c. Most of the data structures were revamped.
The treatment of interior pointers was completely changed. Finalization
was added. Support for locking was added. Object kinds were added.
We added a black listing facility to avoid allocating at addresses known
to occur as integers somewhere in the address space. Much of this
was accomplished by adapting ideas and code from the PCR collector.
The test program was changed and expanded.
== [1.9] ==
* fixed a major bug in gc_realloc.
== [1.8] ==
* added ULTRIX support in gc_private.h.
== [1.5] ==
* ensure 8 byte alignment for objects allocated on a sparc based machine.
== [1.4] ==
* Does not use compile time determined values
for the stack base. This no longer works on Sun 3s, since Sun 3/80s use
a different stack base. We now use a straightforward heuristic on all
machines on which it is known to work (incl. Sun 3s) and compile-time
determined values for the rest. There should really be library calls
to determine such values.
== [1.3] ==
* Fixed spurious
assembly language assignments to TMP_SP. Only the assignment in the PC/RT
code is necessary. On other machines, with certain compiler options,
the assignments can lead to an unsaved register being overwritten.
Known to cause problems under SunOS 3.5 WITHOUT the -O option. (With
-O the compiler recognizes it as dead code. It probably shouldn't,
but t2hat's another story.)
|