From 27549a1f82761f95af26d69f387eda3600dc02a6 Mon Sep 17 00:00:00 2001 From: Nick Barnes Date: Mon, 24 Sep 2001 17:06:16 +0100 Subject: [PATCH 01/10] Branch to get mps working on freebsd 4 Copied from Perforce Change: 22634 ServerID: perforce.ravenbrook.com --- mps/qa/argerr/0.c | 23 - mps/qa/argerr/1.c | 23 - mps/qa/argerr/10.c | 53 -- mps/qa/argerr/100.c | 38 -- mps/qa/argerr/101.c | 38 -- mps/qa/argerr/102.c | 39 -- mps/qa/argerr/103.c | 39 -- mps/qa/argerr/104.c | 39 -- mps/qa/argerr/105.c | 39 -- mps/qa/argerr/106.c | 39 -- mps/qa/argerr/107.c | 39 -- mps/qa/argerr/108.c | 39 -- mps/qa/argerr/109.c | 39 -- mps/qa/argerr/11.c | 53 -- mps/qa/argerr/110.c | 39 -- mps/qa/argerr/111.c | 39 -- mps/qa/argerr/112.c | 39 -- mps/qa/argerr/113.c | 39 -- mps/qa/argerr/114.c | 39 -- mps/qa/argerr/115.c | 44 -- mps/qa/argerr/116.c | 44 -- mps/qa/argerr/117.c | 45 -- mps/qa/argerr/118.c | 45 -- mps/qa/argerr/119.c | 45 -- mps/qa/argerr/12.c | 54 --- mps/qa/argerr/120.c | 45 -- mps/qa/argerr/121.c | 45 -- mps/qa/argerr/122.c | 45 -- mps/qa/argerr/123.c | 45 -- mps/qa/argerr/124.c | 45 -- mps/qa/argerr/125.c | 45 -- mps/qa/argerr/126.c | 45 -- mps/qa/argerr/127.c | 45 -- mps/qa/argerr/128.c | 45 -- mps/qa/argerr/129.c | 45 -- mps/qa/argerr/13.c | 54 --- mps/qa/argerr/130.c | 37 -- mps/qa/argerr/131.c | 37 -- mps/qa/argerr/132.c | 38 -- mps/qa/argerr/133.c | 38 -- mps/qa/argerr/134.c | 38 -- mps/qa/argerr/135.c | 38 -- mps/qa/argerr/136.c | 39 -- mps/qa/argerr/137.c | 39 -- mps/qa/argerr/138.c | 39 -- mps/qa/argerr/139.c | 39 -- mps/qa/argerr/14.c | 54 --- mps/qa/argerr/140.c | 38 -- mps/qa/argerr/141.c | 38 -- mps/qa/argerr/142.c | 38 -- mps/qa/argerr/143.c | 38 -- mps/qa/argerr/144.c | 35 -- mps/qa/argerr/145.c | 35 -- mps/qa/argerr/146.c | 489 ------------------- mps/qa/argerr/147.c | 489 ------------------- mps/qa/argerr/148.c | 489 ------------------- mps/qa/argerr/149.c | 490 ------------------- mps/qa/argerr/15.c | 54 --- mps/qa/argerr/150.c | 489 ------------------- mps/qa/argerr/151.c | 490 ------------------- mps/qa/argerr/152.c | 50 -- mps/qa/argerr/153.c | 33 -- mps/qa/argerr/154.c | 66 --- mps/qa/argerr/16.c | 54 --- mps/qa/argerr/17.c | 54 --- mps/qa/argerr/18.c | 56 --- mps/qa/argerr/19.c | 56 --- mps/qa/argerr/2.c | 26 - mps/qa/argerr/20.c | 48 -- mps/qa/argerr/21.c | 48 -- mps/qa/argerr/22.c | 48 -- mps/qa/argerr/23.c | 48 -- mps/qa/argerr/24.c | 48 -- mps/qa/argerr/25.c | 48 -- mps/qa/argerr/26.c | 48 -- mps/qa/argerr/27.c | 49 -- mps/qa/argerr/28.c | 49 -- mps/qa/argerr/29.c | 49 -- mps/qa/argerr/3.c | 26 - mps/qa/argerr/30.c | 49 -- mps/qa/argerr/31.c | 49 -- mps/qa/argerr/32.c | 49 -- mps/qa/argerr/33.c | 49 -- mps/qa/argerr/34.c | 47 -- mps/qa/argerr/35.c | 48 -- mps/qa/argerr/36.c | 50 -- mps/qa/argerr/37.c | 48 -- mps/qa/argerr/38.c | 42 -- mps/qa/argerr/39.c | 42 -- mps/qa/argerr/4.c | 46 -- mps/qa/argerr/40.c | 42 -- mps/qa/argerr/41.c | 43 -- mps/qa/argerr/42.c | 43 -- mps/qa/argerr/43.c | 43 -- mps/qa/argerr/44.c | 43 -- mps/qa/argerr/45.c | 58 --- mps/qa/argerr/46.c | 58 --- mps/qa/argerr/47.c | 59 --- mps/qa/argerr/48.c | 59 --- mps/qa/argerr/49.c | 59 --- mps/qa/argerr/5.c | 46 -- mps/qa/argerr/50.c | 59 --- mps/qa/argerr/51.c | 59 --- mps/qa/argerr/52.c | 61 --- mps/qa/argerr/53.c | 61 --- mps/qa/argerr/54.c | 65 --- mps/qa/argerr/55.c | 65 --- mps/qa/argerr/56.c | 66 --- mps/qa/argerr/57.c | 66 --- mps/qa/argerr/58.c | 66 --- mps/qa/argerr/59.c | 66 --- mps/qa/argerr/6.c | 48 -- mps/qa/argerr/60.c | 66 --- mps/qa/argerr/61.c | 69 --- mps/qa/argerr/62.c | 69 --- mps/qa/argerr/63.c | 69 --- mps/qa/argerr/64.c | 69 --- mps/qa/argerr/65.c | 69 --- mps/qa/argerr/66.c | 69 --- mps/qa/argerr/67.c | 69 --- mps/qa/argerr/68.c | 32 -- mps/qa/argerr/69.c | 32 -- mps/qa/argerr/7.c | 48 -- mps/qa/argerr/70.c | 33 -- mps/qa/argerr/71.c | 33 -- mps/qa/argerr/72.c | 35 -- mps/qa/argerr/73.c | 35 -- mps/qa/argerr/74.c | 35 -- mps/qa/argerr/75.c | 35 -- mps/qa/argerr/76.c | 36 -- mps/qa/argerr/77.c | 36 -- mps/qa/argerr/78.c | 38 -- mps/qa/argerr/79.c | 38 -- mps/qa/argerr/8.c | 50 -- mps/qa/argerr/80.c | 38 -- mps/qa/argerr/81.c | 38 -- mps/qa/argerr/82.c | 38 -- mps/qa/argerr/83.c | 38 -- mps/qa/argerr/84.c | 40 -- mps/qa/argerr/85.c | 40 -- mps/qa/argerr/86.c | 40 -- mps/qa/argerr/87.c | 40 -- mps/qa/argerr/88.c | 40 -- mps/qa/argerr/89.c | 40 -- mps/qa/argerr/9.c | 50 -- mps/qa/argerr/90.c | 42 -- mps/qa/argerr/91.c | 42 -- mps/qa/argerr/92.c | 43 -- mps/qa/argerr/93.c | 43 -- mps/qa/argerr/94.c | 43 -- mps/qa/argerr/95.c | 43 -- mps/qa/argerr/96.c | 43 -- mps/qa/argerr/97.c | 43 -- mps/qa/argerr/98.c | 43 -- mps/qa/argerr/99.c | 43 -- mps/qa/conerr/0.c | 27 -- mps/qa/conerr/1.c | 24 - mps/qa/conerr/10.c | 56 --- mps/qa/conerr/11.c | 58 --- mps/qa/conerr/12.c | 62 --- mps/qa/conerr/13.c | 45 -- mps/qa/conerr/14.c | 40 -- mps/qa/conerr/15.c | 45 -- mps/qa/conerr/16.c | 46 -- mps/qa/conerr/17.c | 74 --- mps/qa/conerr/18.c | 68 --- mps/qa/conerr/19.c | 49 -- mps/qa/conerr/2.c | 25 - mps/qa/conerr/20.c | 47 -- mps/qa/conerr/21.c | 50 -- mps/qa/conerr/22.c | 50 -- mps/qa/conerr/23.c | 53 -- mps/qa/conerr/24.c | 68 --- mps/qa/conerr/25.c | 70 --- mps/qa/conerr/26.c | 51 -- mps/qa/conerr/27.c | 57 --- mps/qa/conerr/28.c | 74 --- mps/qa/conerr/29.c | 72 --- mps/qa/conerr/3.c | 25 - mps/qa/conerr/30.c | 74 --- mps/qa/conerr/31.c | 75 --- mps/qa/conerr/32.c | 49 -- mps/qa/conerr/33.c | 72 --- mps/qa/conerr/33a.c | 80 --- mps/qa/conerr/34.c | 78 --- mps/qa/conerr/35.c | 76 --- mps/qa/conerr/36.c | 80 --- mps/qa/conerr/37.c | 84 ---- mps/qa/conerr/37f.c | 87 ---- mps/qa/conerr/38.c | 84 ---- mps/qa/conerr/38f.c | 87 ---- mps/qa/conerr/39.c | 85 ---- mps/qa/conerr/39f.c | 88 ---- mps/qa/conerr/4.c | 39 -- mps/qa/conerr/40.c | 83 ---- mps/qa/conerr/40f.c | 86 ---- mps/qa/conerr/41.c | 45 -- mps/qa/conerr/42.c | 44 -- mps/qa/conerr/43.c | 45 -- mps/qa/conerr/44.c | 46 -- mps/qa/conerr/44a.c | 53 -- mps/qa/conerr/45.c | 42 -- mps/qa/conerr/46.c | 43 -- mps/qa/conerr/47.c | 42 -- mps/qa/conerr/48.c | 43 -- mps/qa/conerr/49.c | 46 -- mps/qa/conerr/5.c | 51 -- mps/qa/conerr/50.c | 35 -- mps/qa/conerr/51.c | 33 -- mps/qa/conerr/52.c | 37 -- mps/qa/conerr/53.c | 39 -- mps/qa/conerr/54.c | 43 -- mps/qa/conerr/55.c | 42 -- mps/qa/conerr/56.c | 40 -- mps/qa/conerr/57.c | 38 -- mps/qa/conerr/58.c | 37 -- mps/qa/conerr/59.c | 51 -- mps/qa/conerr/6.c | 41 -- mps/qa/conerr/7.c | 35 -- mps/qa/conerr/8.c | 53 -- mps/qa/conerr/9.c | 53 -- mps/qa/data/af_six.txt | 17 - mps/qa/function/0.c | 18 - mps/qa/function/1.c | 25 - mps/qa/function/10.c | 118 ----- mps/qa/function/100.c | 139 ------ mps/qa/function/101.c | 175 ------- mps/qa/function/102.c | 176 ------- mps/qa/function/103.c | 159 ------ mps/qa/function/104.c | 244 ---------- mps/qa/function/105.c | 99 ---- mps/qa/function/106.c | 124 ----- mps/qa/function/107.c | 125 ----- mps/qa/function/108.c | 106 ---- mps/qa/function/109.c | 296 ------------ mps/qa/function/11.c | 99 ---- mps/qa/function/110.c | 304 ------------ mps/qa/function/111.c | 222 --------- mps/qa/function/112.c | 94 ---- mps/qa/function/113.c | 126 ----- mps/qa/function/114.c | 126 ----- mps/qa/function/115.c | 176 ------- mps/qa/function/116.c | 116 ----- mps/qa/function/117.c | 114 ----- mps/qa/function/118.c | 146 ------ mps/qa/function/119.c | 38 -- mps/qa/function/12.c | 203 -------- mps/qa/function/120.c | 126 ----- mps/qa/function/121.c | 61 --- mps/qa/function/122.c | 195 -------- mps/qa/function/123.c | 115 ----- mps/qa/function/124.c | 159 ------ mps/qa/function/125.c | 102 ---- mps/qa/function/126.c | 104 ---- mps/qa/function/127.c | 160 ------ mps/qa/function/128.c | 160 ------ mps/qa/function/129.c | 160 ------ mps/qa/function/12p.c | 215 --------- mps/qa/function/13.c | 211 -------- mps/qa/function/130.c | 117 ----- mps/qa/function/131.c | 122 ----- mps/qa/function/132.c | 187 ------- mps/qa/function/133.c | 139 ------ mps/qa/function/134.c | 160 ------ mps/qa/function/135.c | 64 --- mps/qa/function/136.c | 164 ------- mps/qa/function/137.c | 106 ---- mps/qa/function/138.c | 85 ---- mps/qa/function/139.c | 85 ---- mps/qa/function/14.c | 122 ----- mps/qa/function/140.c | 190 -------- mps/qa/function/141.c | 64 --- mps/qa/function/142.c | 59 --- mps/qa/function/143.c | 57 --- mps/qa/function/144.c | 65 --- mps/qa/function/145.c | 100 ---- mps/qa/function/146.c | 106 ---- mps/qa/function/147.c | 104 ---- mps/qa/function/148.c | 144 ------ mps/qa/function/149.c | 198 -------- mps/qa/function/15.c | 78 --- mps/qa/function/150.c | 326 ------------- mps/qa/function/151.c | 84 ---- mps/qa/function/152.c | 124 ----- mps/qa/function/153.c | 83 ---- mps/qa/function/154.c | 73 --- mps/qa/function/155.c | 64 --- mps/qa/function/156.c | 58 --- mps/qa/function/157.c | 57 --- mps/qa/function/158.c | 53 -- mps/qa/function/159.c | 57 --- mps/qa/function/16.c | 112 ----- mps/qa/function/160.c | 64 --- mps/qa/function/161.c | 58 --- mps/qa/function/162.c | 57 --- mps/qa/function/163.c | 106 ---- mps/qa/function/164.c | 184 ------- mps/qa/function/165.c | 110 ----- mps/qa/function/166.c | 102 ---- mps/qa/function/167.c | 103 ---- mps/qa/function/168.c | 96 ---- mps/qa/function/169.c | 92 ---- mps/qa/function/17.c | 63 --- mps/qa/function/170.c | 230 --------- mps/qa/function/171.c | 161 ------ mps/qa/function/172.c | 68 --- mps/qa/function/173.c | 79 --- mps/qa/function/174.c | 89 ---- mps/qa/function/175.c | 65 --- mps/qa/function/18.c | 78 --- mps/qa/function/19.c | 78 --- mps/qa/function/2.c | 102 ---- mps/qa/function/20.c | 57 --- mps/qa/function/200.c | 176 ------- mps/qa/function/201.c | 176 ------- mps/qa/function/202.c | 176 ------- mps/qa/function/203.c | 216 --------- mps/qa/function/204.c | 216 --------- mps/qa/function/205.c | 216 --------- mps/qa/function/206.c | 189 -------- mps/qa/function/207.c | 184 ------- mps/qa/function/208.c | 71 --- mps/qa/function/209.c | 68 --- mps/qa/function/21.c | 36 -- mps/qa/function/210.c | 78 --- mps/qa/function/211.c | 77 --- mps/qa/function/212.c | 92 ---- mps/qa/function/213.c | 87 ---- mps/qa/function/214.c | 77 --- mps/qa/function/215.c | 173 ------- mps/qa/function/216.c | 112 ----- mps/qa/function/217.c | 95 ---- mps/qa/function/218.c | 103 ---- mps/qa/function/219.c | 118 ----- mps/qa/function/22.c | 38 -- mps/qa/function/220.c | 103 ---- mps/qa/function/221.c | 162 ------- mps/qa/function/222.c | 134 ----- mps/qa/function/223.c | 173 ------- mps/qa/function/224.c | 53 -- mps/qa/function/225.c | 45 -- mps/qa/function/226.c | 194 -------- mps/qa/function/227.c | 202 -------- mps/qa/function/23.c | 129 ----- mps/qa/function/24.c | 120 ----- mps/qa/function/25.c | 125 ----- mps/qa/function/26.c | 62 --- mps/qa/function/27.c | 93 ---- mps/qa/function/28.c | 118 ----- mps/qa/function/29.c | 125 ----- mps/qa/function/3.c | 102 ---- mps/qa/function/30.c | 106 ---- mps/qa/function/31.c | 111 ----- mps/qa/function/32.c | 107 ---- mps/qa/function/33.c | 106 ---- mps/qa/function/34.c | 109 ----- mps/qa/function/35.c | 129 ----- mps/qa/function/36.c | 114 ----- mps/qa/function/37.c | 132 ----- mps/qa/function/38.c | 183 ------- mps/qa/function/39.c | 114 ----- mps/qa/function/4.c | 114 ----- mps/qa/function/40.c | 99 ---- mps/qa/function/41.c | 134 ----- mps/qa/function/42.c | 130 ----- mps/qa/function/43.c | 141 ------ mps/qa/function/44.c | 191 -------- mps/qa/function/45.c | 212 -------- mps/qa/function/46.c | 163 ------- mps/qa/function/47.c | 120 ----- mps/qa/function/48.c | 140 ------ mps/qa/function/49.c | 302 ------------ mps/qa/function/5.c | 114 ----- mps/qa/function/50.c | 305 ------------ mps/qa/function/500.txt | 42 -- mps/qa/function/501.txt | 31 -- mps/qa/function/502.txt | 34 -- mps/qa/function/503.txt | 39 -- mps/qa/function/504.txt | 19 - mps/qa/function/505.txt | 28 -- mps/qa/function/506.txt | 69 --- mps/qa/function/51.c | 222 --------- mps/qa/function/52.c | 110 ----- mps/qa/function/53.c | 129 ----- mps/qa/function/54.c | 129 ----- mps/qa/function/55.c | 128 ----- mps/qa/function/56.c | 126 ----- mps/qa/function/57.c | 122 ----- mps/qa/function/6.c | 101 ---- mps/qa/function/60.c | 110 ----- mps/qa/function/61.c | 103 ---- mps/qa/function/62.c | 103 ---- mps/qa/function/63.c | 95 ---- mps/qa/function/64.c | 128 ----- mps/qa/function/65.c | 211 -------- mps/qa/function/66.c | 179 ------- mps/qa/function/67.c | 124 ----- mps/qa/function/68.c | 107 ---- mps/qa/function/69.c | 116 ----- mps/qa/function/7.c | 35 -- mps/qa/function/70.c | 39 -- mps/qa/function/71.c | 33 -- mps/qa/function/72.c | 103 ---- mps/qa/function/73.c | 93 ---- mps/qa/function/74.c | 93 ---- mps/qa/function/75.c | 96 ---- mps/qa/function/76.c | 150 ------ mps/qa/function/77.c | 119 ----- mps/qa/function/78.c | 122 ----- mps/qa/function/79.c | 119 ----- mps/qa/function/8.c | 65 --- mps/qa/function/80.c | 119 ----- mps/qa/function/81.c | 101 ---- mps/qa/function/82.c | 140 ------ mps/qa/function/83.c | 131 ----- mps/qa/function/84.c | 112 ----- mps/qa/function/85.c | 119 ----- mps/qa/function/86.c | 129 ----- mps/qa/function/87.c | 168 ------- mps/qa/function/88.c | 85 ---- mps/qa/function/89.c | 79 --- mps/qa/function/9.c | 80 --- mps/qa/function/90.c | 120 ----- mps/qa/function/91.c | 90 ---- mps/qa/function/92.c | 76 --- mps/qa/function/93.c | 98 ---- mps/qa/function/94.c | 93 ---- mps/qa/function/95.c | 97 ---- mps/qa/function/96.c | 148 ------ mps/qa/function/97.c | 249 ---------- mps/qa/function/98.c | 35 -- mps/qa/function/99.c | 119 ----- mps/qa/misc/0.c | 36 -- mps/qa/misc/1.c | 38 -- mps/qa/misc/2.c | 40 -- mps/qa/test/README | 10 - mps/qa/test/qa | 76 --- mps/qa/test/script/clib | 384 --------------- mps/qa/test/script/commands/clib | 22 - mps/qa/test/script/commands/help | 53 -- mps/qa/test/script/commands/index | 88 ---- mps/qa/test/script/commands/options | 9 - mps/qa/test/script/commands/run | 20 - mps/qa/test/script/commands/runset | 19 - mps/qa/test/script/commands/try | 9 - mps/qa/test/script/compile | 119 ----- mps/qa/test/script/dirs | 36 -- mps/qa/test/script/display | 35 -- mps/qa/test/script/headconv | 53 -- mps/qa/test/script/headread | 270 ----------- mps/qa/test/script/help/clib | 16 - mps/qa/test/script/help/index | 10 - mps/qa/test/script/help/install | 44 -- mps/qa/test/script/help/naming | 22 - mps/qa/test/script/help/options | 119 ----- mps/qa/test/script/help/output | 37 -- mps/qa/test/script/help/problems | 14 - mps/qa/test/script/help/run | 15 - mps/qa/test/script/help/runset | 22 - mps/qa/test/script/init | 19 - mps/qa/test/script/logging | 305 ------------ mps/qa/test/script/options | 92 ---- mps/qa/test/script/optproc | 211 -------- mps/qa/test/script/platform | 242 ---------- mps/qa/test/script/require | 27 -- mps/qa/test/script/runtest | 264 ---------- mps/qa/test/script/useful | 53 -- mps/qa/test/script/version | 36 -- mps/qa/test/testlib/arg.h | 36 -- mps/qa/test/testlib/assumed | 31 -- mps/qa/test/testlib/awlfmt.c | 566 ---------------------- mps/qa/test/testlib/awlfmt.h | 89 ---- mps/qa/test/testlib/epvmfmt.c | 141 ------ mps/qa/test/testlib/epvmfmt.h | 40 -- mps/qa/test/testlib/exfmt.c | 553 --------------------- mps/qa/test/testlib/exfmt.h | 126 ----- mps/qa/test/testlib/fastfmt.c | 349 ------------- mps/qa/test/testlib/fastfmt.h | 73 --- mps/qa/test/testlib/lofmt.c | 194 -------- mps/qa/test/testlib/lofmt.h | 62 --- mps/qa/test/testlib/manifest | 12 - mps/qa/test/testlib/myfmt.c | 219 --------- mps/qa/test/testlib/myfmt.h | 46 -- mps/qa/test/testlib/newfmt.c | 525 -------------------- mps/qa/test/testlib/newfmt.h | 88 ---- mps/qa/test/testlib/ossu.h | 79 --- mps/qa/test/testlib/platform.c | 43 -- mps/qa/test/testlib/platform.h | 34 -- mps/qa/test/testlib/postBQ.h | 7 - mps/qa/test/testlib/postGR.h | 29 -- mps/qa/test/testlib/postHU.h | 7 - mps/qa/test/testlib/postMO.h | 5 - mps/qa/test/testlib/preBQ.h | 6 - mps/qa/test/testlib/preGR.h | 29 -- mps/qa/test/testlib/preHU.h | 14 - mps/qa/test/testlib/preMO.h | 14 - mps/qa/test/testlib/rankfmt.c | 725 ---------------------------- mps/qa/test/testlib/rankfmt.h | 155 ------ mps/qa/test/testlib/testlib.c | 573 ---------------------- mps/qa/test/testlib/testlib.h | 177 ------- mps/qa/test/testlib/versind.h | 120 ----- mps/qa/testsets/daily | 90 ---- mps/qa/testsets/dailydw | 96 ---- mps/qa/testsets/dailysw | 36 -- mps/qa/testsets/dailyswa | 8 - mps/qa/testsets/dylan1 | 78 --- mps/qa/testsets/perfsw | 6 - mps/src/mpstd.h | 299 ------------ 508 files changed, 47174 deletions(-) delete mode 100644 mps/qa/argerr/0.c delete mode 100644 mps/qa/argerr/1.c delete mode 100644 mps/qa/argerr/10.c delete mode 100644 mps/qa/argerr/100.c delete mode 100644 mps/qa/argerr/101.c delete mode 100644 mps/qa/argerr/102.c delete mode 100644 mps/qa/argerr/103.c delete mode 100644 mps/qa/argerr/104.c delete mode 100644 mps/qa/argerr/105.c delete mode 100644 mps/qa/argerr/106.c delete mode 100644 mps/qa/argerr/107.c delete mode 100644 mps/qa/argerr/108.c delete mode 100644 mps/qa/argerr/109.c delete mode 100644 mps/qa/argerr/11.c delete mode 100644 mps/qa/argerr/110.c delete mode 100644 mps/qa/argerr/111.c delete mode 100644 mps/qa/argerr/112.c delete mode 100644 mps/qa/argerr/113.c delete mode 100644 mps/qa/argerr/114.c delete mode 100644 mps/qa/argerr/115.c delete mode 100644 mps/qa/argerr/116.c delete mode 100644 mps/qa/argerr/117.c delete mode 100644 mps/qa/argerr/118.c delete mode 100644 mps/qa/argerr/119.c delete mode 100644 mps/qa/argerr/12.c delete mode 100644 mps/qa/argerr/120.c delete mode 100644 mps/qa/argerr/121.c delete mode 100644 mps/qa/argerr/122.c delete mode 100644 mps/qa/argerr/123.c delete mode 100644 mps/qa/argerr/124.c delete mode 100644 mps/qa/argerr/125.c delete mode 100644 mps/qa/argerr/126.c delete mode 100644 mps/qa/argerr/127.c delete mode 100644 mps/qa/argerr/128.c delete mode 100644 mps/qa/argerr/129.c delete mode 100644 mps/qa/argerr/13.c delete mode 100644 mps/qa/argerr/130.c delete mode 100644 mps/qa/argerr/131.c delete mode 100644 mps/qa/argerr/132.c delete mode 100644 mps/qa/argerr/133.c delete mode 100644 mps/qa/argerr/134.c delete mode 100644 mps/qa/argerr/135.c delete mode 100644 mps/qa/argerr/136.c delete mode 100644 mps/qa/argerr/137.c delete mode 100644 mps/qa/argerr/138.c delete mode 100644 mps/qa/argerr/139.c delete mode 100644 mps/qa/argerr/14.c delete mode 100644 mps/qa/argerr/140.c delete mode 100644 mps/qa/argerr/141.c delete mode 100644 mps/qa/argerr/142.c delete mode 100644 mps/qa/argerr/143.c delete mode 100644 mps/qa/argerr/144.c delete mode 100644 mps/qa/argerr/145.c delete mode 100644 mps/qa/argerr/146.c delete mode 100644 mps/qa/argerr/147.c delete mode 100644 mps/qa/argerr/148.c delete mode 100644 mps/qa/argerr/149.c delete mode 100644 mps/qa/argerr/15.c delete mode 100644 mps/qa/argerr/150.c delete mode 100644 mps/qa/argerr/151.c delete mode 100644 mps/qa/argerr/152.c delete mode 100644 mps/qa/argerr/153.c delete mode 100644 mps/qa/argerr/154.c delete mode 100644 mps/qa/argerr/16.c delete mode 100644 mps/qa/argerr/17.c delete mode 100644 mps/qa/argerr/18.c delete mode 100644 mps/qa/argerr/19.c delete mode 100644 mps/qa/argerr/2.c delete mode 100644 mps/qa/argerr/20.c delete mode 100644 mps/qa/argerr/21.c delete mode 100644 mps/qa/argerr/22.c delete mode 100644 mps/qa/argerr/23.c delete mode 100644 mps/qa/argerr/24.c delete mode 100644 mps/qa/argerr/25.c delete mode 100644 mps/qa/argerr/26.c delete mode 100644 mps/qa/argerr/27.c delete mode 100644 mps/qa/argerr/28.c delete mode 100644 mps/qa/argerr/29.c delete mode 100644 mps/qa/argerr/3.c delete mode 100644 mps/qa/argerr/30.c delete mode 100644 mps/qa/argerr/31.c delete mode 100644 mps/qa/argerr/32.c delete mode 100644 mps/qa/argerr/33.c delete mode 100644 mps/qa/argerr/34.c delete mode 100644 mps/qa/argerr/35.c delete mode 100644 mps/qa/argerr/36.c delete mode 100644 mps/qa/argerr/37.c delete mode 100644 mps/qa/argerr/38.c delete mode 100644 mps/qa/argerr/39.c delete mode 100644 mps/qa/argerr/4.c delete mode 100644 mps/qa/argerr/40.c delete mode 100644 mps/qa/argerr/41.c delete mode 100644 mps/qa/argerr/42.c delete mode 100644 mps/qa/argerr/43.c delete mode 100644 mps/qa/argerr/44.c delete mode 100644 mps/qa/argerr/45.c delete mode 100644 mps/qa/argerr/46.c delete mode 100644 mps/qa/argerr/47.c delete mode 100644 mps/qa/argerr/48.c delete mode 100644 mps/qa/argerr/49.c delete mode 100644 mps/qa/argerr/5.c delete mode 100644 mps/qa/argerr/50.c delete mode 100644 mps/qa/argerr/51.c delete mode 100644 mps/qa/argerr/52.c delete mode 100644 mps/qa/argerr/53.c delete mode 100644 mps/qa/argerr/54.c delete mode 100644 mps/qa/argerr/55.c delete mode 100644 mps/qa/argerr/56.c delete mode 100644 mps/qa/argerr/57.c delete mode 100644 mps/qa/argerr/58.c delete mode 100644 mps/qa/argerr/59.c delete mode 100644 mps/qa/argerr/6.c delete mode 100644 mps/qa/argerr/60.c delete mode 100644 mps/qa/argerr/61.c delete mode 100644 mps/qa/argerr/62.c delete mode 100644 mps/qa/argerr/63.c delete mode 100644 mps/qa/argerr/64.c delete mode 100644 mps/qa/argerr/65.c delete mode 100644 mps/qa/argerr/66.c delete mode 100644 mps/qa/argerr/67.c delete mode 100644 mps/qa/argerr/68.c delete mode 100644 mps/qa/argerr/69.c delete mode 100644 mps/qa/argerr/7.c delete mode 100644 mps/qa/argerr/70.c delete mode 100644 mps/qa/argerr/71.c delete mode 100644 mps/qa/argerr/72.c delete mode 100644 mps/qa/argerr/73.c delete mode 100644 mps/qa/argerr/74.c delete mode 100644 mps/qa/argerr/75.c delete mode 100644 mps/qa/argerr/76.c delete mode 100644 mps/qa/argerr/77.c delete mode 100644 mps/qa/argerr/78.c delete mode 100644 mps/qa/argerr/79.c delete mode 100644 mps/qa/argerr/8.c delete mode 100644 mps/qa/argerr/80.c delete mode 100644 mps/qa/argerr/81.c delete mode 100644 mps/qa/argerr/82.c delete mode 100644 mps/qa/argerr/83.c delete mode 100644 mps/qa/argerr/84.c delete mode 100644 mps/qa/argerr/85.c delete mode 100644 mps/qa/argerr/86.c delete mode 100644 mps/qa/argerr/87.c delete mode 100644 mps/qa/argerr/88.c delete mode 100644 mps/qa/argerr/89.c delete mode 100644 mps/qa/argerr/9.c delete mode 100644 mps/qa/argerr/90.c delete mode 100644 mps/qa/argerr/91.c delete mode 100644 mps/qa/argerr/92.c delete mode 100644 mps/qa/argerr/93.c delete mode 100644 mps/qa/argerr/94.c delete mode 100644 mps/qa/argerr/95.c delete mode 100644 mps/qa/argerr/96.c delete mode 100644 mps/qa/argerr/97.c delete mode 100644 mps/qa/argerr/98.c delete mode 100644 mps/qa/argerr/99.c delete mode 100644 mps/qa/conerr/0.c delete mode 100644 mps/qa/conerr/1.c delete mode 100644 mps/qa/conerr/10.c delete mode 100644 mps/qa/conerr/11.c delete mode 100644 mps/qa/conerr/12.c delete mode 100644 mps/qa/conerr/13.c delete mode 100644 mps/qa/conerr/14.c delete mode 100644 mps/qa/conerr/15.c delete mode 100644 mps/qa/conerr/16.c delete mode 100644 mps/qa/conerr/17.c delete mode 100644 mps/qa/conerr/18.c delete mode 100644 mps/qa/conerr/19.c delete mode 100644 mps/qa/conerr/2.c delete mode 100644 mps/qa/conerr/20.c delete mode 100644 mps/qa/conerr/21.c delete mode 100644 mps/qa/conerr/22.c delete mode 100644 mps/qa/conerr/23.c delete mode 100644 mps/qa/conerr/24.c delete mode 100644 mps/qa/conerr/25.c delete mode 100644 mps/qa/conerr/26.c delete mode 100644 mps/qa/conerr/27.c delete mode 100644 mps/qa/conerr/28.c delete mode 100644 mps/qa/conerr/29.c delete mode 100644 mps/qa/conerr/3.c delete mode 100644 mps/qa/conerr/30.c delete mode 100644 mps/qa/conerr/31.c delete mode 100644 mps/qa/conerr/32.c delete mode 100644 mps/qa/conerr/33.c delete mode 100644 mps/qa/conerr/33a.c delete mode 100644 mps/qa/conerr/34.c delete mode 100644 mps/qa/conerr/35.c delete mode 100644 mps/qa/conerr/36.c delete mode 100644 mps/qa/conerr/37.c delete mode 100644 mps/qa/conerr/37f.c delete mode 100644 mps/qa/conerr/38.c delete mode 100644 mps/qa/conerr/38f.c delete mode 100644 mps/qa/conerr/39.c delete mode 100644 mps/qa/conerr/39f.c delete mode 100644 mps/qa/conerr/4.c delete mode 100644 mps/qa/conerr/40.c delete mode 100644 mps/qa/conerr/40f.c delete mode 100644 mps/qa/conerr/41.c delete mode 100644 mps/qa/conerr/42.c delete mode 100644 mps/qa/conerr/43.c delete mode 100644 mps/qa/conerr/44.c delete mode 100644 mps/qa/conerr/44a.c delete mode 100644 mps/qa/conerr/45.c delete mode 100644 mps/qa/conerr/46.c delete mode 100644 mps/qa/conerr/47.c delete mode 100644 mps/qa/conerr/48.c delete mode 100644 mps/qa/conerr/49.c delete mode 100644 mps/qa/conerr/5.c delete mode 100644 mps/qa/conerr/50.c delete mode 100644 mps/qa/conerr/51.c delete mode 100644 mps/qa/conerr/52.c delete mode 100644 mps/qa/conerr/53.c delete mode 100644 mps/qa/conerr/54.c delete mode 100644 mps/qa/conerr/55.c delete mode 100644 mps/qa/conerr/56.c delete mode 100644 mps/qa/conerr/57.c delete mode 100644 mps/qa/conerr/58.c delete mode 100644 mps/qa/conerr/59.c delete mode 100644 mps/qa/conerr/6.c delete mode 100644 mps/qa/conerr/7.c delete mode 100644 mps/qa/conerr/8.c delete mode 100644 mps/qa/conerr/9.c delete mode 100644 mps/qa/data/af_six.txt delete mode 100644 mps/qa/function/0.c delete mode 100644 mps/qa/function/1.c delete mode 100644 mps/qa/function/10.c delete mode 100644 mps/qa/function/100.c delete mode 100644 mps/qa/function/101.c delete mode 100644 mps/qa/function/102.c delete mode 100644 mps/qa/function/103.c delete mode 100644 mps/qa/function/104.c delete mode 100644 mps/qa/function/105.c delete mode 100644 mps/qa/function/106.c delete mode 100644 mps/qa/function/107.c delete mode 100644 mps/qa/function/108.c delete mode 100644 mps/qa/function/109.c delete mode 100644 mps/qa/function/11.c delete mode 100644 mps/qa/function/110.c delete mode 100644 mps/qa/function/111.c delete mode 100644 mps/qa/function/112.c delete mode 100644 mps/qa/function/113.c delete mode 100644 mps/qa/function/114.c delete mode 100644 mps/qa/function/115.c delete mode 100644 mps/qa/function/116.c delete mode 100644 mps/qa/function/117.c delete mode 100644 mps/qa/function/118.c delete mode 100644 mps/qa/function/119.c delete mode 100644 mps/qa/function/12.c delete mode 100644 mps/qa/function/120.c delete mode 100644 mps/qa/function/121.c delete mode 100644 mps/qa/function/122.c delete mode 100644 mps/qa/function/123.c delete mode 100644 mps/qa/function/124.c delete mode 100644 mps/qa/function/125.c delete mode 100644 mps/qa/function/126.c delete mode 100644 mps/qa/function/127.c delete mode 100644 mps/qa/function/128.c delete mode 100644 mps/qa/function/129.c delete mode 100644 mps/qa/function/12p.c delete mode 100644 mps/qa/function/13.c delete mode 100644 mps/qa/function/130.c delete mode 100644 mps/qa/function/131.c delete mode 100644 mps/qa/function/132.c delete mode 100644 mps/qa/function/133.c delete mode 100644 mps/qa/function/134.c delete mode 100644 mps/qa/function/135.c delete mode 100644 mps/qa/function/136.c delete mode 100644 mps/qa/function/137.c delete mode 100644 mps/qa/function/138.c delete mode 100644 mps/qa/function/139.c delete mode 100644 mps/qa/function/14.c delete mode 100644 mps/qa/function/140.c delete mode 100644 mps/qa/function/141.c delete mode 100644 mps/qa/function/142.c delete mode 100644 mps/qa/function/143.c delete mode 100644 mps/qa/function/144.c delete mode 100644 mps/qa/function/145.c delete mode 100644 mps/qa/function/146.c delete mode 100644 mps/qa/function/147.c delete mode 100644 mps/qa/function/148.c delete mode 100644 mps/qa/function/149.c delete mode 100644 mps/qa/function/15.c delete mode 100644 mps/qa/function/150.c delete mode 100644 mps/qa/function/151.c delete mode 100644 mps/qa/function/152.c delete mode 100644 mps/qa/function/153.c delete mode 100644 mps/qa/function/154.c delete mode 100644 mps/qa/function/155.c delete mode 100644 mps/qa/function/156.c delete mode 100644 mps/qa/function/157.c delete mode 100644 mps/qa/function/158.c delete mode 100644 mps/qa/function/159.c delete mode 100644 mps/qa/function/16.c delete mode 100644 mps/qa/function/160.c delete mode 100644 mps/qa/function/161.c delete mode 100644 mps/qa/function/162.c delete mode 100644 mps/qa/function/163.c delete mode 100644 mps/qa/function/164.c delete mode 100644 mps/qa/function/165.c delete mode 100644 mps/qa/function/166.c delete mode 100644 mps/qa/function/167.c delete mode 100644 mps/qa/function/168.c delete mode 100644 mps/qa/function/169.c delete mode 100644 mps/qa/function/17.c delete mode 100644 mps/qa/function/170.c delete mode 100644 mps/qa/function/171.c delete mode 100644 mps/qa/function/172.c delete mode 100644 mps/qa/function/173.c delete mode 100644 mps/qa/function/174.c delete mode 100644 mps/qa/function/175.c delete mode 100644 mps/qa/function/18.c delete mode 100644 mps/qa/function/19.c delete mode 100644 mps/qa/function/2.c delete mode 100644 mps/qa/function/20.c delete mode 100644 mps/qa/function/200.c delete mode 100644 mps/qa/function/201.c delete mode 100644 mps/qa/function/202.c delete mode 100644 mps/qa/function/203.c delete mode 100644 mps/qa/function/204.c delete mode 100644 mps/qa/function/205.c delete mode 100644 mps/qa/function/206.c delete mode 100644 mps/qa/function/207.c delete mode 100644 mps/qa/function/208.c delete mode 100644 mps/qa/function/209.c delete mode 100644 mps/qa/function/21.c delete mode 100644 mps/qa/function/210.c delete mode 100644 mps/qa/function/211.c delete mode 100644 mps/qa/function/212.c delete mode 100644 mps/qa/function/213.c delete mode 100644 mps/qa/function/214.c delete mode 100644 mps/qa/function/215.c delete mode 100644 mps/qa/function/216.c delete mode 100644 mps/qa/function/217.c delete mode 100644 mps/qa/function/218.c delete mode 100644 mps/qa/function/219.c delete mode 100644 mps/qa/function/22.c delete mode 100644 mps/qa/function/220.c delete mode 100644 mps/qa/function/221.c delete mode 100644 mps/qa/function/222.c delete mode 100644 mps/qa/function/223.c delete mode 100644 mps/qa/function/224.c delete mode 100644 mps/qa/function/225.c delete mode 100644 mps/qa/function/226.c delete mode 100644 mps/qa/function/227.c delete mode 100644 mps/qa/function/23.c delete mode 100644 mps/qa/function/24.c delete mode 100644 mps/qa/function/25.c delete mode 100644 mps/qa/function/26.c delete mode 100644 mps/qa/function/27.c delete mode 100644 mps/qa/function/28.c delete mode 100644 mps/qa/function/29.c delete mode 100644 mps/qa/function/3.c delete mode 100644 mps/qa/function/30.c delete mode 100644 mps/qa/function/31.c delete mode 100644 mps/qa/function/32.c delete mode 100644 mps/qa/function/33.c delete mode 100644 mps/qa/function/34.c delete mode 100644 mps/qa/function/35.c delete mode 100644 mps/qa/function/36.c delete mode 100644 mps/qa/function/37.c delete mode 100644 mps/qa/function/38.c delete mode 100644 mps/qa/function/39.c delete mode 100644 mps/qa/function/4.c delete mode 100644 mps/qa/function/40.c delete mode 100644 mps/qa/function/41.c delete mode 100644 mps/qa/function/42.c delete mode 100644 mps/qa/function/43.c delete mode 100644 mps/qa/function/44.c delete mode 100644 mps/qa/function/45.c delete mode 100644 mps/qa/function/46.c delete mode 100644 mps/qa/function/47.c delete mode 100644 mps/qa/function/48.c delete mode 100644 mps/qa/function/49.c delete mode 100644 mps/qa/function/5.c delete mode 100644 mps/qa/function/50.c delete mode 100644 mps/qa/function/500.txt delete mode 100644 mps/qa/function/501.txt delete mode 100644 mps/qa/function/502.txt delete mode 100644 mps/qa/function/503.txt delete mode 100644 mps/qa/function/504.txt delete mode 100644 mps/qa/function/505.txt delete mode 100644 mps/qa/function/506.txt delete mode 100644 mps/qa/function/51.c delete mode 100644 mps/qa/function/52.c delete mode 100644 mps/qa/function/53.c delete mode 100644 mps/qa/function/54.c delete mode 100644 mps/qa/function/55.c delete mode 100644 mps/qa/function/56.c delete mode 100644 mps/qa/function/57.c delete mode 100644 mps/qa/function/6.c delete mode 100644 mps/qa/function/60.c delete mode 100644 mps/qa/function/61.c delete mode 100644 mps/qa/function/62.c delete mode 100644 mps/qa/function/63.c delete mode 100644 mps/qa/function/64.c delete mode 100644 mps/qa/function/65.c delete mode 100644 mps/qa/function/66.c delete mode 100644 mps/qa/function/67.c delete mode 100644 mps/qa/function/68.c delete mode 100644 mps/qa/function/69.c delete mode 100644 mps/qa/function/7.c delete mode 100644 mps/qa/function/70.c delete mode 100644 mps/qa/function/71.c delete mode 100644 mps/qa/function/72.c delete mode 100644 mps/qa/function/73.c delete mode 100644 mps/qa/function/74.c delete mode 100644 mps/qa/function/75.c delete mode 100644 mps/qa/function/76.c delete mode 100644 mps/qa/function/77.c delete mode 100644 mps/qa/function/78.c delete mode 100644 mps/qa/function/79.c delete mode 100644 mps/qa/function/8.c delete mode 100644 mps/qa/function/80.c delete mode 100644 mps/qa/function/81.c delete mode 100644 mps/qa/function/82.c delete mode 100644 mps/qa/function/83.c delete mode 100644 mps/qa/function/84.c delete mode 100644 mps/qa/function/85.c delete mode 100644 mps/qa/function/86.c delete mode 100644 mps/qa/function/87.c delete mode 100644 mps/qa/function/88.c delete mode 100644 mps/qa/function/89.c delete mode 100644 mps/qa/function/9.c delete mode 100644 mps/qa/function/90.c delete mode 100644 mps/qa/function/91.c delete mode 100644 mps/qa/function/92.c delete mode 100644 mps/qa/function/93.c delete mode 100644 mps/qa/function/94.c delete mode 100644 mps/qa/function/95.c delete mode 100644 mps/qa/function/96.c delete mode 100644 mps/qa/function/97.c delete mode 100644 mps/qa/function/98.c delete mode 100644 mps/qa/function/99.c delete mode 100644 mps/qa/misc/0.c delete mode 100644 mps/qa/misc/1.c delete mode 100644 mps/qa/misc/2.c delete mode 100644 mps/qa/test/README delete mode 100644 mps/qa/test/qa delete mode 100644 mps/qa/test/script/clib delete mode 100644 mps/qa/test/script/commands/clib delete mode 100644 mps/qa/test/script/commands/help delete mode 100644 mps/qa/test/script/commands/index delete mode 100644 mps/qa/test/script/commands/options delete mode 100644 mps/qa/test/script/commands/run delete mode 100644 mps/qa/test/script/commands/runset delete mode 100644 mps/qa/test/script/commands/try delete mode 100644 mps/qa/test/script/compile delete mode 100644 mps/qa/test/script/dirs delete mode 100644 mps/qa/test/script/display delete mode 100644 mps/qa/test/script/headconv delete mode 100644 mps/qa/test/script/headread delete mode 100644 mps/qa/test/script/help/clib delete mode 100644 mps/qa/test/script/help/index delete mode 100644 mps/qa/test/script/help/install delete mode 100644 mps/qa/test/script/help/naming delete mode 100644 mps/qa/test/script/help/options delete mode 100644 mps/qa/test/script/help/output delete mode 100644 mps/qa/test/script/help/problems delete mode 100644 mps/qa/test/script/help/run delete mode 100644 mps/qa/test/script/help/runset delete mode 100644 mps/qa/test/script/init delete mode 100644 mps/qa/test/script/logging delete mode 100644 mps/qa/test/script/options delete mode 100644 mps/qa/test/script/optproc delete mode 100644 mps/qa/test/script/platform delete mode 100644 mps/qa/test/script/require delete mode 100644 mps/qa/test/script/runtest delete mode 100644 mps/qa/test/script/useful delete mode 100644 mps/qa/test/script/version delete mode 100644 mps/qa/test/testlib/arg.h delete mode 100644 mps/qa/test/testlib/assumed delete mode 100644 mps/qa/test/testlib/awlfmt.c delete mode 100644 mps/qa/test/testlib/awlfmt.h delete mode 100644 mps/qa/test/testlib/epvmfmt.c delete mode 100644 mps/qa/test/testlib/epvmfmt.h delete mode 100644 mps/qa/test/testlib/exfmt.c delete mode 100644 mps/qa/test/testlib/exfmt.h delete mode 100644 mps/qa/test/testlib/fastfmt.c delete mode 100644 mps/qa/test/testlib/fastfmt.h delete mode 100644 mps/qa/test/testlib/lofmt.c delete mode 100644 mps/qa/test/testlib/lofmt.h delete mode 100644 mps/qa/test/testlib/manifest delete mode 100644 mps/qa/test/testlib/myfmt.c delete mode 100644 mps/qa/test/testlib/myfmt.h delete mode 100644 mps/qa/test/testlib/newfmt.c delete mode 100644 mps/qa/test/testlib/newfmt.h delete mode 100644 mps/qa/test/testlib/ossu.h delete mode 100644 mps/qa/test/testlib/platform.c delete mode 100644 mps/qa/test/testlib/platform.h delete mode 100644 mps/qa/test/testlib/postBQ.h delete mode 100644 mps/qa/test/testlib/postGR.h delete mode 100644 mps/qa/test/testlib/postHU.h delete mode 100644 mps/qa/test/testlib/postMO.h delete mode 100644 mps/qa/test/testlib/preBQ.h delete mode 100644 mps/qa/test/testlib/preGR.h delete mode 100644 mps/qa/test/testlib/preHU.h delete mode 100644 mps/qa/test/testlib/preMO.h delete mode 100644 mps/qa/test/testlib/rankfmt.c delete mode 100644 mps/qa/test/testlib/rankfmt.h delete mode 100644 mps/qa/test/testlib/testlib.c delete mode 100644 mps/qa/test/testlib/testlib.h delete mode 100644 mps/qa/test/testlib/versind.h delete mode 100644 mps/qa/testsets/daily delete mode 100644 mps/qa/testsets/dailydw delete mode 100644 mps/qa/testsets/dailysw delete mode 100644 mps/qa/testsets/dailyswa delete mode 100644 mps/qa/testsets/dylan1 delete mode 100644 mps/qa/testsets/perfsw delete mode 100644 mps/src/mpstd.h diff --git a/mps/qa/argerr/0.c b/mps/qa/argerr/0.c deleted file mode 100644 index 7033d575b09..00000000000 --- a/mps/qa/argerr/0.c +++ /dev/null @@ -1,23 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = create a space with a NULL space_t - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -static void test(void) -{ - adie(mps_space_create(NULL), - "Create space"); -} - -int main(void) -{ - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/1.c b/mps/qa/argerr/1.c deleted file mode 100644 index 550f99e42ae..00000000000 --- a/mps/qa/argerr/1.c +++ /dev/null @@ -1,23 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = create a space with an unaligned space_t - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -static void test(void) -{ - adie(mps_space_create(UNALIGNED), - "Create space"); -} - -int main(void) -{ - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/10.c b/mps/qa/argerr/10.c deleted file mode 100644 index 0a2066731ae..00000000000 --- a/mps/qa/argerr/10.c +++ /dev/null @@ -1,53 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = null 1st arg to pool_create - language = c - link = testlib.o newfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "newfmt.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - formatcomments = 0; - - adie( - mps_pool_create(NULL, space, mps_class_amc(), format), - "create pool"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/100.c b/mps/qa/argerr/100.c deleted file mode 100644 index 93ebf8ebd3e..00000000000 --- a/mps/qa/argerr/100.c +++ /dev/null @@ -1,38 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = null &root_t for mps_root_create_table - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - mps_addr_t a[30]; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie(mps_root_create_table(NULL, space, - MPS_RANK_AMBIG, 0, a, sizeof a), - "root create"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/101.c b/mps/qa/argerr/101.c deleted file mode 100644 index 8ea8f72c4b8..00000000000 --- a/mps/qa/argerr/101.c +++ /dev/null @@ -1,38 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = UNALIGNED &root_t for mps_root_create_table - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - mps_addr_t a[30]; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie(mps_root_create_table(UNALIGNED, space, - MPS_RANK_AMBIG, 0, a, sizeof a), - "root create"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/102.c b/mps/qa/argerr/102.c deleted file mode 100644 index 6f14179dd2a..00000000000 --- a/mps/qa/argerr/102.c +++ /dev/null @@ -1,39 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = null space for mps_root_create_table - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - mps_root_t root; - mps_addr_t a[30]; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie(mps_root_create_table(&root, NULL, - MPS_RANK_AMBIG, 0, a, sizeof a), - "root create"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/103.c b/mps/qa/argerr/103.c deleted file mode 100644 index e523c03366a..00000000000 --- a/mps/qa/argerr/103.c +++ /dev/null @@ -1,39 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = UNALIGNED space for mps_root_create_table - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - mps_root_t root; - mps_addr_t a[30]; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie(mps_root_create_table(&root, UNALIGNED, - MPS_RANK_AMBIG, 0, a, sizeof a), - "root create"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/104.c b/mps/qa/argerr/104.c deleted file mode 100644 index 7f9e4b708df..00000000000 --- a/mps/qa/argerr/104.c +++ /dev/null @@ -1,39 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = MIN-1 rank for mps_root_create_table - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - mps_root_t root; - mps_addr_t a[30]; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie(mps_root_create_table(&root, space, - MPS_RANK_MIN-1, 0, a, sizeof a), - "root create"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/105.c b/mps/qa/argerr/105.c deleted file mode 100644 index 8adf02d0381..00000000000 --- a/mps/qa/argerr/105.c +++ /dev/null @@ -1,39 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = MAX+1 rank for mps_root_create_table - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - mps_root_t root; - mps_addr_t a[30]; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie(mps_root_create_table(&root, space, - MPS_RANK_MAX+1, 0, a, sizeof a), - "root create"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/106.c b/mps/qa/argerr/106.c deleted file mode 100644 index ebe918bf5fc..00000000000 --- a/mps/qa/argerr/106.c +++ /dev/null @@ -1,39 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = highbit set rank for mps_root_create_table - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - mps_root_t root; - mps_addr_t a[30]; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie(mps_root_create_table(&root, space, - HIGHBIT_INT+MPS_RANK_AMBIG, 0, a, sizeof a), - "root create"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/107.c b/mps/qa/argerr/107.c deleted file mode 100644 index 8f0290fad6d..00000000000 --- a/mps/qa/argerr/107.c +++ /dev/null @@ -1,39 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = MIN-1 root mode for mps_root_create_table - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - mps_root_t root; - mps_addr_t a[30]; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie(mps_root_create_table(&root, space, - MPS_RANK_AMBIG, MPS_RM_MIN-1, a, sizeof a), - "root create"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/108.c b/mps/qa/argerr/108.c deleted file mode 100644 index 11f1d98f0cb..00000000000 --- a/mps/qa/argerr/108.c +++ /dev/null @@ -1,39 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = MAX+1 root mode for mps_root_create_table - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - mps_root_t root; - mps_addr_t a[30]; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie(mps_root_create_table(&root, space, - MPS_RANK_AMBIG, MPS_RM_MAX+1, a, sizeof a), - "root create"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/109.c b/mps/qa/argerr/109.c deleted file mode 100644 index de04f3f932a..00000000000 --- a/mps/qa/argerr/109.c +++ /dev/null @@ -1,39 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = highbit set root mode for mps_root_create_table - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - mps_root_t root; - mps_addr_t a[30]; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie(mps_root_create_table(&root, space, - MPS_RANK_AMBIG, HIGHBIT_INT, a, sizeof a), - "root create"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/11.c b/mps/qa/argerr/11.c deleted file mode 100644 index 3bcb028979e..00000000000 --- a/mps/qa/argerr/11.c +++ /dev/null @@ -1,53 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = UNALIGNED 1st arg to pool_create - language = c - link = testlib.o newfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "newfmt.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - formatcomments = 0; - - adie( - mps_pool_create(UNALIGNED, space, mps_class_amc(), format), - "create pool"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/110.c b/mps/qa/argerr/110.c deleted file mode 100644 index 417fd9a1c52..00000000000 --- a/mps/qa/argerr/110.c +++ /dev/null @@ -1,39 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = NULL base for mps_root_create_table - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - mps_root_t root; - mps_addr_t a[30]; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie(mps_root_create_table(&root, space, - MPS_RANK_AMBIG, 0, NULL, sizeof a), - "root create"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/111.c b/mps/qa/argerr/111.c deleted file mode 100644 index dfbdb80f56c..00000000000 --- a/mps/qa/argerr/111.c +++ /dev/null @@ -1,39 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = UNALIGNED base for mps_root_create_table - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - mps_root_t root; - mps_addr_t a[30]; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie(mps_root_create_table(&root, space, - MPS_RANK_AMBIG, 0, UNALIGNED, sizeof a), - "root create"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/112.c b/mps/qa/argerr/112.c deleted file mode 100644 index 64bfa232f09..00000000000 --- a/mps/qa/argerr/112.c +++ /dev/null @@ -1,39 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = zero size for mps_root_create_table - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - mps_root_t root; - mps_addr_t a[30]; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie(mps_root_create_table(&root, space, - MPS_RANK_AMBIG, 0, a, (size_t) 0), - "root create"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/113.c b/mps/qa/argerr/113.c deleted file mode 100644 index b56707e00d6..00000000000 --- a/mps/qa/argerr/113.c +++ /dev/null @@ -1,39 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = unaligned size for mps_root_create_table - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - mps_root_t root; - mps_addr_t a[30]; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie(mps_root_create_table(&root, space, - MPS_RANK_AMBIG, 0, a, (size_t) 31), - "root create"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/114.c b/mps/qa/argerr/114.c deleted file mode 100644 index 6ba5d95f4ae..00000000000 --- a/mps/qa/argerr/114.c +++ /dev/null @@ -1,39 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = negative size for mps_root_create_table - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - mps_root_t root; - mps_addr_t a[30]; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie(mps_root_create_table(&root, space, - MPS_RANK_AMBIG, 0, a, (size_t) -32), - "root create"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/115.c b/mps/qa/argerr/115.c deleted file mode 100644 index 413f5545775..00000000000 --- a/mps/qa/argerr/115.c +++ /dev/null @@ -1,44 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = null &root_t for mps_root_create_fmt - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static mps_res_t fmtscan(mps_ss_t ss, - mps_addr_t base, mps_addr_t limit) -{ - return MPS_RES_OK; -} - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - mps_addr_t a[32]; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie(mps_root_create_fmt(NULL, space, MPS_RANK_AMBIG, 0, - fmtscan, a, &a[32]), - "root create"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/116.c b/mps/qa/argerr/116.c deleted file mode 100644 index 1a6cf62c792..00000000000 --- a/mps/qa/argerr/116.c +++ /dev/null @@ -1,44 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = UNALIGNED &root_t for mps_root_create_fmt - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static mps_res_t fmtscan(mps_ss_t ss, - mps_addr_t base, mps_addr_t limit) -{ - return MPS_RES_OK; -} - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - mps_addr_t a[32]; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie(mps_root_create_fmt(UNALIGNED, space, MPS_RANK_AMBIG, 0, - fmtscan, a, &a[32]), - "root create"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/117.c b/mps/qa/argerr/117.c deleted file mode 100644 index 9a5e97d8725..00000000000 --- a/mps/qa/argerr/117.c +++ /dev/null @@ -1,45 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = NULL space for mps_root_create_fmt - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static mps_res_t fmtscan(mps_ss_t ss, - mps_addr_t base, mps_addr_t limit) -{ - return MPS_RES_OK; -} - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - mps_addr_t a[32]; - mps_root_t root; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie(mps_root_create_fmt(&root, NULL, MPS_RANK_AMBIG, 0, - fmtscan, a, &a[32]), - "root create"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/118.c b/mps/qa/argerr/118.c deleted file mode 100644 index 5cc58f76000..00000000000 --- a/mps/qa/argerr/118.c +++ /dev/null @@ -1,45 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = UNALIGNED space for mps_root_create_fmt - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static mps_res_t fmtscan(mps_ss_t ss, - mps_addr_t base, mps_addr_t limit) -{ - return MPS_RES_OK; -} - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - mps_addr_t a[32]; - mps_root_t root; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie(mps_root_create_fmt(&root, UNALIGNED, MPS_RANK_AMBIG, 0, - fmtscan, a, &a[32]), - "root create"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/119.c b/mps/qa/argerr/119.c deleted file mode 100644 index 3386a2ec08c..00000000000 --- a/mps/qa/argerr/119.c +++ /dev/null @@ -1,45 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = MIN-1 rank for mps_root_create_fmt - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static mps_res_t fmtscan(mps_ss_t ss, - mps_addr_t base, mps_addr_t limit) -{ - return MPS_RES_OK; -} - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - mps_addr_t a[32]; - mps_root_t root; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie(mps_root_create_fmt(&root, space, MPS_RANK_MIN-1, 0, - fmtscan, a, &a[32]), - "root create"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/12.c b/mps/qa/argerr/12.c deleted file mode 100644 index 3cf21053c5f..00000000000 --- a/mps/qa/argerr/12.c +++ /dev/null @@ -1,54 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = null 2nd arg to pool_create - language = c - link = testlib.o newfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "newfmt.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - formatcomments = 0; - - adie( - mps_pool_create(&pool, NULL, mps_class_amc(), format), - "create pool"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/120.c b/mps/qa/argerr/120.c deleted file mode 100644 index df65c5cb8d9..00000000000 --- a/mps/qa/argerr/120.c +++ /dev/null @@ -1,45 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = MAX+1 rank for mps_root_create_fmt - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static mps_res_t fmtscan(mps_ss_t ss, - mps_addr_t base, mps_addr_t limit) -{ - return MPS_RES_OK; -} - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - mps_addr_t a[32]; - mps_root_t root; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie(mps_root_create_fmt(&root, space, MPS_RANK_MAX+1, 0, - fmtscan, a, &a[32]), - "root create"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/121.c b/mps/qa/argerr/121.c deleted file mode 100644 index ba224f85059..00000000000 --- a/mps/qa/argerr/121.c +++ /dev/null @@ -1,45 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = highbit set rank for mps_root_create_fmt - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static mps_res_t fmtscan(mps_ss_t ss, - mps_addr_t base, mps_addr_t limit) -{ - return MPS_RES_OK; -} - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - mps_addr_t a[32]; - mps_root_t root; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie(mps_root_create_fmt(&root, space, MPS_RANK_AMBIG+HIGHBIT_INT, 0, - fmtscan, a, &a[32]), - "root create"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/122.c b/mps/qa/argerr/122.c deleted file mode 100644 index 2fecc14ea38..00000000000 --- a/mps/qa/argerr/122.c +++ /dev/null @@ -1,45 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = MIN-1 root mode for mps_root_create_fmt - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static mps_res_t fmtscan(mps_ss_t ss, - mps_addr_t base, mps_addr_t limit) -{ - return MPS_RES_OK; -} - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - mps_addr_t a[32]; - mps_root_t root; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie(mps_root_create_fmt(&root, space, MPS_RANK_AMBIG, MPS_RM_MIN-1, - fmtscan, a, &a[32]), - "root create"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/123.c b/mps/qa/argerr/123.c deleted file mode 100644 index b36e879f298..00000000000 --- a/mps/qa/argerr/123.c +++ /dev/null @@ -1,45 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = MAX+1 root mode for mps_root_create_fmt - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static mps_res_t fmtscan(mps_ss_t ss, - mps_addr_t base, mps_addr_t limit) -{ - return MPS_RES_OK; -} - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - mps_addr_t a[32]; - mps_root_t root; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie(mps_root_create_fmt(&root, space, MPS_RANK_AMBIG, MPS_RM_MAX+1, - fmtscan, a, &a[32]), - "root create"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/124.c b/mps/qa/argerr/124.c deleted file mode 100644 index 0ab1996e530..00000000000 --- a/mps/qa/argerr/124.c +++ /dev/null @@ -1,45 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = highbit set root mode for mps_root_create_fmt - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static mps_res_t fmtscan(mps_ss_t ss, - mps_addr_t base, mps_addr_t limit) -{ - return MPS_RES_OK; -} - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - mps_addr_t a[32]; - mps_root_t root; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie(mps_root_create_fmt(&root, space, MPS_RANK_AMBIG, HIGHBIT_INT, - fmtscan, a, &a[32]), - "root create"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/125.c b/mps/qa/argerr/125.c deleted file mode 100644 index 7b706fb97b2..00000000000 --- a/mps/qa/argerr/125.c +++ /dev/null @@ -1,45 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = null base for mps_root_create_fmt - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static mps_res_t fmtscan(mps_ss_t ss, - mps_addr_t base, mps_addr_t limit) -{ - return MPS_RES_OK; -} - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - mps_addr_t a[32]; - mps_root_t root; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie(mps_root_create_fmt(&root, space, MPS_RANK_AMBIG, 0, - fmtscan, NULL, &a[32]), - "root create"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/126.c b/mps/qa/argerr/126.c deleted file mode 100644 index 06cb76ac198..00000000000 --- a/mps/qa/argerr/126.c +++ /dev/null @@ -1,45 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = UNALIGNED base for mps_root_create_fmt - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static mps_res_t fmtscan(mps_ss_t ss, - mps_addr_t base, mps_addr_t limit) -{ - return MPS_RES_OK; -} - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - mps_addr_t a[32]; - mps_root_t root; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie(mps_root_create_fmt(&root, space, MPS_RANK_AMBIG, 0, - fmtscan, UNALIGNED, &a[32]), - "root create"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/127.c b/mps/qa/argerr/127.c deleted file mode 100644 index c031515d83b..00000000000 --- a/mps/qa/argerr/127.c +++ /dev/null @@ -1,45 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = NULL limit for mps_root_create_fmt - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static mps_res_t fmtscan(mps_ss_t ss, - mps_addr_t base, mps_addr_t limit) -{ - return MPS_RES_OK; -} - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - mps_addr_t a[32]; - mps_root_t root; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie(mps_root_create_fmt(&root, space, MPS_RANK_AMBIG, 0, - fmtscan, a, NULL), - "root create"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/128.c b/mps/qa/argerr/128.c deleted file mode 100644 index 59069693215..00000000000 --- a/mps/qa/argerr/128.c +++ /dev/null @@ -1,45 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = UNALIGNED limit for mps_root_create_fmt - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static mps_res_t fmtscan(mps_ss_t ss, - mps_addr_t base, mps_addr_t limit) -{ - return MPS_RES_OK; -} - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - mps_addr_t a[32]; - mps_root_t root; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie(mps_root_create_fmt(&root, space, MPS_RANK_AMBIG, 0, - fmtscan, a, (mps_addr_t)(((char *)(&a[0]))+1)), - "root create"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/129.c b/mps/qa/argerr/129.c deleted file mode 100644 index 1de934ddecb..00000000000 --- a/mps/qa/argerr/129.c +++ /dev/null @@ -1,45 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = limit < base for mps_root_create_fmt - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static mps_res_t fmtscan(mps_ss_t ss, - mps_addr_t base, mps_addr_t limit) -{ - return MPS_RES_OK; -} - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - mps_addr_t a[32]; - mps_root_t root; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie(mps_root_create_fmt(&root, space, MPS_RANK_AMBIG, 0, - fmtscan, &a[10], &a[0]), - "root create"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/13.c b/mps/qa/argerr/13.c deleted file mode 100644 index 517738d4b81..00000000000 --- a/mps/qa/argerr/13.c +++ /dev/null @@ -1,54 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = UNALIGNED 2nd arg to pool_create - language = c - link = testlib.o newfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "newfmt.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - formatcomments = 0; - - adie( - mps_pool_create(&pool, UNALIGNED, mps_class_amc(), format), - "create pool"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/130.c b/mps/qa/argerr/130.c deleted file mode 100644 index af50f4a4d6e..00000000000 --- a/mps/qa/argerr/130.c +++ /dev/null @@ -1,37 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = null &root_t for mps_root_create_reg - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie(mps_root_create_reg(NULL, space, MPS_RANK_AMBIG, 0, - thread, mps_stack_scan_ambig, stackpointer, 0), - "root create"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/131.c b/mps/qa/argerr/131.c deleted file mode 100644 index d3bb1d89f74..00000000000 --- a/mps/qa/argerr/131.c +++ /dev/null @@ -1,37 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = UNALIGNED &root_t for mps_root_create_reg - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie(mps_root_create_reg(UNALIGNED, space, MPS_RANK_AMBIG, 0, - thread, mps_stack_scan_ambig, stackpointer, 0), - "root create"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/132.c b/mps/qa/argerr/132.c deleted file mode 100644 index 0e0751e6fb0..00000000000 --- a/mps/qa/argerr/132.c +++ /dev/null @@ -1,38 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = null space for mps_root_create_reg - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - mps_root_t root; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie(mps_root_create_reg(&root, NULL, MPS_RANK_AMBIG, 0, - thread, mps_stack_scan_ambig, stackpointer, 0), - "root create"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/133.c b/mps/qa/argerr/133.c deleted file mode 100644 index 20bec1b0291..00000000000 --- a/mps/qa/argerr/133.c +++ /dev/null @@ -1,38 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = UNALIGNED space for mps_root_create_reg - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - mps_root_t root; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie(mps_root_create_reg(&root, UNALIGNED, MPS_RANK_AMBIG, 0, - thread, mps_stack_scan_ambig, stackpointer, 0), - "root create"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/134.c b/mps/qa/argerr/134.c deleted file mode 100644 index e699854ce54..00000000000 --- a/mps/qa/argerr/134.c +++ /dev/null @@ -1,38 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = < AMBIG rank for mps_root_create_reg (with stack scan ambig) - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - mps_root_t root; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie(mps_root_create_reg(&root, space, MPS_RANK_AMBIG-1, 0, - thread, mps_stack_scan_ambig, stackpointer, 0), - "root create"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/135.c b/mps/qa/argerr/135.c deleted file mode 100644 index e3b19e926aa..00000000000 --- a/mps/qa/argerr/135.c +++ /dev/null @@ -1,38 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = > AMBIG rank for mps_root_create_reg (with stack scan ambig) - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - mps_root_t root; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie(mps_root_create_reg(&root, space, MPS_RANK_AMBIG+1, 0, - thread, mps_stack_scan_ambig, stackpointer, 0), - "root create"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/136.c b/mps/qa/argerr/136.c deleted file mode 100644 index 330be15b33f..00000000000 --- a/mps/qa/argerr/136.c +++ /dev/null @@ -1,39 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = highbit set rank for mps_root_create_reg (with stack scan ambig) - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - mps_root_t root; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie(mps_root_create_reg(&root, space, MPS_RANK_AMBIG+HIGHBIT_INT, - 0, - thread, mps_stack_scan_ambig, stackpointer, 0), - "root create"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/137.c b/mps/qa/argerr/137.c deleted file mode 100644 index c1fd3225165..00000000000 --- a/mps/qa/argerr/137.c +++ /dev/null @@ -1,39 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = MIN-1 root mode for mps_root_create_reg (with stack scan ambig) - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - mps_root_t root; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie(mps_root_create_reg(&root, space, MPS_RANK_AMBIG, - MPS_RM_MIN-1, - thread, mps_stack_scan_ambig, stackpointer, 0), - "root create"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/138.c b/mps/qa/argerr/138.c deleted file mode 100644 index f7c3b201054..00000000000 --- a/mps/qa/argerr/138.c +++ /dev/null @@ -1,39 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = MAX+1 root mode for mps_root_create_reg (with stack scan ambig) - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - mps_root_t root; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie(mps_root_create_reg(&root, space, MPS_RANK_AMBIG, - MPS_RM_MAX+1, - thread, mps_stack_scan_ambig, stackpointer, 0), - "root create"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/139.c b/mps/qa/argerr/139.c deleted file mode 100644 index 637a6f4251d..00000000000 --- a/mps/qa/argerr/139.c +++ /dev/null @@ -1,39 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = highbit set root mode for mps_root_create_reg (with stack scan ambig) - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - mps_root_t root; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie(mps_root_create_reg(&root, space, MPS_RANK_AMBIG, - HIGHBIT_INT, - thread, mps_stack_scan_ambig, stackpointer, 0), - "root create"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/14.c b/mps/qa/argerr/14.c deleted file mode 100644 index 476c511ff06..00000000000 --- a/mps/qa/argerr/14.c +++ /dev/null @@ -1,54 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = NULL 3rd arg to pool_create - language = c - link = testlib.o newfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "newfmt.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - formatcomments = 0; - - adie( - mps_pool_create(&pool, space, NULL, format), - "create pool"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/140.c b/mps/qa/argerr/140.c deleted file mode 100644 index c5a92c5bb0f..00000000000 --- a/mps/qa/argerr/140.c +++ /dev/null @@ -1,38 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = null thread for mps_root_create_reg - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - mps_root_t root; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie(mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, - NULL, mps_stack_scan_ambig, stackpointer, 0), - "root create"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/141.c b/mps/qa/argerr/141.c deleted file mode 100644 index b368eb35f76..00000000000 --- a/mps/qa/argerr/141.c +++ /dev/null @@ -1,38 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = UNALIGNED thread for mps_root_create_reg - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - mps_root_t root; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie(mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, - UNALIGNED, mps_stack_scan_ambig, stackpointer, 0), - "root create"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/142.c b/mps/qa/argerr/142.c deleted file mode 100644 index 26261a32093..00000000000 --- a/mps/qa/argerr/142.c +++ /dev/null @@ -1,38 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = null stackpointer for mps_root_create_reg - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - mps_root_t root; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie(mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, - thread, mps_stack_scan_ambig, NULL, 0), - "root create"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/143.c b/mps/qa/argerr/143.c deleted file mode 100644 index b2d41a058ad..00000000000 --- a/mps/qa/argerr/143.c +++ /dev/null @@ -1,38 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = UNALIGNED stackpointer for mps_root_create_reg - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - mps_root_t root; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie(mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, - thread, mps_stack_scan_ambig, UNALIGNED, 0), - "root create"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/144.c b/mps/qa/argerr/144.c deleted file mode 100644 index 90e37fd705a..00000000000 --- a/mps/qa/argerr/144.c +++ /dev/null @@ -1,35 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = null root_t for mps_root_destroy - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - mps_root_destroy(NULL); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/145.c b/mps/qa/argerr/145.c deleted file mode 100644 index e6f326927b8..00000000000 --- a/mps/qa/argerr/145.c +++ /dev/null @@ -1,35 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = UNALIGNED root_t for mps_root_destroy - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - mps_root_destroy(UNALIGNED); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/146.c b/mps/qa/argerr/146.c deleted file mode 100644 index 523ec8ca9a0..00000000000 --- a/mps/qa/argerr/146.c +++ /dev/null @@ -1,489 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = null scan state to fix (function) - language = c - link = testlib.o newfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "arg.h" - -/* what follows is hacked from newfmt.c -*/ - -#include "mps.h" -#include "newfmt.h" - -/* tags */ - -enum {MCpadsingle, MCpadmany, MCheart, MCdata}; - -/* some options on the format are controlled by global - variables. Of course for efficiency we'd do it in the - pre-processor, but that would require recompilation... - - variable default function - - formatcomments 1 print comments on scanning, fixing, copying - checkcomments 1 print comments on checking - -*/ - -int formatcomments=0; -int checkcomments=0; -int countcomments=1; -int alloccomments=0; - -int nextid=1000000; - -enum -{ - SCANCALL_COUNT, - SCANOBJ_COUNT, /* = #objects scanned (real ones, that is) */ - SCANPS_COUNT, /* = #pad singles scanned */ - SCANPM_COUNT, /* etc ... */ - SCANHEART_COUNT, - COPY_COUNT, - SKIP_COUNT, - FWD_COUNT, - ISFWD_COUNT, - RESERVE_COUNT, - ALLOC_COUNT, - PAD_SINGLE_COUNT, - PAD_MULTI_COUNT -}; - -int counters[PAD_MULTI_COUNT+1]; -int prevcounters[PAD_MULTI_COUNT+1]; -int maxcounters[PAD_MULTI_COUNT+1] = {0}; - -static long int maxcopy = 0; -static int freeze=0; - -#define INCCOUNT(c) if(!freeze) counters[c]+=1 - -#define MAXSIZE 10000 - -/* a cell can be one of four things, depending on its type: - MCpadsingle - a single pad item, MPS_PF_ALIGN in size - MCpadmulti - a longer pad item, at least 2*MPS_PF_ALIGN in size - MCheart - a broken heart, aka forwarding object - MCdata - a real object -*/ - -typedef int tag; - -/* typedef union mycell mycell; - (it's in the header) -*/ - -struct padsingle {tag tag;}; - -struct padmulti {tag tag; mps_addr_t next;}; - -struct heart {tag tag; size_t size; mps_addr_t obj;}; - -struct data -{ - tag tag; - size_t size; - long int id; - long int copycount; - long int numrefs; - int checkedflag; - struct refitem {mycell *addr; long int id;} ref[MAXSIZE]; -}; - -union mycell -{ - tag tag; - struct padsingle padsingle; - struct padmulti padmulti; - struct heart heart; - struct data data; -}; - -/* the scanning function doesn't try to fix null refs - - size is the total size of the object in bytes - every other word from ref onwards, including the word - at ref, is a reference; after each one comes the id - of the object referenced, so we can check the graph is - correct later! - -nb: This way of doing things is not really guaranteed to work - on all systems. It would be more correct to use an array - of structures, or an array of unions. -*/ - -static mps_res_t myscan(mps_ss_t ss, mps_addr_t base, mps_addr_t limit); -static mps_addr_t myskip(mps_addr_t object); -static void myfwd(mps_addr_t object, mps_addr_t to); -static mps_addr_t myisfwd(mps_addr_t object); -static void mycopy(mps_addr_t object, mps_addr_t to); -static void mypad(mps_addr_t base, size_t size); - -struct mps_fmt_A_s fmtA = -{ - MPS_PF_ALIGN, - &myscan, - &myskip, - &mycopy, - &myfwd, - &myisfwd, - &mypad -}; - -/* in the following, size is the number of refs you want - the allocated object to have -*/ - -mycell *allocdumb(mps_ap_t ap, size_t size) -{ - mps_addr_t p; - mycell *q; - size_t bytes; - size_t alignment; - - bytes = offsetof(struct data, ref) + size; - - alignment = MPS_PF_ALIGN; /* needed to make it as wide as size_t */ - -/* twiddle the value of size to make it aligned */ - bytes = (bytes+alignment-1) & ~(alignment-1); - - do - { - die(mps_reserve(&p, ap, bytes), "Reserve: "); - INCCOUNT(RESERVE_COUNT); - q=p; - q->data.tag = MCdata; - q->data.id = nextid; - q->data.copycount = 0; - q->data.numrefs = 0; - q->data.checkedflag = 0; - q->data.size = bytes; - } - while (!mps_commit(ap, p, bytes)); - INCCOUNT(ALLOC_COUNT); - commentif(alloccomments, "allocated id %li at %p.", nextid, q); - nextid += 1; - - return q; -} - -mycell *allocone(mps_ap_t ap, int size) -{ - mps_addr_t p; - mycell *q; - int i; - size_t bytes; - size_t alignment; - - bytes = offsetof(struct data, ref) + size*sizeof(struct refitem); - - alignment = MPS_PF_ALIGN; /* needed to make it as wide as size_t */ - -/* twiddle the value of size to make it aligned */ - bytes = (bytes+alignment-1) & ~(alignment-1); - - do - { - die(mps_reserve(&p, ap, bytes), "Reserve: "); - INCCOUNT(RESERVE_COUNT); - q=p; - q->data.tag = MCdata; - q->data.id = nextid; - q->data.copycount = 0; - q->data.numrefs = size; - q->data.checkedflag = 0; - q->data.size = bytes; - - for(i=0; idata.ref[i].addr = NULL; - q->data.ref[i].id = 0; - } - } - while (!mps_commit(ap, p, bytes)); - INCCOUNT(ALLOC_COUNT); - commentif(alloccomments, "allocated id %li at %p.", nextid, q); - nextid += 1; - - return q; -} - -static mps_res_t myscan(mps_ss_t ss, mps_addr_t base, mps_addr_t limit) -{ - int i; - - INCCOUNT(SCANCALL_COUNT); - MPS_SCAN_BEGIN(ss) - { - while (base < limit) - { - mycell *obj = base; - mps_res_t res; - mps_addr_t p; - - commentif(formatcomments, "scan %p.\n", base); - switch (obj->tag) - { - case MCpadsingle: - INCCOUNT(SCANPS_COUNT); - base = (mps_addr_t) ((char *) obj + sizeof(obj->padsingle)); - break; - case MCpadmany: - INCCOUNT(SCANPM_COUNT); - base = (obj->padmulti.next); - break; - case MCdata: - INCCOUNT(SCANOBJ_COUNT); - /* actual scanning is done in here */ - - for (i=0; i<(obj->data.numrefs); i++) - { - p = obj->data.ref[i].addr; - if (p != NULL) - { - commentif(formatcomments, "fix: %d=%p.\n", i, p); - - /* copy ref to p for fixing, to avoid a pun (although - the pun would probably work fine almost everywhere) - */ - comment("About to fix with null scan state..."); - res = mps_fix(NULL, (mps_addr_t *) &p); - error("fix with NULL scan state"); - if (res != MPS_RES_OK) return res; - obj->data.ref[i].addr = p; - } - } - base = (mps_addr_t) ((char *) obj + (obj->data.size)); - break; - case MCheart: - INCCOUNT(SCANHEART_COUNT); - base = (mps_addr_t) ((char *) obj + (obj->heart.size)); - break; - default: - asserts(0, "scan: bizarre obj tag at %p.", obj); - } - } - } - MPS_SCAN_END(ss); - return MPS_RES_OK; -} - -static mps_addr_t myskip(mps_addr_t object) -{ - mycell *obj = object; - - INCCOUNT(SKIP_COUNT); - switch(obj->tag) - { - case MCpadsingle: - return (mps_addr_t) ((char *) obj + sizeof(obj->padsingle)); - case MCpadmany: - return obj->padmulti.next; - case MCheart: - return (mps_addr_t) ((char *) obj + (obj->heart.size)); - case MCdata: - return (mps_addr_t) ((char *) obj + (obj->data.size)); - default: - asserts(0, "skip: bizarre obj tag at %p.", obj); - return 0; /* not reached */ - } -} - -static void mycopy(mps_addr_t object, mps_addr_t to) -{ - mycell *boj = object; - mycell *toj = to; - - asserts(boj->tag = MCdata, "copy: non-data object"); - - INCCOUNT(COPY_COUNT); - commentif(formatcomments, "copy: %p -> %p\n", object, to); - -/* this line would be bad, because the objects might overlap, - and then C doesn't guarantee to do the right thing! - - *toj = *boj; -*/ - - memmove(to, object, boj->data.size); - if (!freeze) - { - toj->data.copycount = (toj->data.copycount)+1; - if (toj->data.copycount > maxcopy) maxcopy = toj->data.copycount; - } -} - -/* pad stores not its size but a pointer to the next object, - because we know we'll never be asked to copy it -*/ - -static void mypad(mps_addr_t base, size_t size) -{ - mycell *obj = base; - - asserts(size >= MPS_PF_ALIGN, "pad: size too small."); - - if (size == MPS_PF_ALIGN) - { - INCCOUNT(PAD_SINGLE_COUNT); - obj->padsingle.tag = MCpadsingle; - } - else - { - asserts(size >= sizeof(struct padmulti), "pad: awkward size."); - INCCOUNT(PAD_MULTI_COUNT); - obj->padmulti.tag = MCpadmany; - obj->padmulti.next = (mps_addr_t) ((char *) base + size); - } -} - -static mps_addr_t myisfwd(mps_addr_t object) -{ - mycell *obj = object; - - INCCOUNT(ISFWD_COUNT); - if (obj->tag != MCheart) - { - return NULL; - } - else - { - return obj->heart.obj; - } -} - -static void myfwd(mps_addr_t object, mps_addr_t to) -{ - mycell *obj = object; - size_t size; - - asserts(obj->tag == MCdata || obj->tag == MCheart, - "fwd: unexpected object tag at %p.", obj); - INCCOUNT(FWD_COUNT); - - if (obj->tag == MCdata) - { - size = obj->data.size; - } - else /* obj->tag == MCheart */ - { - size = obj->heart.size; - } - obj->data.tag = MCheart; - obj->heart.obj = to; - obj->heart.size = size; -} - - -/* --------------------------------------------------------------- - Access methods for mycell objects -*/ - -/* set the nth reference of obj to to (n from 0 to size-1) */ - -void setref(mycell *obj, int n, mycell *to) -{ - asserts(obj->tag = MCdata, "setref: from non-data object."); - asserts(to->tag = MCdata, "setref: to non-data object."); - asserts(obj->data.numrefs > n, "setref: access beyond object size."); - - obj->data.ref[n].addr = to; - obj->data.ref[n].id = to->data.id; -} - -mycell *getref(mycell *obj, int n) -{ - asserts(obj->tag = MCdata, "getref: from non-data object."); - asserts(obj->data.numrefs > n, "getref: access beyond object size."); - return obj->data.ref[n].addr; -} - -mps_addr_t getdata(mycell *obj) -{ - return (mps_addr_t) &(obj->data.ref[0]); -} - -long int getid(mycell *obj) -{ - asserts(obj->tag = MCdata, "getid: non-data object."); - return obj->data.id; -} - -long int getcopycount(mycell *obj) -{ - asserts(obj->tag = MCdata, "getcopycount: non-data object."); - return obj->data.copycount; -} - -long int getsize(mycell *obj) -{ - asserts(obj->tag = MCdata, "getsize: non-data object."); - return obj->data.numrefs; -} - -/* ---- Now the test itself! ---- */ - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_ap_t ap; - - int j; - mycell *a; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - formatcomments = 0; - - cdie( - mps_pool_create(&pool, space, mps_class_amc(), format), - "create pool"); - - cdie( - mps_ap_create(&ap, pool, MPS_RANK_EXACT), - "create ap"); - - a = allocone(ap, 100); - setref(a, 0, a); - - for (j=1; j<1000; j++) - { - allocone(ap, 1000); - } - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/147.c b/mps/qa/argerr/147.c deleted file mode 100644 index aca62798987..00000000000 --- a/mps/qa/argerr/147.c +++ /dev/null @@ -1,489 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = unaligned scan state to fix (function) - language = c - link = testlib.o newfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "arg.h" - -/* what follows is hacked from newfmt.c -*/ - -#include "mps.h" -#include "newfmt.h" - -/* tags */ - -enum {MCpadsingle, MCpadmany, MCheart, MCdata}; - -/* some options on the format are controlled by global - variables. Of course for efficiency we'd do it in the - pre-processor, but that would require recompilation... - - variable default function - - formatcomments 1 print comments on scanning, fixing, copying - checkcomments 1 print comments on checking - -*/ - -int formatcomments=0; -int checkcomments=0; -int countcomments=1; -int alloccomments=0; - -int nextid=1000000; - -enum -{ - SCANCALL_COUNT, - SCANOBJ_COUNT, /* = #objects scanned (real ones, that is) */ - SCANPS_COUNT, /* = #pad singles scanned */ - SCANPM_COUNT, /* etc ... */ - SCANHEART_COUNT, - COPY_COUNT, - SKIP_COUNT, - FWD_COUNT, - ISFWD_COUNT, - RESERVE_COUNT, - ALLOC_COUNT, - PAD_SINGLE_COUNT, - PAD_MULTI_COUNT -}; - -int counters[PAD_MULTI_COUNT+1]; -int prevcounters[PAD_MULTI_COUNT+1]; -int maxcounters[PAD_MULTI_COUNT+1] = {0}; - -static long int maxcopy = 0; -static int freeze=0; - -#define INCCOUNT(c) if(!freeze) counters[c]+=1 - -#define MAXSIZE 10000 - -/* a cell can be one of four things, depending on its type: - MCpadsingle - a single pad item, MPS_PF_ALIGN in size - MCpadmulti - a longer pad item, at least 2*MPS_PF_ALIGN in size - MCheart - a broken heart, aka forwarding object - MCdata - a real object -*/ - -typedef int tag; - -/* typedef union mycell mycell; - (it's in the header) -*/ - -struct padsingle {tag tag;}; - -struct padmulti {tag tag; mps_addr_t next;}; - -struct heart {tag tag; size_t size; mps_addr_t obj;}; - -struct data -{ - tag tag; - size_t size; - long int id; - long int copycount; - long int numrefs; - int checkedflag; - struct refitem {mycell *addr; long int id;} ref[MAXSIZE]; -}; - -union mycell -{ - tag tag; - struct padsingle padsingle; - struct padmulti padmulti; - struct heart heart; - struct data data; -}; - -/* the scanning function doesn't try to fix null refs - - size is the total size of the object in bytes - every other word from ref onwards, including the word - at ref, is a reference; after each one comes the id - of the object referenced, so we can check the graph is - correct later! - -nb: This way of doing things is not really guaranteed to work - on all systems. It would be more correct to use an array - of structures, or an array of unions. -*/ - -static mps_res_t myscan(mps_ss_t ss, mps_addr_t base, mps_addr_t limit); -static mps_addr_t myskip(mps_addr_t object); -static void myfwd(mps_addr_t object, mps_addr_t to); -static mps_addr_t myisfwd(mps_addr_t object); -static void mycopy(mps_addr_t object, mps_addr_t to); -static void mypad(mps_addr_t base, size_t size); - -struct mps_fmt_A_s fmtA = -{ - MPS_PF_ALIGN, - &myscan, - &myskip, - &mycopy, - &myfwd, - &myisfwd, - &mypad -}; - -/* in the following, size is the number of refs you want - the allocated object to have -*/ - -mycell *allocdumb(mps_ap_t ap, size_t size) -{ - mps_addr_t p; - mycell *q; - size_t bytes; - size_t alignment; - - bytes = offsetof(struct data, ref) + size; - - alignment = MPS_PF_ALIGN; /* needed to make it as wide as size_t */ - -/* twiddle the value of size to make it aligned */ - bytes = (bytes+alignment-1) & ~(alignment-1); - - do - { - die(mps_reserve(&p, ap, bytes), "Reserve: "); - INCCOUNT(RESERVE_COUNT); - q=p; - q->data.tag = MCdata; - q->data.id = nextid; - q->data.copycount = 0; - q->data.numrefs = 0; - q->data.checkedflag = 0; - q->data.size = bytes; - } - while (!mps_commit(ap, p, bytes)); - INCCOUNT(ALLOC_COUNT); - commentif(alloccomments, "allocated id %li at %p.", nextid, q); - nextid += 1; - - return q; -} - -mycell *allocone(mps_ap_t ap, int size) -{ - mps_addr_t p; - mycell *q; - int i; - size_t bytes; - size_t alignment; - - bytes = offsetof(struct data, ref) + size*sizeof(struct refitem); - - alignment = MPS_PF_ALIGN; /* needed to make it as wide as size_t */ - -/* twiddle the value of size to make it aligned */ - bytes = (bytes+alignment-1) & ~(alignment-1); - - do - { - die(mps_reserve(&p, ap, bytes), "Reserve: "); - INCCOUNT(RESERVE_COUNT); - q=p; - q->data.tag = MCdata; - q->data.id = nextid; - q->data.copycount = 0; - q->data.numrefs = size; - q->data.checkedflag = 0; - q->data.size = bytes; - - for(i=0; idata.ref[i].addr = NULL; - q->data.ref[i].id = 0; - } - } - while (!mps_commit(ap, p, bytes)); - INCCOUNT(ALLOC_COUNT); - commentif(alloccomments, "allocated id %li at %p.", nextid, q); - nextid += 1; - - return q; -} - -static mps_res_t myscan(mps_ss_t ss, mps_addr_t base, mps_addr_t limit) -{ - int i; - - INCCOUNT(SCANCALL_COUNT); - MPS_SCAN_BEGIN(ss) - { - while (base < limit) - { - mycell *obj = base; - mps_res_t res; - mps_addr_t p; - - commentif(formatcomments, "scan %p.\n", base); - switch (obj->tag) - { - case MCpadsingle: - INCCOUNT(SCANPS_COUNT); - base = (mps_addr_t) ((char *) obj + sizeof(obj->padsingle)); - break; - case MCpadmany: - INCCOUNT(SCANPM_COUNT); - base = (obj->padmulti.next); - break; - case MCdata: - INCCOUNT(SCANOBJ_COUNT); - /* actual scanning is done in here */ - - for (i=0; i<(obj->data.numrefs); i++) - { - p = obj->data.ref[i].addr; - if (p != NULL) - { - commentif(formatcomments, "fix: %d=%p.\n", i, p); - - /* copy ref to p for fixing, to avoid a pun (although - the pun would probably work fine almost everywhere) - */ - comment("About to fix with unaligned scan state..."); - res = mps_fix(UNALIGNED, (mps_addr_t *) &p); - error("fix with unaligned scan state"); - if (res != MPS_RES_OK) return res; - obj->data.ref[i].addr = p; - } - } - base = (mps_addr_t) ((char *) obj + (obj->data.size)); - break; - case MCheart: - INCCOUNT(SCANHEART_COUNT); - base = (mps_addr_t) ((char *) obj + (obj->heart.size)); - break; - default: - asserts(0, "scan: bizarre obj tag at %p.", obj); - } - } - } - MPS_SCAN_END(ss); - return MPS_RES_OK; -} - -static mps_addr_t myskip(mps_addr_t object) -{ - mycell *obj = object; - - INCCOUNT(SKIP_COUNT); - switch(obj->tag) - { - case MCpadsingle: - return (mps_addr_t) ((char *) obj + sizeof(obj->padsingle)); - case MCpadmany: - return obj->padmulti.next; - case MCheart: - return (mps_addr_t) ((char *) obj + (obj->heart.size)); - case MCdata: - return (mps_addr_t) ((char *) obj + (obj->data.size)); - default: - asserts(0, "skip: bizarre obj tag at %p.", obj); - return 0; /* not reached */ - } -} - -static void mycopy(mps_addr_t object, mps_addr_t to) -{ - mycell *boj = object; - mycell *toj = to; - - asserts(boj->tag = MCdata, "copy: non-data object"); - - INCCOUNT(COPY_COUNT); - commentif(formatcomments, "copy: %p -> %p\n", object, to); - -/* this line would be bad, because the objects might overlap, - and then C doesn't guarantee to do the right thing! - - *toj = *boj; -*/ - - memmove(to, object, boj->data.size); - if (!freeze) - { - toj->data.copycount = (toj->data.copycount)+1; - if (toj->data.copycount > maxcopy) maxcopy = toj->data.copycount; - } -} - -/* pad stores not its size but a pointer to the next object, - because we know we'll never be asked to copy it -*/ - -static void mypad(mps_addr_t base, size_t size) -{ - mycell *obj = base; - - asserts(size >= MPS_PF_ALIGN, "pad: size too small."); - - if (size == MPS_PF_ALIGN) - { - INCCOUNT(PAD_SINGLE_COUNT); - obj->padsingle.tag = MCpadsingle; - } - else - { - asserts(size >= sizeof(struct padmulti), "pad: awkward size."); - INCCOUNT(PAD_MULTI_COUNT); - obj->padmulti.tag = MCpadmany; - obj->padmulti.next = (mps_addr_t) ((char *) base + size); - } -} - -static mps_addr_t myisfwd(mps_addr_t object) -{ - mycell *obj = object; - - INCCOUNT(ISFWD_COUNT); - if (obj->tag != MCheart) - { - return NULL; - } - else - { - return obj->heart.obj; - } -} - -static void myfwd(mps_addr_t object, mps_addr_t to) -{ - mycell *obj = object; - size_t size; - - asserts(obj->tag == MCdata || obj->tag == MCheart, - "fwd: unexpected object tag at %p.", obj); - INCCOUNT(FWD_COUNT); - - if (obj->tag == MCdata) - { - size = obj->data.size; - } - else /* obj->tag == MCheart */ - { - size = obj->heart.size; - } - obj->data.tag = MCheart; - obj->heart.obj = to; - obj->heart.size = size; -} - - -/* --------------------------------------------------------------- - Access methods for mycell objects -*/ - -/* set the nth reference of obj to to (n from 0 to size-1) */ - -void setref(mycell *obj, int n, mycell *to) -{ - asserts(obj->tag = MCdata, "setref: from non-data object."); - asserts(to->tag = MCdata, "setref: to non-data object."); - asserts(obj->data.numrefs > n, "setref: access beyond object size."); - - obj->data.ref[n].addr = to; - obj->data.ref[n].id = to->data.id; -} - -mycell *getref(mycell *obj, int n) -{ - asserts(obj->tag = MCdata, "getref: from non-data object."); - asserts(obj->data.numrefs > n, "getref: access beyond object size."); - return obj->data.ref[n].addr; -} - -mps_addr_t getdata(mycell *obj) -{ - return (mps_addr_t) &(obj->data.ref[0]); -} - -long int getid(mycell *obj) -{ - asserts(obj->tag = MCdata, "getid: non-data object."); - return obj->data.id; -} - -long int getcopycount(mycell *obj) -{ - asserts(obj->tag = MCdata, "getcopycount: non-data object."); - return obj->data.copycount; -} - -long int getsize(mycell *obj) -{ - asserts(obj->tag = MCdata, "getsize: non-data object."); - return obj->data.numrefs; -} - -/* ---- Now the test itself! ---- */ - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_ap_t ap; - - int j; - mycell *a; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - formatcomments = 0; - - cdie( - mps_pool_create(&pool, space, mps_class_amc(), format), - "create pool"); - - cdie( - mps_ap_create(&ap, pool, MPS_RANK_EXACT), - "create ap"); - - a = allocone(ap, 100); - setref(a, 0, a); - - for (j=1; j<1000; j++) - { - allocone(ap, 1000); - } - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/148.c b/mps/qa/argerr/148.c deleted file mode 100644 index fe5508bdf51..00000000000 --- a/mps/qa/argerr/148.c +++ /dev/null @@ -1,489 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = null addr to fix (function) - language = c - link = testlib.o newfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "arg.h" - -/* what follows is hacked from newfmt.c -*/ - -#include "mps.h" -#include "newfmt.h" - -/* tags */ - -enum {MCpadsingle, MCpadmany, MCheart, MCdata}; - -/* some options on the format are controlled by global - variables. Of course for efficiency we'd do it in the - pre-processor, but that would require recompilation... - - variable default function - - formatcomments 1 print comments on scanning, fixing, copying - checkcomments 1 print comments on checking - -*/ - -int formatcomments=0; -int checkcomments=0; -int countcomments=1; -int alloccomments=0; - -int nextid=1000000; - -enum -{ - SCANCALL_COUNT, - SCANOBJ_COUNT, /* = #objects scanned (real ones, that is) */ - SCANPS_COUNT, /* = #pad singles scanned */ - SCANPM_COUNT, /* etc ... */ - SCANHEART_COUNT, - COPY_COUNT, - SKIP_COUNT, - FWD_COUNT, - ISFWD_COUNT, - RESERVE_COUNT, - ALLOC_COUNT, - PAD_SINGLE_COUNT, - PAD_MULTI_COUNT -}; - -int counters[PAD_MULTI_COUNT+1]; -int prevcounters[PAD_MULTI_COUNT+1]; -int maxcounters[PAD_MULTI_COUNT+1] = {0}; - -static long int maxcopy = 0; -static int freeze=0; - -#define INCCOUNT(c) if(!freeze) counters[c]+=1 - -#define MAXSIZE 10000 - -/* a cell can be one of four things, depending on its type: - MCpadsingle - a single pad item, MPS_PF_ALIGN in size - MCpadmulti - a longer pad item, at least 2*MPS_PF_ALIGN in size - MCheart - a broken heart, aka forwarding object - MCdata - a real object -*/ - -typedef int tag; - -/* typedef union mycell mycell; - (it's in the header) -*/ - -struct padsingle {tag tag;}; - -struct padmulti {tag tag; mps_addr_t next;}; - -struct heart {tag tag; size_t size; mps_addr_t obj;}; - -struct data -{ - tag tag; - size_t size; - long int id; - long int copycount; - long int numrefs; - int checkedflag; - struct refitem {mycell *addr; long int id;} ref[MAXSIZE]; -}; - -union mycell -{ - tag tag; - struct padsingle padsingle; - struct padmulti padmulti; - struct heart heart; - struct data data; -}; - -/* the scanning function doesn't try to fix null refs - - size is the total size of the object in bytes - every other word from ref onwards, including the word - at ref, is a reference; after each one comes the id - of the object referenced, so we can check the graph is - correct later! - -nb: This way of doing things is not really guaranteed to work - on all systems. It would be more correct to use an array - of structures, or an array of unions. -*/ - -static mps_res_t myscan(mps_ss_t ss, mps_addr_t base, mps_addr_t limit); -static mps_addr_t myskip(mps_addr_t object); -static void myfwd(mps_addr_t object, mps_addr_t to); -static mps_addr_t myisfwd(mps_addr_t object); -static void mycopy(mps_addr_t object, mps_addr_t to); -static void mypad(mps_addr_t base, size_t size); - -struct mps_fmt_A_s fmtA = -{ - MPS_PF_ALIGN, - &myscan, - &myskip, - &mycopy, - &myfwd, - &myisfwd, - &mypad -}; - -/* in the following, size is the number of refs you want - the allocated object to have -*/ - -mycell *allocdumb(mps_ap_t ap, size_t size) -{ - mps_addr_t p; - mycell *q; - size_t bytes; - size_t alignment; - - bytes = offsetof(struct data, ref) + size; - - alignment = MPS_PF_ALIGN; /* needed to make it as wide as size_t */ - -/* twiddle the value of size to make it aligned */ - bytes = (bytes+alignment-1) & ~(alignment-1); - - do - { - die(mps_reserve(&p, ap, bytes), "Reserve: "); - INCCOUNT(RESERVE_COUNT); - q=p; - q->data.tag = MCdata; - q->data.id = nextid; - q->data.copycount = 0; - q->data.numrefs = 0; - q->data.checkedflag = 0; - q->data.size = bytes; - } - while (!mps_commit(ap, p, bytes)); - INCCOUNT(ALLOC_COUNT); - commentif(alloccomments, "allocated id %li at %p.", nextid, q); - nextid += 1; - - return q; -} - -mycell *allocone(mps_ap_t ap, int size) -{ - mps_addr_t p; - mycell *q; - int i; - size_t bytes; - size_t alignment; - - bytes = offsetof(struct data, ref) + size*sizeof(struct refitem); - - alignment = MPS_PF_ALIGN; /* needed to make it as wide as size_t */ - -/* twiddle the value of size to make it aligned */ - bytes = (bytes+alignment-1) & ~(alignment-1); - - do - { - die(mps_reserve(&p, ap, bytes), "Reserve: "); - INCCOUNT(RESERVE_COUNT); - q=p; - q->data.tag = MCdata; - q->data.id = nextid; - q->data.copycount = 0; - q->data.numrefs = size; - q->data.checkedflag = 0; - q->data.size = bytes; - - for(i=0; idata.ref[i].addr = NULL; - q->data.ref[i].id = 0; - } - } - while (!mps_commit(ap, p, bytes)); - INCCOUNT(ALLOC_COUNT); - commentif(alloccomments, "allocated id %li at %p.", nextid, q); - nextid += 1; - - return q; -} - -static mps_res_t myscan(mps_ss_t ss, mps_addr_t base, mps_addr_t limit) -{ - int i; - - INCCOUNT(SCANCALL_COUNT); - MPS_SCAN_BEGIN(ss) - { - while (base < limit) - { - mycell *obj = base; - mps_res_t res; - mps_addr_t p; - - commentif(formatcomments, "scan %p.\n", base); - switch (obj->tag) - { - case MCpadsingle: - INCCOUNT(SCANPS_COUNT); - base = (mps_addr_t) ((char *) obj + sizeof(obj->padsingle)); - break; - case MCpadmany: - INCCOUNT(SCANPM_COUNT); - base = (obj->padmulti.next); - break; - case MCdata: - INCCOUNT(SCANOBJ_COUNT); - /* actual scanning is done in here */ - - for (i=0; i<(obj->data.numrefs); i++) - { - p = obj->data.ref[i].addr; - if (p != NULL) - { - commentif(formatcomments, "fix: %d=%p.\n", i, p); - - /* copy ref to p for fixing, to avoid a pun (although - the pun would probably work fine almost everywhere) - */ - comment("About to fix with null pointer..."); - res = mps_fix(ss, NULL); - error("fix with null pointer"); - if (res != MPS_RES_OK) return res; - obj->data.ref[i].addr = p; - } - } - base = (mps_addr_t) ((char *) obj + (obj->data.size)); - break; - case MCheart: - INCCOUNT(SCANHEART_COUNT); - base = (mps_addr_t) ((char *) obj + (obj->heart.size)); - break; - default: - asserts(0, "scan: bizarre obj tag at %p.", obj); - } - } - } - MPS_SCAN_END(ss); - return MPS_RES_OK; -} - -static mps_addr_t myskip(mps_addr_t object) -{ - mycell *obj = object; - - INCCOUNT(SKIP_COUNT); - switch(obj->tag) - { - case MCpadsingle: - return (mps_addr_t) ((char *) obj + sizeof(obj->padsingle)); - case MCpadmany: - return obj->padmulti.next; - case MCheart: - return (mps_addr_t) ((char *) obj + (obj->heart.size)); - case MCdata: - return (mps_addr_t) ((char *) obj + (obj->data.size)); - default: - asserts(0, "skip: bizarre obj tag at %p.", obj); - return 0; /* not reached */ - } -} - -static void mycopy(mps_addr_t object, mps_addr_t to) -{ - mycell *boj = object; - mycell *toj = to; - - asserts(boj->tag = MCdata, "copy: non-data object"); - - INCCOUNT(COPY_COUNT); - commentif(formatcomments, "copy: %p -> %p\n", object, to); - -/* this line would be bad, because the objects might overlap, - and then C doesn't guarantee to do the right thing! - - *toj = *boj; -*/ - - memmove(to, object, boj->data.size); - if (!freeze) - { - toj->data.copycount = (toj->data.copycount)+1; - if (toj->data.copycount > maxcopy) maxcopy = toj->data.copycount; - } -} - -/* pad stores not its size but a pointer to the next object, - because we know we'll never be asked to copy it -*/ - -static void mypad(mps_addr_t base, size_t size) -{ - mycell *obj = base; - - asserts(size >= MPS_PF_ALIGN, "pad: size too small."); - - if (size == MPS_PF_ALIGN) - { - INCCOUNT(PAD_SINGLE_COUNT); - obj->padsingle.tag = MCpadsingle; - } - else - { - asserts(size >= sizeof(struct padmulti), "pad: awkward size."); - INCCOUNT(PAD_MULTI_COUNT); - obj->padmulti.tag = MCpadmany; - obj->padmulti.next = (mps_addr_t) ((char *) base + size); - } -} - -static mps_addr_t myisfwd(mps_addr_t object) -{ - mycell *obj = object; - - INCCOUNT(ISFWD_COUNT); - if (obj->tag != MCheart) - { - return NULL; - } - else - { - return obj->heart.obj; - } -} - -static void myfwd(mps_addr_t object, mps_addr_t to) -{ - mycell *obj = object; - size_t size; - - asserts(obj->tag == MCdata || obj->tag == MCheart, - "fwd: unexpected object tag at %p.", obj); - INCCOUNT(FWD_COUNT); - - if (obj->tag == MCdata) - { - size = obj->data.size; - } - else /* obj->tag == MCheart */ - { - size = obj->heart.size; - } - obj->data.tag = MCheart; - obj->heart.obj = to; - obj->heart.size = size; -} - - -/* --------------------------------------------------------------- - Access methods for mycell objects -*/ - -/* set the nth reference of obj to to (n from 0 to size-1) */ - -void setref(mycell *obj, int n, mycell *to) -{ - asserts(obj->tag = MCdata, "setref: from non-data object."); - asserts(to->tag = MCdata, "setref: to non-data object."); - asserts(obj->data.numrefs > n, "setref: access beyond object size."); - - obj->data.ref[n].addr = to; - obj->data.ref[n].id = to->data.id; -} - -mycell *getref(mycell *obj, int n) -{ - asserts(obj->tag = MCdata, "getref: from non-data object."); - asserts(obj->data.numrefs > n, "getref: access beyond object size."); - return obj->data.ref[n].addr; -} - -mps_addr_t getdata(mycell *obj) -{ - return (mps_addr_t) &(obj->data.ref[0]); -} - -long int getid(mycell *obj) -{ - asserts(obj->tag = MCdata, "getid: non-data object."); - return obj->data.id; -} - -long int getcopycount(mycell *obj) -{ - asserts(obj->tag = MCdata, "getcopycount: non-data object."); - return obj->data.copycount; -} - -long int getsize(mycell *obj) -{ - asserts(obj->tag = MCdata, "getsize: non-data object."); - return obj->data.numrefs; -} - -/* ---- Now the test itself! ---- */ - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_ap_t ap; - - int j; - mycell *a; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - formatcomments = 0; - - cdie( - mps_pool_create(&pool, space, mps_class_amc(), format), - "create pool"); - - cdie( - mps_ap_create(&ap, pool, MPS_RANK_EXACT), - "create ap"); - - a = allocone(ap, 100); - setref(a, 0, a); - - for (j=1; j<1000; j++) - { - allocone(ap, 1000); - } - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/149.c b/mps/qa/argerr/149.c deleted file mode 100644 index f7f08b9ef29..00000000000 --- a/mps/qa/argerr/149.c +++ /dev/null @@ -1,490 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = pointer to null addr to fix (function) - language = c - link = testlib.o newfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "arg.h" - -/* what follows is hacked from newfmt.c -*/ - -#include "mps.h" -#include "newfmt.h" - -/* tags */ - -enum {MCpadsingle, MCpadmany, MCheart, MCdata}; - -/* some options on the format are controlled by global - variables. Of course for efficiency we'd do it in the - pre-processor, but that would require recompilation... - - variable default function - - formatcomments 1 print comments on scanning, fixing, copying - checkcomments 1 print comments on checking - -*/ - -int formatcomments=0; -int checkcomments=0; -int countcomments=1; -int alloccomments=0; - -int nextid=1000000; - -enum -{ - SCANCALL_COUNT, - SCANOBJ_COUNT, /* = #objects scanned (real ones, that is) */ - SCANPS_COUNT, /* = #pad singles scanned */ - SCANPM_COUNT, /* etc ... */ - SCANHEART_COUNT, - COPY_COUNT, - SKIP_COUNT, - FWD_COUNT, - ISFWD_COUNT, - RESERVE_COUNT, - ALLOC_COUNT, - PAD_SINGLE_COUNT, - PAD_MULTI_COUNT -}; - -int counters[PAD_MULTI_COUNT+1]; -int prevcounters[PAD_MULTI_COUNT+1]; -int maxcounters[PAD_MULTI_COUNT+1] = {0}; - -static long int maxcopy = 0; -static int freeze=0; - -#define INCCOUNT(c) if(!freeze) counters[c]+=1 - -#define MAXSIZE 10000 - -/* a cell can be one of four things, depending on its type: - MCpadsingle - a single pad item, MPS_PF_ALIGN in size - MCpadmulti - a longer pad item, at least 2*MPS_PF_ALIGN in size - MCheart - a broken heart, aka forwarding object - MCdata - a real object -*/ - -typedef int tag; - -/* typedef union mycell mycell; - (it's in the header) -*/ - -struct padsingle {tag tag;}; - -struct padmulti {tag tag; mps_addr_t next;}; - -struct heart {tag tag; size_t size; mps_addr_t obj;}; - -struct data -{ - tag tag; - size_t size; - long int id; - long int copycount; - long int numrefs; - int checkedflag; - struct refitem {mycell *addr; long int id;} ref[MAXSIZE]; -}; - -union mycell -{ - tag tag; - struct padsingle padsingle; - struct padmulti padmulti; - struct heart heart; - struct data data; -}; - -/* the scanning function doesn't try to fix null refs - - size is the total size of the object in bytes - every other word from ref onwards, including the word - at ref, is a reference; after each one comes the id - of the object referenced, so we can check the graph is - correct later! - -nb: This way of doing things is not really guaranteed to work - on all systems. It would be more correct to use an array - of structures, or an array of unions. -*/ - -static mps_res_t myscan(mps_ss_t ss, mps_addr_t base, mps_addr_t limit); -static mps_addr_t myskip(mps_addr_t object); -static void myfwd(mps_addr_t object, mps_addr_t to); -static mps_addr_t myisfwd(mps_addr_t object); -static void mycopy(mps_addr_t object, mps_addr_t to); -static void mypad(mps_addr_t base, size_t size); - -struct mps_fmt_A_s fmtA = -{ - MPS_PF_ALIGN, - &myscan, - &myskip, - &mycopy, - &myfwd, - &myisfwd, - &mypad -}; - -/* in the following, size is the number of refs you want - the allocated object to have -*/ - -mycell *allocdumb(mps_ap_t ap, size_t size) -{ - mps_addr_t p; - mycell *q; - size_t bytes; - size_t alignment; - - bytes = offsetof(struct data, ref) + size; - - alignment = MPS_PF_ALIGN; /* needed to make it as wide as size_t */ - -/* twiddle the value of size to make it aligned */ - bytes = (bytes+alignment-1) & ~(alignment-1); - - do - { - die(mps_reserve(&p, ap, bytes), "Reserve: "); - INCCOUNT(RESERVE_COUNT); - q=p; - q->data.tag = MCdata; - q->data.id = nextid; - q->data.copycount = 0; - q->data.numrefs = 0; - q->data.checkedflag = 0; - q->data.size = bytes; - } - while (!mps_commit(ap, p, bytes)); - INCCOUNT(ALLOC_COUNT); - commentif(alloccomments, "allocated id %li at %p.", nextid, q); - nextid += 1; - - return q; -} - -mycell *allocone(mps_ap_t ap, int size) -{ - mps_addr_t p; - mycell *q; - int i; - size_t bytes; - size_t alignment; - - bytes = offsetof(struct data, ref) + size*sizeof(struct refitem); - - alignment = MPS_PF_ALIGN; /* needed to make it as wide as size_t */ - -/* twiddle the value of size to make it aligned */ - bytes = (bytes+alignment-1) & ~(alignment-1); - - do - { - die(mps_reserve(&p, ap, bytes), "Reserve: "); - INCCOUNT(RESERVE_COUNT); - q=p; - q->data.tag = MCdata; - q->data.id = nextid; - q->data.copycount = 0; - q->data.numrefs = size; - q->data.checkedflag = 0; - q->data.size = bytes; - - for(i=0; idata.ref[i].addr = NULL; - q->data.ref[i].id = 0; - } - } - while (!mps_commit(ap, p, bytes)); - INCCOUNT(ALLOC_COUNT); - commentif(alloccomments, "allocated id %li at %p.", nextid, q); - nextid += 1; - - return q; -} - -static mps_res_t myscan(mps_ss_t ss, mps_addr_t base, mps_addr_t limit) -{ - int i; - - INCCOUNT(SCANCALL_COUNT); - MPS_SCAN_BEGIN(ss) - { - while (base < limit) - { - mycell *obj = base; - mps_res_t res; - mps_addr_t p; - - commentif(formatcomments, "scan %p.\n", base); - switch (obj->tag) - { - case MCpadsingle: - INCCOUNT(SCANPS_COUNT); - base = (mps_addr_t) ((char *) obj + sizeof(obj->padsingle)); - break; - case MCpadmany: - INCCOUNT(SCANPM_COUNT); - base = (obj->padmulti.next); - break; - case MCdata: - INCCOUNT(SCANOBJ_COUNT); - /* actual scanning is done in here */ - - for (i=0; i<(obj->data.numrefs); i++) - { - p = obj->data.ref[i].addr; - if (p != NULL) - { - commentif(formatcomments, "fix: %d=%p.\n", i, p); - - /* copy ref to p for fixing, to avoid a pun (although - the pun would probably work fine almost everywhere) - */ - comment("About to fix with null pointer..."); - p = NULL; - res = mps_fix(ss, (mps_addr_t *) &p); - error("fix with null pointer"); - if (res != MPS_RES_OK) return res; - obj->data.ref[i].addr = p; - } - } - base = (mps_addr_t) ((char *) obj + (obj->data.size)); - break; - case MCheart: - INCCOUNT(SCANHEART_COUNT); - base = (mps_addr_t) ((char *) obj + (obj->heart.size)); - break; - default: - asserts(0, "scan: bizarre obj tag at %p.", obj); - } - } - } - MPS_SCAN_END(ss); - return MPS_RES_OK; -} - -static mps_addr_t myskip(mps_addr_t object) -{ - mycell *obj = object; - - INCCOUNT(SKIP_COUNT); - switch(obj->tag) - { - case MCpadsingle: - return (mps_addr_t) ((char *) obj + sizeof(obj->padsingle)); - case MCpadmany: - return obj->padmulti.next; - case MCheart: - return (mps_addr_t) ((char *) obj + (obj->heart.size)); - case MCdata: - return (mps_addr_t) ((char *) obj + (obj->data.size)); - default: - asserts(0, "skip: bizarre obj tag at %p.", obj); - return 0; /* not reached */ - } -} - -static void mycopy(mps_addr_t object, mps_addr_t to) -{ - mycell *boj = object; - mycell *toj = to; - - asserts(boj->tag = MCdata, "copy: non-data object"); - - INCCOUNT(COPY_COUNT); - commentif(formatcomments, "copy: %p -> %p\n", object, to); - -/* this line would be bad, because the objects might overlap, - and then C doesn't guarantee to do the right thing! - - *toj = *boj; -*/ - - memmove(to, object, boj->data.size); - if (!freeze) - { - toj->data.copycount = (toj->data.copycount)+1; - if (toj->data.copycount > maxcopy) maxcopy = toj->data.copycount; - } -} - -/* pad stores not its size but a pointer to the next object, - because we know we'll never be asked to copy it -*/ - -static void mypad(mps_addr_t base, size_t size) -{ - mycell *obj = base; - - asserts(size >= MPS_PF_ALIGN, "pad: size too small."); - - if (size == MPS_PF_ALIGN) - { - INCCOUNT(PAD_SINGLE_COUNT); - obj->padsingle.tag = MCpadsingle; - } - else - { - asserts(size >= sizeof(struct padmulti), "pad: awkward size."); - INCCOUNT(PAD_MULTI_COUNT); - obj->padmulti.tag = MCpadmany; - obj->padmulti.next = (mps_addr_t) ((char *) base + size); - } -} - -static mps_addr_t myisfwd(mps_addr_t object) -{ - mycell *obj = object; - - INCCOUNT(ISFWD_COUNT); - if (obj->tag != MCheart) - { - return NULL; - } - else - { - return obj->heart.obj; - } -} - -static void myfwd(mps_addr_t object, mps_addr_t to) -{ - mycell *obj = object; - size_t size; - - asserts(obj->tag == MCdata || obj->tag == MCheart, - "fwd: unexpected object tag at %p.", obj); - INCCOUNT(FWD_COUNT); - - if (obj->tag == MCdata) - { - size = obj->data.size; - } - else /* obj->tag == MCheart */ - { - size = obj->heart.size; - } - obj->data.tag = MCheart; - obj->heart.obj = to; - obj->heart.size = size; -} - - -/* --------------------------------------------------------------- - Access methods for mycell objects -*/ - -/* set the nth reference of obj to to (n from 0 to size-1) */ - -void setref(mycell *obj, int n, mycell *to) -{ - asserts(obj->tag = MCdata, "setref: from non-data object."); - asserts(to->tag = MCdata, "setref: to non-data object."); - asserts(obj->data.numrefs > n, "setref: access beyond object size."); - - obj->data.ref[n].addr = to; - obj->data.ref[n].id = to->data.id; -} - -mycell *getref(mycell *obj, int n) -{ - asserts(obj->tag = MCdata, "getref: from non-data object."); - asserts(obj->data.numrefs > n, "getref: access beyond object size."); - return obj->data.ref[n].addr; -} - -mps_addr_t getdata(mycell *obj) -{ - return (mps_addr_t) &(obj->data.ref[0]); -} - -long int getid(mycell *obj) -{ - asserts(obj->tag = MCdata, "getid: non-data object."); - return obj->data.id; -} - -long int getcopycount(mycell *obj) -{ - asserts(obj->tag = MCdata, "getcopycount: non-data object."); - return obj->data.copycount; -} - -long int getsize(mycell *obj) -{ - asserts(obj->tag = MCdata, "getsize: non-data object."); - return obj->data.numrefs; -} - -/* ---- Now the test itself! ---- */ - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_ap_t ap; - - int j; - mycell *a; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - formatcomments = 0; - - cdie( - mps_pool_create(&pool, space, mps_class_amc(), format), - "create pool"); - - cdie( - mps_ap_create(&ap, pool, MPS_RANK_EXACT), - "create ap"); - - a = allocone(ap, 100); - setref(a, 0, a); - - for (j=1; j<1000; j++) - { - allocone(ap, 1000); - } - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/15.c b/mps/qa/argerr/15.c deleted file mode 100644 index e6fbed8ca9b..00000000000 --- a/mps/qa/argerr/15.c +++ /dev/null @@ -1,54 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = UNALIGNED 3rd arg to pool_create - language = c - link = testlib.o newfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "newfmt.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - formatcomments = 0; - - adie( - mps_pool_create(&pool, space, UNALIGNED, format), - "create pool"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/150.c b/mps/qa/argerr/150.c deleted file mode 100644 index 5619c0ae4c0..00000000000 --- a/mps/qa/argerr/150.c +++ /dev/null @@ -1,489 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = unaligned addr to fix (function) - language = c - link = testlib.o newfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "arg.h" - -/* what follows is hacked from newfmt.c -*/ - -#include "mps.h" -#include "newfmt.h" - -/* tags */ - -enum {MCpadsingle, MCpadmany, MCheart, MCdata}; - -/* some options on the format are controlled by global - variables. Of course for efficiency we'd do it in the - pre-processor, but that would require recompilation... - - variable default function - - formatcomments 1 print comments on scanning, fixing, copying - checkcomments 1 print comments on checking - -*/ - -int formatcomments=0; -int checkcomments=0; -int countcomments=1; -int alloccomments=0; - -int nextid=1000000; - -enum -{ - SCANCALL_COUNT, - SCANOBJ_COUNT, /* = #objects scanned (real ones, that is) */ - SCANPS_COUNT, /* = #pad singles scanned */ - SCANPM_COUNT, /* etc ... */ - SCANHEART_COUNT, - COPY_COUNT, - SKIP_COUNT, - FWD_COUNT, - ISFWD_COUNT, - RESERVE_COUNT, - ALLOC_COUNT, - PAD_SINGLE_COUNT, - PAD_MULTI_COUNT -}; - -int counters[PAD_MULTI_COUNT+1]; -int prevcounters[PAD_MULTI_COUNT+1]; -int maxcounters[PAD_MULTI_COUNT+1] = {0}; - -static long int maxcopy = 0; -static int freeze=0; - -#define INCCOUNT(c) if(!freeze) counters[c]+=1 - -#define MAXSIZE 10000 - -/* a cell can be one of four things, depending on its type: - MCpadsingle - a single pad item, MPS_PF_ALIGN in size - MCpadmulti - a longer pad item, at least 2*MPS_PF_ALIGN in size - MCheart - a broken heart, aka forwarding object - MCdata - a real object -*/ - -typedef int tag; - -/* typedef union mycell mycell; - (it's in the header) -*/ - -struct padsingle {tag tag;}; - -struct padmulti {tag tag; mps_addr_t next;}; - -struct heart {tag tag; size_t size; mps_addr_t obj;}; - -struct data -{ - tag tag; - size_t size; - long int id; - long int copycount; - long int numrefs; - int checkedflag; - struct refitem {mycell *addr; long int id;} ref[MAXSIZE]; -}; - -union mycell -{ - tag tag; - struct padsingle padsingle; - struct padmulti padmulti; - struct heart heart; - struct data data; -}; - -/* the scanning function doesn't try to fix null refs - - size is the total size of the object in bytes - every other word from ref onwards, including the word - at ref, is a reference; after each one comes the id - of the object referenced, so we can check the graph is - correct later! - -nb: This way of doing things is not really guaranteed to work - on all systems. It would be more correct to use an array - of structures, or an array of unions. -*/ - -static mps_res_t myscan(mps_ss_t ss, mps_addr_t base, mps_addr_t limit); -static mps_addr_t myskip(mps_addr_t object); -static void myfwd(mps_addr_t object, mps_addr_t to); -static mps_addr_t myisfwd(mps_addr_t object); -static void mycopy(mps_addr_t object, mps_addr_t to); -static void mypad(mps_addr_t base, size_t size); - -struct mps_fmt_A_s fmtA = -{ - MPS_PF_ALIGN, - &myscan, - &myskip, - &mycopy, - &myfwd, - &myisfwd, - &mypad -}; - -/* in the following, size is the number of refs you want - the allocated object to have -*/ - -mycell *allocdumb(mps_ap_t ap, size_t size) -{ - mps_addr_t p; - mycell *q; - size_t bytes; - size_t alignment; - - bytes = offsetof(struct data, ref) + size; - - alignment = MPS_PF_ALIGN; /* needed to make it as wide as size_t */ - -/* twiddle the value of size to make it aligned */ - bytes = (bytes+alignment-1) & ~(alignment-1); - - do - { - die(mps_reserve(&p, ap, bytes), "Reserve: "); - INCCOUNT(RESERVE_COUNT); - q=p; - q->data.tag = MCdata; - q->data.id = nextid; - q->data.copycount = 0; - q->data.numrefs = 0; - q->data.checkedflag = 0; - q->data.size = bytes; - } - while (!mps_commit(ap, p, bytes)); - INCCOUNT(ALLOC_COUNT); - commentif(alloccomments, "allocated id %li at %p.", nextid, q); - nextid += 1; - - return q; -} - -mycell *allocone(mps_ap_t ap, int size) -{ - mps_addr_t p; - mycell *q; - int i; - size_t bytes; - size_t alignment; - - bytes = offsetof(struct data, ref) + size*sizeof(struct refitem); - - alignment = MPS_PF_ALIGN; /* needed to make it as wide as size_t */ - -/* twiddle the value of size to make it aligned */ - bytes = (bytes+alignment-1) & ~(alignment-1); - - do - { - die(mps_reserve(&p, ap, bytes), "Reserve: "); - INCCOUNT(RESERVE_COUNT); - q=p; - q->data.tag = MCdata; - q->data.id = nextid; - q->data.copycount = 0; - q->data.numrefs = size; - q->data.checkedflag = 0; - q->data.size = bytes; - - for(i=0; idata.ref[i].addr = NULL; - q->data.ref[i].id = 0; - } - } - while (!mps_commit(ap, p, bytes)); - INCCOUNT(ALLOC_COUNT); - commentif(alloccomments, "allocated id %li at %p.", nextid, q); - nextid += 1; - - return q; -} - -static mps_res_t myscan(mps_ss_t ss, mps_addr_t base, mps_addr_t limit) -{ - int i; - - INCCOUNT(SCANCALL_COUNT); - MPS_SCAN_BEGIN(ss) - { - while (base < limit) - { - mycell *obj = base; - mps_res_t res; - mps_addr_t p; - - commentif(formatcomments, "scan %p.\n", base); - switch (obj->tag) - { - case MCpadsingle: - INCCOUNT(SCANPS_COUNT); - base = (mps_addr_t) ((char *) obj + sizeof(obj->padsingle)); - break; - case MCpadmany: - INCCOUNT(SCANPM_COUNT); - base = (obj->padmulti.next); - break; - case MCdata: - INCCOUNT(SCANOBJ_COUNT); - /* actual scanning is done in here */ - - for (i=0; i<(obj->data.numrefs); i++) - { - p = obj->data.ref[i].addr; - if (p != NULL) - { - commentif(formatcomments, "fix: %d=%p.\n", i, p); - - /* copy ref to p for fixing, to avoid a pun (although - the pun would probably work fine almost everywhere) - */ - comment("About to fix on unaligned addr..."); - res = mps_fix(ss, UNALIGNED); - error("unaligned fix"); - if (res != MPS_RES_OK) return res; - obj->data.ref[i].addr = p; - } - } - base = (mps_addr_t) ((char *) obj + (obj->data.size)); - break; - case MCheart: - INCCOUNT(SCANHEART_COUNT); - base = (mps_addr_t) ((char *) obj + (obj->heart.size)); - break; - default: - asserts(0, "scan: bizarre obj tag at %p.", obj); - } - } - } - MPS_SCAN_END(ss); - return MPS_RES_OK; -} - -static mps_addr_t myskip(mps_addr_t object) -{ - mycell *obj = object; - - INCCOUNT(SKIP_COUNT); - switch(obj->tag) - { - case MCpadsingle: - return (mps_addr_t) ((char *) obj + sizeof(obj->padsingle)); - case MCpadmany: - return obj->padmulti.next; - case MCheart: - return (mps_addr_t) ((char *) obj + (obj->heart.size)); - case MCdata: - return (mps_addr_t) ((char *) obj + (obj->data.size)); - default: - asserts(0, "skip: bizarre obj tag at %p.", obj); - return 0; /* not reached */ - } -} - -static void mycopy(mps_addr_t object, mps_addr_t to) -{ - mycell *boj = object; - mycell *toj = to; - - asserts(boj->tag = MCdata, "copy: non-data object"); - - INCCOUNT(COPY_COUNT); - commentif(formatcomments, "copy: %p -> %p\n", object, to); - -/* this line would be bad, because the objects might overlap, - and then C doesn't guarantee to do the right thing! - - *toj = *boj; -*/ - - memmove(to, object, boj->data.size); - if (!freeze) - { - toj->data.copycount = (toj->data.copycount)+1; - if (toj->data.copycount > maxcopy) maxcopy = toj->data.copycount; - } -} - -/* pad stores not its size but a pointer to the next object, - because we know we'll never be asked to copy it -*/ - -static void mypad(mps_addr_t base, size_t size) -{ - mycell *obj = base; - - asserts(size >= MPS_PF_ALIGN, "pad: size too small."); - - if (size == MPS_PF_ALIGN) - { - INCCOUNT(PAD_SINGLE_COUNT); - obj->padsingle.tag = MCpadsingle; - } - else - { - asserts(size >= sizeof(struct padmulti), "pad: awkward size."); - INCCOUNT(PAD_MULTI_COUNT); - obj->padmulti.tag = MCpadmany; - obj->padmulti.next = (mps_addr_t) ((char *) base + size); - } -} - -static mps_addr_t myisfwd(mps_addr_t object) -{ - mycell *obj = object; - - INCCOUNT(ISFWD_COUNT); - if (obj->tag != MCheart) - { - return NULL; - } - else - { - return obj->heart.obj; - } -} - -static void myfwd(mps_addr_t object, mps_addr_t to) -{ - mycell *obj = object; - size_t size; - - asserts(obj->tag == MCdata || obj->tag == MCheart, - "fwd: unexpected object tag at %p.", obj); - INCCOUNT(FWD_COUNT); - - if (obj->tag == MCdata) - { - size = obj->data.size; - } - else /* obj->tag == MCheart */ - { - size = obj->heart.size; - } - obj->data.tag = MCheart; - obj->heart.obj = to; - obj->heart.size = size; -} - - -/* --------------------------------------------------------------- - Access methods for mycell objects -*/ - -/* set the nth reference of obj to to (n from 0 to size-1) */ - -void setref(mycell *obj, int n, mycell *to) -{ - asserts(obj->tag = MCdata, "setref: from non-data object."); - asserts(to->tag = MCdata, "setref: to non-data object."); - asserts(obj->data.numrefs > n, "setref: access beyond object size."); - - obj->data.ref[n].addr = to; - obj->data.ref[n].id = to->data.id; -} - -mycell *getref(mycell *obj, int n) -{ - asserts(obj->tag = MCdata, "getref: from non-data object."); - asserts(obj->data.numrefs > n, "getref: access beyond object size."); - return obj->data.ref[n].addr; -} - -mps_addr_t getdata(mycell *obj) -{ - return (mps_addr_t) &(obj->data.ref[0]); -} - -long int getid(mycell *obj) -{ - asserts(obj->tag = MCdata, "getid: non-data object."); - return obj->data.id; -} - -long int getcopycount(mycell *obj) -{ - asserts(obj->tag = MCdata, "getcopycount: non-data object."); - return obj->data.copycount; -} - -long int getsize(mycell *obj) -{ - asserts(obj->tag = MCdata, "getsize: non-data object."); - return obj->data.numrefs; -} - -/* ---- Now the test itself! ---- */ - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_ap_t ap; - - int j; - mycell *a; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - formatcomments = 0; - - cdie( - mps_pool_create(&pool, space, mps_class_amc(), format), - "create pool"); - - cdie( - mps_ap_create(&ap, pool, MPS_RANK_EXACT), - "create ap"); - - a = allocone(ap, 100); - setref(a, 0, a); - - for (j=1; j<1000; j++) - { - allocone(ap, 1000); - } - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/151.c b/mps/qa/argerr/151.c deleted file mode 100644 index cedb8fe9826..00000000000 --- a/mps/qa/argerr/151.c +++ /dev/null @@ -1,490 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = pointer to unaligned addr to fix (function) - language = c - link = testlib.o newfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "arg.h" - -/* what follows is hacked from newfmt.c -*/ - -#include "mps.h" -#include "newfmt.h" - -/* tags */ - -enum {MCpadsingle, MCpadmany, MCheart, MCdata}; - -/* some options on the format are controlled by global - variables. Of course for efficiency we'd do it in the - pre-processor, but that would require recompilation... - - variable default function - - formatcomments 1 print comments on scanning, fixing, copying - checkcomments 1 print comments on checking - -*/ - -int formatcomments=0; -int checkcomments=0; -int countcomments=1; -int alloccomments=0; - -int nextid=1000000; - -enum -{ - SCANCALL_COUNT, - SCANOBJ_COUNT, /* = #objects scanned (real ones, that is) */ - SCANPS_COUNT, /* = #pad singles scanned */ - SCANPM_COUNT, /* etc ... */ - SCANHEART_COUNT, - COPY_COUNT, - SKIP_COUNT, - FWD_COUNT, - ISFWD_COUNT, - RESERVE_COUNT, - ALLOC_COUNT, - PAD_SINGLE_COUNT, - PAD_MULTI_COUNT -}; - -int counters[PAD_MULTI_COUNT+1]; -int prevcounters[PAD_MULTI_COUNT+1]; -int maxcounters[PAD_MULTI_COUNT+1] = {0}; - -static long int maxcopy = 0; -static int freeze=0; - -#define INCCOUNT(c) if(!freeze) counters[c]+=1 - -#define MAXSIZE 10000 - -/* a cell can be one of four things, depending on its type: - MCpadsingle - a single pad item, MPS_PF_ALIGN in size - MCpadmulti - a longer pad item, at least 2*MPS_PF_ALIGN in size - MCheart - a broken heart, aka forwarding object - MCdata - a real object -*/ - -typedef int tag; - -/* typedef union mycell mycell; - (it's in the header) -*/ - -struct padsingle {tag tag;}; - -struct padmulti {tag tag; mps_addr_t next;}; - -struct heart {tag tag; size_t size; mps_addr_t obj;}; - -struct data -{ - tag tag; - size_t size; - long int id; - long int copycount; - long int numrefs; - int checkedflag; - struct refitem {mycell *addr; long int id;} ref[MAXSIZE]; -}; - -union mycell -{ - tag tag; - struct padsingle padsingle; - struct padmulti padmulti; - struct heart heart; - struct data data; -}; - -/* the scanning function doesn't try to fix null refs - - size is the total size of the object in bytes - every other word from ref onwards, including the word - at ref, is a reference; after each one comes the id - of the object referenced, so we can check the graph is - correct later! - -nb: This way of doing things is not really guaranteed to work - on all systems. It would be more correct to use an array - of structures, or an array of unions. -*/ - -static mps_res_t myscan(mps_ss_t ss, mps_addr_t base, mps_addr_t limit); -static mps_addr_t myskip(mps_addr_t object); -static void myfwd(mps_addr_t object, mps_addr_t to); -static mps_addr_t myisfwd(mps_addr_t object); -static void mycopy(mps_addr_t object, mps_addr_t to); -static void mypad(mps_addr_t base, size_t size); - -struct mps_fmt_A_s fmtA = -{ - MPS_PF_ALIGN, - &myscan, - &myskip, - &mycopy, - &myfwd, - &myisfwd, - &mypad -}; - -/* in the following, size is the number of refs you want - the allocated object to have -*/ - -mycell *allocdumb(mps_ap_t ap, size_t size) -{ - mps_addr_t p; - mycell *q; - size_t bytes; - size_t alignment; - - bytes = offsetof(struct data, ref) + size; - - alignment = MPS_PF_ALIGN; /* needed to make it as wide as size_t */ - -/* twiddle the value of size to make it aligned */ - bytes = (bytes+alignment-1) & ~(alignment-1); - - do - { - die(mps_reserve(&p, ap, bytes), "Reserve: "); - INCCOUNT(RESERVE_COUNT); - q=p; - q->data.tag = MCdata; - q->data.id = nextid; - q->data.copycount = 0; - q->data.numrefs = 0; - q->data.checkedflag = 0; - q->data.size = bytes; - } - while (!mps_commit(ap, p, bytes)); - INCCOUNT(ALLOC_COUNT); - commentif(alloccomments, "allocated id %li at %p.", nextid, q); - nextid += 1; - - return q; -} - -mycell *allocone(mps_ap_t ap, int size) -{ - mps_addr_t p; - mycell *q; - int i; - size_t bytes; - size_t alignment; - - bytes = offsetof(struct data, ref) + size*sizeof(struct refitem); - - alignment = MPS_PF_ALIGN; /* needed to make it as wide as size_t */ - -/* twiddle the value of size to make it aligned */ - bytes = (bytes+alignment-1) & ~(alignment-1); - - do - { - die(mps_reserve(&p, ap, bytes), "Reserve: "); - INCCOUNT(RESERVE_COUNT); - q=p; - q->data.tag = MCdata; - q->data.id = nextid; - q->data.copycount = 0; - q->data.numrefs = size; - q->data.checkedflag = 0; - q->data.size = bytes; - - for(i=0; idata.ref[i].addr = NULL; - q->data.ref[i].id = 0; - } - } - while (!mps_commit(ap, p, bytes)); - INCCOUNT(ALLOC_COUNT); - commentif(alloccomments, "allocated id %li at %p.", nextid, q); - nextid += 1; - - return q; -} - -static mps_res_t myscan(mps_ss_t ss, mps_addr_t base, mps_addr_t limit) -{ - int i; - - INCCOUNT(SCANCALL_COUNT); - MPS_SCAN_BEGIN(ss) - { - while (base < limit) - { - mycell *obj = base; - mps_res_t res; - mps_addr_t p; - - commentif(formatcomments, "scan %p.\n", base); - switch (obj->tag) - { - case MCpadsingle: - INCCOUNT(SCANPS_COUNT); - base = (mps_addr_t) ((char *) obj + sizeof(obj->padsingle)); - break; - case MCpadmany: - INCCOUNT(SCANPM_COUNT); - base = (obj->padmulti.next); - break; - case MCdata: - INCCOUNT(SCANOBJ_COUNT); - /* actual scanning is done in here */ - - for (i=0; i<(obj->data.numrefs); i++) - { - p = obj->data.ref[i].addr; - if (p != NULL) - { - commentif(formatcomments, "fix: %d=%p.\n", i, p); - - /* copy ref to p for fixing, to avoid a pun (although - the pun would probably work fine almost everywhere) - */ - comment("About to fix with unaligned pointer..."); - p = UNALIGNED; - res = mps_fix(ss, &p); - error("fix with unaligned pointer"); - if (res != MPS_RES_OK) return res; - obj->data.ref[i].addr = p; - } - } - base = (mps_addr_t) ((char *) obj + (obj->data.size)); - break; - case MCheart: - INCCOUNT(SCANHEART_COUNT); - base = (mps_addr_t) ((char *) obj + (obj->heart.size)); - break; - default: - asserts(0, "scan: bizarre obj tag at %p.", obj); - } - } - } - MPS_SCAN_END(ss); - return MPS_RES_OK; -} - -static mps_addr_t myskip(mps_addr_t object) -{ - mycell *obj = object; - - INCCOUNT(SKIP_COUNT); - switch(obj->tag) - { - case MCpadsingle: - return (mps_addr_t) ((char *) obj + sizeof(obj->padsingle)); - case MCpadmany: - return obj->padmulti.next; - case MCheart: - return (mps_addr_t) ((char *) obj + (obj->heart.size)); - case MCdata: - return (mps_addr_t) ((char *) obj + (obj->data.size)); - default: - asserts(0, "skip: bizarre obj tag at %p.", obj); - return 0; /* not reached */ - } -} - -static void mycopy(mps_addr_t object, mps_addr_t to) -{ - mycell *boj = object; - mycell *toj = to; - - asserts(boj->tag = MCdata, "copy: non-data object"); - - INCCOUNT(COPY_COUNT); - commentif(formatcomments, "copy: %p -> %p\n", object, to); - -/* this line would be bad, because the objects might overlap, - and then C doesn't guarantee to do the right thing! - - *toj = *boj; -*/ - - memmove(to, object, boj->data.size); - if (!freeze) - { - toj->data.copycount = (toj->data.copycount)+1; - if (toj->data.copycount > maxcopy) maxcopy = toj->data.copycount; - } -} - -/* pad stores not its size but a pointer to the next object, - because we know we'll never be asked to copy it -*/ - -static void mypad(mps_addr_t base, size_t size) -{ - mycell *obj = base; - - asserts(size >= MPS_PF_ALIGN, "pad: size too small."); - - if (size == MPS_PF_ALIGN) - { - INCCOUNT(PAD_SINGLE_COUNT); - obj->padsingle.tag = MCpadsingle; - } - else - { - asserts(size >= sizeof(struct padmulti), "pad: awkward size."); - INCCOUNT(PAD_MULTI_COUNT); - obj->padmulti.tag = MCpadmany; - obj->padmulti.next = (mps_addr_t) ((char *) base + size); - } -} - -static mps_addr_t myisfwd(mps_addr_t object) -{ - mycell *obj = object; - - INCCOUNT(ISFWD_COUNT); - if (obj->tag != MCheart) - { - return NULL; - } - else - { - return obj->heart.obj; - } -} - -static void myfwd(mps_addr_t object, mps_addr_t to) -{ - mycell *obj = object; - size_t size; - - asserts(obj->tag == MCdata || obj->tag == MCheart, - "fwd: unexpected object tag at %p.", obj); - INCCOUNT(FWD_COUNT); - - if (obj->tag == MCdata) - { - size = obj->data.size; - } - else /* obj->tag == MCheart */ - { - size = obj->heart.size; - } - obj->data.tag = MCheart; - obj->heart.obj = to; - obj->heart.size = size; -} - - -/* --------------------------------------------------------------- - Access methods for mycell objects -*/ - -/* set the nth reference of obj to to (n from 0 to size-1) */ - -void setref(mycell *obj, int n, mycell *to) -{ - asserts(obj->tag = MCdata, "setref: from non-data object."); - asserts(to->tag = MCdata, "setref: to non-data object."); - asserts(obj->data.numrefs > n, "setref: access beyond object size."); - - obj->data.ref[n].addr = to; - obj->data.ref[n].id = to->data.id; -} - -mycell *getref(mycell *obj, int n) -{ - asserts(obj->tag = MCdata, "getref: from non-data object."); - asserts(obj->data.numrefs > n, "getref: access beyond object size."); - return obj->data.ref[n].addr; -} - -mps_addr_t getdata(mycell *obj) -{ - return (mps_addr_t) &(obj->data.ref[0]); -} - -long int getid(mycell *obj) -{ - asserts(obj->tag = MCdata, "getid: non-data object."); - return obj->data.id; -} - -long int getcopycount(mycell *obj) -{ - asserts(obj->tag = MCdata, "getcopycount: non-data object."); - return obj->data.copycount; -} - -long int getsize(mycell *obj) -{ - asserts(obj->tag = MCdata, "getsize: non-data object."); - return obj->data.numrefs; -} - -/* ---- Now the test itself! ---- */ - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_ap_t ap; - - int j; - mycell *a; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - formatcomments = 0; - - cdie( - mps_pool_create(&pool, space, mps_class_amc(), format), - "create pool"); - - cdie( - mps_ap_create(&ap, pool, MPS_RANK_EXACT), - "create ap"); - - a = allocone(ap, 100); - setref(a, 0, a); - - for (j=1; j<1000; j++) - { - allocone(ap, 1000); - } - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/152.c b/mps/qa/argerr/152.c deleted file mode 100644 index bef28225c1a..00000000000 --- a/mps/qa/argerr/152.c +++ /dev/null @@ -1,50 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = 2nd arg to mps_free not at start of an object - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmfs.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - - size_t mysize; - mps_addr_t a; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - mysize = 16; - - cdie( - mps_pool_create( - &pool, space, mps_class_mfs(), mysize, mysize), - "create pool"); - - cdie(mps_alloc(&a, pool, mysize), "alloc"); - mps_free(pool, (mps_addr_t) ((char *)a+8), mysize); - error("free"); - mps_pool_destroy(pool); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/153.c b/mps/qa/argerr/153.c deleted file mode 100644 index 76d681e8e7d..00000000000 --- a/mps/qa/argerr/153.c +++ /dev/null @@ -1,33 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = -1 as third argument to mps_alloc (MV) - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmv.h" - -static void test(void) { - mps_space_t space; - mps_pool_t pool; - mps_addr_t q; - - cdie(mps_space_create(&space), "create"); - - cdie(mps_pool_create(&pool, space, mps_class_mv(), - 1024*32, 1024*16, 1024*256), "pool"); - - cdie(mps_alloc(&q, pool, (size_t) -1), "alloc"); - - mps_pool_destroy(pool); - mps_space_destroy(space); -} - -int main(void) { - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/argerr/154.c b/mps/qa/argerr/154.c deleted file mode 100644 index 91002926cb7..00000000000 --- a/mps/qa/argerr/154.c +++ /dev/null @@ -1,66 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = size = -MPS_PF_ALIGN to mps_reserve - language = c - link = testlib.o newfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "newfmt.h" -#include "arg.h" - -#undef mps_reserve -#undef mps_commit - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_ap_t ap; - mps_addr_t p; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - formatcomments = 0; - - cdie( - mps_pool_create(&pool, space, mps_class_amc(), format), - "create pool"); - - cdie( - mps_ap_create(&ap, pool, MPS_RANK_EXACT), - "create ap"); - - cdie( - mps_reserve(&p, ap, (size_t) -MPS_PF_ALIGN), "reserve"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/16.c b/mps/qa/argerr/16.c deleted file mode 100644 index 84f99364d90..00000000000 --- a/mps/qa/argerr/16.c +++ /dev/null @@ -1,54 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = NULL 4th arg to pool_create - language = c - link = testlib.o newfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "newfmt.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - formatcomments = 0; - - adie( - mps_pool_create(&pool, space, mps_class_amc(), NULL), - "create pool"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/17.c b/mps/qa/argerr/17.c deleted file mode 100644 index da43a3f29df..00000000000 --- a/mps/qa/argerr/17.c +++ /dev/null @@ -1,54 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = UNALIGNED 4th arg to pool_create - language = c - link = testlib.o newfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "newfmt.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - formatcomments = 0; - - adie( - mps_pool_create(&pool, space, mps_class_amc(), UNALIGNED), - "create pool"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/18.c b/mps/qa/argerr/18.c deleted file mode 100644 index 463a0cf6f95..00000000000 --- a/mps/qa/argerr/18.c +++ /dev/null @@ -1,56 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = NULL arg to pool_destroy - language = c - link = testlib.o newfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "newfmt.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - formatcomments = 0; - - cdie( - mps_pool_create(&pool, space, mps_class_amc(), format), - "create pool"); - - mps_pool_destroy(NULL); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/19.c b/mps/qa/argerr/19.c deleted file mode 100644 index 3d9ff23972a..00000000000 --- a/mps/qa/argerr/19.c +++ /dev/null @@ -1,56 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = UNALIGNED arg to pool_destroy - language = c - link = testlib.o newfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "newfmt.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - formatcomments = 0; - - cdie( - mps_pool_create(&pool, space, mps_class_amc(), format), - "create pool"); - - mps_pool_destroy(UNALIGNED); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/2.c b/mps/qa/argerr/2.c deleted file mode 100644 index c4830999291..00000000000 --- a/mps/qa/argerr/2.c +++ /dev/null @@ -1,26 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = destroy a space with an null space_t - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -static void test(void) -{ - mps_space_t space; - - cdie(mps_space_create(&space), - "Create space"); - mps_space_destroy(NULL); -} - -int main(void) -{ - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/20.c b/mps/qa/argerr/20.c deleted file mode 100644 index b03be15c1c6..00000000000 --- a/mps/qa/argerr/20.c +++ /dev/null @@ -1,48 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = NULL 1st arg to mps_alloc - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmfs.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - - size_t mysize; - mps_addr_t a; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - mysize = 8; - - cdie( - mps_pool_create( - &pool, space, mps_class_mfs(), (size_t) 8, mysize), - "create pool"); - - mps_alloc(NULL, pool, mysize); - mps_pool_destroy(pool); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/21.c b/mps/qa/argerr/21.c deleted file mode 100644 index 659c8112235..00000000000 --- a/mps/qa/argerr/21.c +++ /dev/null @@ -1,48 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = UNALIGNED 1st arg to mps_alloc - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmfs.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - - size_t mysize; - mps_addr_t a; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - mysize = 8; - - cdie( - mps_pool_create( - &pool, space, mps_class_mfs(), (size_t) 8, mysize), - "create pool"); - - mps_alloc(UNALIGNED, pool, mysize); - mps_pool_destroy(pool); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/22.c b/mps/qa/argerr/22.c deleted file mode 100644 index 605528e0531..00000000000 --- a/mps/qa/argerr/22.c +++ /dev/null @@ -1,48 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = NULL 2nd arg to mps_alloc - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmfs.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - - size_t mysize; - mps_addr_t a; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - mysize = 8; - - cdie( - mps_pool_create( - &pool, space, mps_class_mfs(), (size_t) 8, mysize), - "create pool"); - - mps_alloc(&a, NULL, mysize); - mps_pool_destroy(pool); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/23.c b/mps/qa/argerr/23.c deleted file mode 100644 index 3c3c653501e..00000000000 --- a/mps/qa/argerr/23.c +++ /dev/null @@ -1,48 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = UNALIGNED 2nd arg to mps_alloc - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmfs.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - - size_t mysize; - mps_addr_t a; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - mysize = 8; - - cdie( - mps_pool_create( - &pool, space, mps_class_mfs(), (size_t) 8, mysize), - "create pool"); - - mps_alloc(&a, UNALIGNED, mysize); - mps_pool_destroy(pool); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/24.c b/mps/qa/argerr/24.c deleted file mode 100644 index ec9e5aafe1e..00000000000 --- a/mps/qa/argerr/24.c +++ /dev/null @@ -1,48 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = zero 3rd arg to mps_alloc - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmfs.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - - size_t mysize; - mps_addr_t a; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - mysize = 8; - - cdie( - mps_pool_create( - &pool, space, mps_class_mfs(), (size_t) 8, mysize), - "create pool"); - - mps_alloc(&a, pool, 0); - mps_pool_destroy(pool); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/25.c b/mps/qa/argerr/25.c deleted file mode 100644 index c74fb128248..00000000000 --- a/mps/qa/argerr/25.c +++ /dev/null @@ -1,48 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = high bit set 3rd arg to mps_alloc - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmfs.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - - size_t mysize; - mps_addr_t a; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - mysize = 8; - - cdie( - mps_pool_create( - &pool, space, mps_class_mfs(), (size_t) 8, mysize), - "create pool"); - - mps_alloc(&a, pool, HIGHBIT_SIZE+mysize); - mps_pool_destroy(pool); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/26.c b/mps/qa/argerr/26.c deleted file mode 100644 index 26e8fe54991..00000000000 --- a/mps/qa/argerr/26.c +++ /dev/null @@ -1,48 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = wrong 3rd arg to mps_alloc - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmfs.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - - size_t mysize; - mps_addr_t a; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - mysize = 8; - - cdie( - mps_pool_create( - &pool, space, mps_class_mfs(), (size_t) 8, mysize), - "create pool"); - - mps_alloc(&a, pool, mysize+1); - mps_pool_destroy(pool); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/27.c b/mps/qa/argerr/27.c deleted file mode 100644 index a9e2bce76ba..00000000000 --- a/mps/qa/argerr/27.c +++ /dev/null @@ -1,49 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = unaligned 1st arg to mps_free - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmfs.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - - size_t mysize; - mps_addr_t a; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - mysize = 8; - - cdie( - mps_pool_create( - &pool, space, mps_class_mfs(), (size_t) 8, mysize), - "create pool"); - - mps_alloc(&a, pool, mysize); - mps_free(UNALIGNED, a, mysize); - mps_pool_destroy(pool); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/28.c b/mps/qa/argerr/28.c deleted file mode 100644 index 54f4b79ec3a..00000000000 --- a/mps/qa/argerr/28.c +++ /dev/null @@ -1,49 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = NULL 1st arg to mps_free - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmfs.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - - size_t mysize; - mps_addr_t a; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - mysize = 8; - - cdie( - mps_pool_create( - &pool, space, mps_class_mfs(), (size_t) 8, mysize), - "create pool"); - - mps_alloc(&a, pool, mysize); - mps_free(NULL, a, mysize); - mps_pool_destroy(pool); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/29.c b/mps/qa/argerr/29.c deleted file mode 100644 index 6edfbd99843..00000000000 --- a/mps/qa/argerr/29.c +++ /dev/null @@ -1,49 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = unaligned 2nd arg to mps_free - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmfs.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - - size_t mysize; - mps_addr_t a; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - mysize = 8; - - cdie( - mps_pool_create( - &pool, space, mps_class_mfs(), (size_t) 8, mysize), - "create pool"); - - mps_alloc(&a, pool, mysize); - mps_free(pool, (mps_addr_t) ((char *)a+1), mysize); - mps_pool_destroy(pool); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/3.c b/mps/qa/argerr/3.c deleted file mode 100644 index b22a2f713ce..00000000000 --- a/mps/qa/argerr/3.c +++ /dev/null @@ -1,26 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = destroy a space with an unaligned space_t - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -static void test(void) -{ - mps_space_t space; - - cdie(mps_space_create(&space), - "Create space"); - mps_space_destroy(UNALIGNED); -} - -int main(void) -{ - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/30.c b/mps/qa/argerr/30.c deleted file mode 100644 index 13691786b6e..00000000000 --- a/mps/qa/argerr/30.c +++ /dev/null @@ -1,49 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = NULL 2nd arg to mps_free - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmfs.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - - size_t mysize; - mps_addr_t a; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - mysize = 8; - - cdie( - mps_pool_create( - &pool, space, mps_class_mfs(), (size_t) 8, mysize), - "create pool"); - - mps_alloc(&a, pool, mysize); - mps_free(pool, NULL, mysize); - mps_pool_destroy(pool); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/31.c b/mps/qa/argerr/31.c deleted file mode 100644 index 6be1a0ae6de..00000000000 --- a/mps/qa/argerr/31.c +++ /dev/null @@ -1,49 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = zero 3rd arg to mps_free - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmfs.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - - size_t mysize; - mps_addr_t a; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - mysize = 8; - - cdie( - mps_pool_create( - &pool, space, mps_class_mfs(), (size_t) 8, mysize), - "create pool"); - - mps_alloc(&a, pool, mysize); - mps_free(pool, a, 0); - mps_pool_destroy(pool); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/32.c b/mps/qa/argerr/32.c deleted file mode 100644 index 4d3eb601591..00000000000 --- a/mps/qa/argerr/32.c +++ /dev/null @@ -1,49 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = wrong 3rd arg to mps_free - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmfs.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - - size_t mysize; - mps_addr_t a; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - mysize = 8; - - cdie( - mps_pool_create( - &pool, space, mps_class_mfs(), (size_t) 8, mysize), - "create pool"); - - mps_alloc(&a, pool, mysize); - mps_free(pool, a, mysize+8); - mps_pool_destroy(pool); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/33.c b/mps/qa/argerr/33.c deleted file mode 100644 index 20b8fa50e85..00000000000 --- a/mps/qa/argerr/33.c +++ /dev/null @@ -1,49 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = highbit set 3rd arg to mps_free - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmfs.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - - size_t mysize; - mps_addr_t a; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - mysize = 8; - - cdie( - mps_pool_create( - &pool, space, mps_class_mfs(), (size_t) 8, mysize), - "create pool"); - - mps_alloc(&a, pool, mysize); - mps_free(pool, a, HIGHBIT_SIZE+mysize); - mps_pool_destroy(pool); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/34.c b/mps/qa/argerr/34.c deleted file mode 100644 index cdbbe2eac4a..00000000000 --- a/mps/qa/argerr/34.c +++ /dev/null @@ -1,47 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = high bit set 3rd arg to mps_alloc (MV) - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmv.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - - mps_addr_t a; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_pool_create( - &pool, space, mps_class_mv(), - (size_t) 4096, (size_t) 32, (size_t) 64*1024), - "create pool"); - - die(mps_alloc(&a, pool, HIGHBIT_SIZE+8), - "allocation failed (correct)"); - mps_pool_destroy(pool); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/35.c b/mps/qa/argerr/35.c deleted file mode 100644 index 8cded269869..00000000000 --- a/mps/qa/argerr/35.c +++ /dev/null @@ -1,48 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = unaligned addr_t to free (MV) - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmv.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - - mps_addr_t a; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_pool_create( - &pool, space, mps_class_mv(), - (size_t) 4096, (size_t) 32, (size_t) 64*1024), - "create pool"); - - die(mps_alloc(&a, pool, 8), - "alloc"); - mps_free(pool, (mps_addr_t) ((char *)a+1), 8); - mps_pool_destroy(pool); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/36.c b/mps/qa/argerr/36.c deleted file mode 100644 index 701f3bbad18..00000000000 --- a/mps/qa/argerr/36.c +++ /dev/null @@ -1,50 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = wrong size_t to free (MV) - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmv.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - - mps_addr_t a,b; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_pool_create( - &pool, space, mps_class_mv(), - (size_t) 4096, (size_t) 32, (size_t) 64*1024), - "create pool"); - - die(mps_alloc(&a, pool, 8), - "alloc a"); - die(mps_alloc(&b, pool, 32), - "alloc b"); - mps_free(pool, a, 9); - mps_pool_destroy(pool); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/37.c b/mps/qa/argerr/37.c deleted file mode 100644 index 250afd8374d..00000000000 --- a/mps/qa/argerr/37.c +++ /dev/null @@ -1,48 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = wrong size_t to free (MV) - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmv.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - - mps_addr_t a; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_pool_create( - &pool, space, mps_class_mv(), - (size_t) 4096, (size_t) 32, (size_t) 64*1024), - "create pool"); - - die(mps_alloc(&a, pool, 8), - "alloc a"); - mps_free(pool, a, HIGHBIT_SIZE+8); - mps_pool_destroy(pool); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/38.c b/mps/qa/argerr/38.c deleted file mode 100644 index 34fa9df865c..00000000000 --- a/mps/qa/argerr/38.c +++ /dev/null @@ -1,42 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = zero extendBy for pool_create (MFS) - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmfs.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_pool_create( - &pool, space, mps_class_mfs(), (size_t) 0, (size_t) 32), - "create pool"); - - mps_pool_destroy(pool); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/39.c b/mps/qa/argerr/39.c deleted file mode 100644 index 4993389a9ae..00000000000 --- a/mps/qa/argerr/39.c +++ /dev/null @@ -1,42 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = zero unitSize for pool_create (MFS) - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmfs.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_pool_create( - &pool, space, mps_class_mfs(), (size_t) 128, (size_t) 0), - "create pool"); - - mps_pool_destroy(pool); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/4.c b/mps/qa/argerr/4.c deleted file mode 100644 index 16642ba5d2a..00000000000 --- a/mps/qa/argerr/4.c +++ /dev/null @@ -1,46 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = NULL 1st arg to fmt_create_A - language = c - link = testlib.o newfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "arg.h" -#include "newfmt.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(NULL, space, &fmtA), - "create format"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/40.c b/mps/qa/argerr/40.c deleted file mode 100644 index 67926dd8c4c..00000000000 --- a/mps/qa/argerr/40.c +++ /dev/null @@ -1,42 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = unitSize > extendBy for pool_create (MFS) - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmfs.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_pool_create( - &pool, space, mps_class_mfs(), (size_t) 32, (size_t) 33), - "create pool"); - - mps_pool_destroy(pool); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/41.c b/mps/qa/argerr/41.c deleted file mode 100644 index 7156c679095..00000000000 --- a/mps/qa/argerr/41.c +++ /dev/null @@ -1,43 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = zero extendBy for pool_create (MV) - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmv.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_pool_create( - &pool, space, mps_class_mv(), - (size_t) 0, (size_t) 32, (size_t) 32), - "create pool"); - - mps_pool_destroy(pool); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/42.c b/mps/qa/argerr/42.c deleted file mode 100644 index b86346cd3c4..00000000000 --- a/mps/qa/argerr/42.c +++ /dev/null @@ -1,43 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = zero avgSize for pool_create (MV) - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmv.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_pool_create( - &pool, space, mps_class_mv(), - (size_t) 32, (size_t) 0, (size_t) 32), - "create pool"); - - mps_pool_destroy(pool); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/43.c b/mps/qa/argerr/43.c deleted file mode 100644 index 7bd5a9be4b6..00000000000 --- a/mps/qa/argerr/43.c +++ /dev/null @@ -1,43 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = zero maxSize for pool_create (MV) - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmv.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_pool_create( - &pool, space, mps_class_mv(), - (size_t) 32, (size_t) 32, (size_t) 0), - "create pool"); - - mps_pool_destroy(pool); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/44.c b/mps/qa/argerr/44.c deleted file mode 100644 index f94a3ca2604..00000000000 --- a/mps/qa/argerr/44.c +++ /dev/null @@ -1,43 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = extendBy > maxSize for pool_create (MV) - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmv.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_pool_create( - &pool, space, mps_class_mv(), - (size_t) 33, (size_t) 32, (size_t) 32), - "create pool"); - - mps_pool_destroy(pool); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/45.c b/mps/qa/argerr/45.c deleted file mode 100644 index 6b635f1274d..00000000000 --- a/mps/qa/argerr/45.c +++ /dev/null @@ -1,58 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = null ap_t to mps_ap_create - language = c - link = testlib.o newfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "newfmt.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - formatcomments = 0; - - cdie( - mps_pool_create(&pool, space, mps_class_amc(), format), - "create pool"); - - cdie( - mps_ap_create(NULL, pool, MPS_RANK_EXACT), - "create ap"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/46.c b/mps/qa/argerr/46.c deleted file mode 100644 index de325d35810..00000000000 --- a/mps/qa/argerr/46.c +++ /dev/null @@ -1,58 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = UNALIGNED ap_t to mps_ap_create - language = c - link = testlib.o newfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "newfmt.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - formatcomments = 0; - - cdie( - mps_pool_create(&pool, space, mps_class_amc(), format), - "create pool"); - - cdie( - mps_ap_create(UNALIGNED, pool, MPS_RANK_EXACT), - "create ap"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/47.c b/mps/qa/argerr/47.c deleted file mode 100644 index 8d625f4f0f9..00000000000 --- a/mps/qa/argerr/47.c +++ /dev/null @@ -1,59 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = NULL pool to mps_ap_create - language = c - link = testlib.o newfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "newfmt.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_ap_t ap; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - formatcomments = 0; - - cdie( - mps_pool_create(&pool, space, mps_class_amc(), format), - "create pool"); - - cdie( - mps_ap_create(&ap, NULL, MPS_RANK_EXACT), - "create ap"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/48.c b/mps/qa/argerr/48.c deleted file mode 100644 index 600225a07da..00000000000 --- a/mps/qa/argerr/48.c +++ /dev/null @@ -1,59 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = UNALIGNED pool to mps_ap_create - language = c - link = testlib.o newfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "newfmt.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_ap_t ap; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - formatcomments = 0; - - cdie( - mps_pool_create(&pool, space, mps_class_amc(), format), - "create pool"); - - cdie( - mps_ap_create(&ap, UNALIGNED, MPS_RANK_EXACT), - "create ap"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/49.c b/mps/qa/argerr/49.c deleted file mode 100644 index 6283ec1f2a6..00000000000 --- a/mps/qa/argerr/49.c +++ /dev/null @@ -1,59 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = too small rank to mps_ap_create - language = c - link = testlib.o newfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "newfmt.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_ap_t ap; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - formatcomments = 0; - - cdie( - mps_pool_create(&pool, space, mps_class_amc(), format), - "create pool"); - - cdie( - mps_ap_create(&ap, pool, MPS_RANK_MIN-1), - "create ap"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/5.c b/mps/qa/argerr/5.c deleted file mode 100644 index c42109aa58f..00000000000 --- a/mps/qa/argerr/5.c +++ /dev/null @@ -1,46 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = UNALIGNED 1st arg to fmt_create_A - language = c - link = testlib.o newfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "arg.h" -#include "newfmt.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(UNALIGNED, space, &fmtA), - "create format"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/50.c b/mps/qa/argerr/50.c deleted file mode 100644 index 29a6e93f41d..00000000000 --- a/mps/qa/argerr/50.c +++ /dev/null @@ -1,59 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = too big rank to mps_ap_create - language = c - link = testlib.o newfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "newfmt.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_ap_t ap; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - formatcomments = 0; - - cdie( - mps_pool_create(&pool, space, mps_class_amc(), format), - "create pool"); - - cdie( - mps_ap_create(&ap, pool, MPS_RANK_MAX+1), - "create ap"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/51.c b/mps/qa/argerr/51.c deleted file mode 100644 index 8333fa8ddc6..00000000000 --- a/mps/qa/argerr/51.c +++ /dev/null @@ -1,59 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = highbit set rank to mps_ap_create - language = c - link = testlib.o newfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "newfmt.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_ap_t ap; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - formatcomments = 0; - - cdie( - mps_pool_create(&pool, space, mps_class_amc(), format), - "create pool"); - - cdie( - mps_ap_create(&ap, pool, MPS_RANK_EXACT+HIGHBIT_INT), - "create ap"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/52.c b/mps/qa/argerr/52.c deleted file mode 100644 index 88b9c1be1e1..00000000000 --- a/mps/qa/argerr/52.c +++ /dev/null @@ -1,61 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = NULL ap to mps_ap_destroy - language = c - link = testlib.o newfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "newfmt.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_ap_t ap; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - formatcomments = 0; - - cdie( - mps_pool_create(&pool, space, mps_class_amc(), format), - "create pool"); - - cdie( - mps_ap_create(&ap, pool, MPS_RANK_EXACT), - "create ap"); - - mps_ap_destroy(NULL); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/53.c b/mps/qa/argerr/53.c deleted file mode 100644 index 984c5694982..00000000000 --- a/mps/qa/argerr/53.c +++ /dev/null @@ -1,61 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = UNALIGNED ap to mps_ap_destroy - language = c - link = testlib.o newfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "newfmt.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_ap_t ap; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - formatcomments = 0; - - cdie( - mps_pool_create(&pool, space, mps_class_amc(), format), - "create pool"); - - cdie( - mps_ap_create(&ap, pool, MPS_RANK_EXACT), - "create ap"); - - mps_ap_destroy(UNALIGNED); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/54.c b/mps/qa/argerr/54.c deleted file mode 100644 index 0a293ae076a..00000000000 --- a/mps/qa/argerr/54.c +++ /dev/null @@ -1,65 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = null addr_t to mps_reserve - language = c - link = testlib.o newfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "newfmt.h" -#include "arg.h" - -#undef mps_reserve -#undef mps_commit - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_ap_t ap; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - formatcomments = 0; - - cdie( - mps_pool_create(&pool, space, mps_class_amc(), format), - "create pool"); - - cdie( - mps_ap_create(&ap, pool, MPS_RANK_EXACT), - "create ap"); - - cdie( - mps_reserve(NULL, ap, (size_t) 32), "reserve"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/55.c b/mps/qa/argerr/55.c deleted file mode 100644 index e6de7a47491..00000000000 --- a/mps/qa/argerr/55.c +++ /dev/null @@ -1,65 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = UNALIGNED addr_t to mps_reserve - language = c - link = testlib.o newfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "newfmt.h" -#include "arg.h" - -#undef mps_reserve -#undef mps_commit - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_ap_t ap; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - formatcomments = 0; - - cdie( - mps_pool_create(&pool, space, mps_class_amc(), format), - "create pool"); - - cdie( - mps_ap_create(&ap, pool, MPS_RANK_EXACT), - "create ap"); - - cdie( - mps_reserve(UNALIGNED, ap, (size_t) 32), "reserve"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/56.c b/mps/qa/argerr/56.c deleted file mode 100644 index 90bd5e521ab..00000000000 --- a/mps/qa/argerr/56.c +++ /dev/null @@ -1,66 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = NULL ap to mps_reserve - language = c - link = testlib.o newfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "newfmt.h" -#include "arg.h" - -#undef mps_reserve -#undef mps_commit - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_ap_t ap; - mps_addr_t p; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - formatcomments = 0; - - cdie( - mps_pool_create(&pool, space, mps_class_amc(), format), - "create pool"); - - cdie( - mps_ap_create(&ap, pool, MPS_RANK_EXACT), - "create ap"); - - cdie( - mps_reserve(&p, NULL, (size_t) 32), "reserve"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/57.c b/mps/qa/argerr/57.c deleted file mode 100644 index b7d504c7f5f..00000000000 --- a/mps/qa/argerr/57.c +++ /dev/null @@ -1,66 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = UNALIGNED ap to mps_reserve - language = c - link = testlib.o newfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "newfmt.h" -#include "arg.h" - -#undef mps_reserve -#undef mps_commit - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_ap_t ap; - mps_addr_t p; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - formatcomments = 0; - - cdie( - mps_pool_create(&pool, space, mps_class_amc(), format), - "create pool"); - - cdie( - mps_ap_create(&ap, pool, MPS_RANK_EXACT), - "create ap"); - - cdie( - mps_reserve(&p, UNALIGNED, (size_t) 32), "reserve"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/58.c b/mps/qa/argerr/58.c deleted file mode 100644 index a92535d46b8..00000000000 --- a/mps/qa/argerr/58.c +++ /dev/null @@ -1,66 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = zero size to mps_reserve - language = c - link = testlib.o newfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "newfmt.h" -#include "arg.h" - -#undef mps_reserve -#undef mps_commit - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_ap_t ap; - mps_addr_t p; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - formatcomments = 0; - - cdie( - mps_pool_create(&pool, space, mps_class_amc(), format), - "create pool"); - - cdie( - mps_ap_create(&ap, pool, MPS_RANK_EXACT), - "create ap"); - - cdie( - mps_reserve(&p, ap, (size_t) 0), "reserve"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/59.c b/mps/qa/argerr/59.c deleted file mode 100644 index b04978cc72d..00000000000 --- a/mps/qa/argerr/59.c +++ /dev/null @@ -1,66 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = highbit set size to mps_reserve - language = c - link = testlib.o newfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "newfmt.h" -#include "arg.h" - -#undef mps_reserve -#undef mps_commit - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_ap_t ap; - mps_addr_t p; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - formatcomments = 0; - - cdie( - mps_pool_create(&pool, space, mps_class_amc(), format), - "create pool"); - - cdie( - mps_ap_create(&ap, pool, MPS_RANK_EXACT), - "create ap"); - - cdie( - mps_reserve(&p, ap, (size_t) HIGHBIT_SIZE+64), "reserve"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/6.c b/mps/qa/argerr/6.c deleted file mode 100644 index 66d1a20e2d7..00000000000 --- a/mps/qa/argerr/6.c +++ /dev/null @@ -1,48 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = NULL 2nd arg to fmt_create_A - language = c - link = testlib.o newfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "arg.h" -#include "newfmt.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(&format, NULL, &fmtA), - "create format"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/60.c b/mps/qa/argerr/60.c deleted file mode 100644 index 755f96d07dd..00000000000 --- a/mps/qa/argerr/60.c +++ /dev/null @@ -1,66 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = unaligned size to mps_reserve - language = c - link = testlib.o newfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "newfmt.h" -#include "arg.h" - -#undef mps_reserve -#undef mps_commit - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_ap_t ap; - mps_addr_t p; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - formatcomments = 0; - - cdie( - mps_pool_create(&pool, space, mps_class_amc(), format), - "create pool"); - - cdie( - mps_ap_create(&ap, pool, MPS_RANK_EXACT), - "create ap"); - - cdie( - mps_reserve(&p, ap, (size_t) 63), "reserve"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/61.c b/mps/qa/argerr/61.c deleted file mode 100644 index d44ab40cf05..00000000000 --- a/mps/qa/argerr/61.c +++ /dev/null @@ -1,69 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = null ap to mps_commit - language = c - link = testlib.o newfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "newfmt.h" -#include "arg.h" - -#undef mps_reserve -#undef mps_commit - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_ap_t ap; - mps_addr_t p; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - formatcomments = 0; - - cdie( - mps_pool_create(&pool, space, mps_class_amc(), format), - "create pool"); - - cdie( - mps_ap_create(&ap, pool, MPS_RANK_EXACT), - "create ap"); - -do{ - cdie( - mps_reserve(&p, ap, (size_t) 64), "reserve"); -} -while (!mps_commit(NULL, p, (size_t) 64)); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/62.c b/mps/qa/argerr/62.c deleted file mode 100644 index cfcf024ead9..00000000000 --- a/mps/qa/argerr/62.c +++ /dev/null @@ -1,69 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = UNALIGNED ap to mps_commit - language = c - link = testlib.o newfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "newfmt.h" -#include "arg.h" - -#undef mps_reserve -#undef mps_commit - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_ap_t ap; - mps_addr_t p; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - formatcomments = 0; - - cdie( - mps_pool_create(&pool, space, mps_class_amc(), format), - "create pool"); - - cdie( - mps_ap_create(&ap, pool, MPS_RANK_EXACT), - "create ap"); - -do{ - cdie( - mps_reserve(&p, ap, (size_t) 64), "reserve"); -} -while (!mps_commit(UNALIGNED, p, (size_t) 64)); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/63.c b/mps/qa/argerr/63.c deleted file mode 100644 index e09a3e9af60..00000000000 --- a/mps/qa/argerr/63.c +++ /dev/null @@ -1,69 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = NULL addr to mps_commit - language = c - link = testlib.o newfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "newfmt.h" -#include "arg.h" - -#undef mps_reserve -#undef mps_commit - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_ap_t ap; - mps_addr_t p; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - formatcomments = 0; - - cdie( - mps_pool_create(&pool, space, mps_class_amc(), format), - "create pool"); - - cdie( - mps_ap_create(&ap, pool, MPS_RANK_EXACT), - "create ap"); - -do{ - cdie( - mps_reserve(&p, ap, (size_t) 64), "reserve"); -} -while (!mps_commit(ap, NULL, (size_t) 64)); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/64.c b/mps/qa/argerr/64.c deleted file mode 100644 index 1e08ceaca09..00000000000 --- a/mps/qa/argerr/64.c +++ /dev/null @@ -1,69 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = UNALIGNED addr to mps_commit - language = c - link = testlib.o newfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "newfmt.h" -#include "arg.h" - -#undef mps_reserve -#undef mps_commit - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_ap_t ap; - mps_addr_t p; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - formatcomments = 0; - - cdie( - mps_pool_create(&pool, space, mps_class_amc(), format), - "create pool"); - - cdie( - mps_ap_create(&ap, pool, MPS_RANK_EXACT), - "create ap"); - -do{ - cdie( - mps_reserve(&p, ap, (size_t) 64), "reserve"); -} -while (!mps_commit(ap, UNALIGNED, (size_t) 64)); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/65.c b/mps/qa/argerr/65.c deleted file mode 100644 index 307b33de7f1..00000000000 --- a/mps/qa/argerr/65.c +++ /dev/null @@ -1,69 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = zero size to mps_commit - language = c - link = testlib.o newfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "newfmt.h" -#include "arg.h" - -#undef mps_reserve -#undef mps_commit - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_ap_t ap; - mps_addr_t p; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - formatcomments = 0; - - cdie( - mps_pool_create(&pool, space, mps_class_amc(), format), - "create pool"); - - cdie( - mps_ap_create(&ap, pool, MPS_RANK_EXACT), - "create ap"); - -do{ - cdie( - mps_reserve(&p, ap, (size_t) 64), "reserve"); -} -while (!mps_commit(ap, p, (size_t) 0)); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/66.c b/mps/qa/argerr/66.c deleted file mode 100644 index 60fbf3fd923..00000000000 --- a/mps/qa/argerr/66.c +++ /dev/null @@ -1,69 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = highbit set size to mps_commit - language = c - link = testlib.o newfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "newfmt.h" -#include "arg.h" - -#undef mps_reserve -#undef mps_commit - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_ap_t ap; - mps_addr_t p; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - formatcomments = 0; - - cdie( - mps_pool_create(&pool, space, mps_class_amc(), format), - "create pool"); - - cdie( - mps_ap_create(&ap, pool, MPS_RANK_EXACT), - "create ap"); - -do{ - cdie( - mps_reserve(&p, ap, (size_t) 64), "reserve"); -} -while (!mps_commit(ap, p, (size_t) HIGHBIT_SIZE+64)); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/67.c b/mps/qa/argerr/67.c deleted file mode 100644 index f97ff4870d5..00000000000 --- a/mps/qa/argerr/67.c +++ /dev/null @@ -1,69 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = unaligned size to mps_commit - language = c - link = testlib.o newfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "newfmt.h" -#include "arg.h" - -#undef mps_reserve -#undef mps_commit - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_ap_t ap; - mps_addr_t p; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - formatcomments = 0; - - cdie( - mps_pool_create(&pool, space, mps_class_amc(), format), - "create pool"); - - cdie( - mps_ap_create(&ap, pool, MPS_RANK_EXACT), - "create ap"); - -do{ - cdie( - mps_reserve(&p, ap, (size_t) 64), "reserve"); -} -while (!mps_commit(ap, p, (size_t) 63)); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/68.c b/mps/qa/argerr/68.c deleted file mode 100644 index 53e56eabad6..00000000000 --- a/mps/qa/argerr/68.c +++ /dev/null @@ -1,32 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = null thr_t to thread_reg - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(NULL, space), "register thread"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/69.c b/mps/qa/argerr/69.c deleted file mode 100644 index 2d86f76488e..00000000000 --- a/mps/qa/argerr/69.c +++ /dev/null @@ -1,32 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = UNALIGNED thr_t to thread_reg - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(UNALIGNED, space), "register thread"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/7.c b/mps/qa/argerr/7.c deleted file mode 100644 index 84a1befa7ed..00000000000 --- a/mps/qa/argerr/7.c +++ /dev/null @@ -1,48 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = UNALIGNED 2nd arg to fmt_create_A - language = c - link = testlib.o newfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "arg.h" -#include "newfmt.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(&format, UNALIGNED, &fmtA), - "create format"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/70.c b/mps/qa/argerr/70.c deleted file mode 100644 index b912be155bb..00000000000 --- a/mps/qa/argerr/70.c +++ /dev/null @@ -1,33 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = null space_t to thread_reg - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, NULL), "register thread"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/71.c b/mps/qa/argerr/71.c deleted file mode 100644 index 3b9d92ae4c0..00000000000 --- a/mps/qa/argerr/71.c +++ /dev/null @@ -1,33 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = UNALIGNED space_t to thread_reg - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, UNALIGNED), "register thread"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/72.c b/mps/qa/argerr/72.c deleted file mode 100644 index c577d7e7ee3..00000000000 --- a/mps/qa/argerr/72.c +++ /dev/null @@ -1,35 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = null thr_t to thread_dereg - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - mps_thread_dereg(NULL); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/73.c b/mps/qa/argerr/73.c deleted file mode 100644 index 613ff88cb02..00000000000 --- a/mps/qa/argerr/73.c +++ /dev/null @@ -1,35 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = UNALIGNED thr_t to thread_dereg - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - mps_thread_dereg(UNALIGNED); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/74.c b/mps/qa/argerr/74.c deleted file mode 100644 index 07d8be254ec..00000000000 --- a/mps/qa/argerr/74.c +++ /dev/null @@ -1,35 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = null ld for ld_reset - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - mps_ld_reset(NULL, space); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/75.c b/mps/qa/argerr/75.c deleted file mode 100644 index 57bc898f05b..00000000000 --- a/mps/qa/argerr/75.c +++ /dev/null @@ -1,35 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = UNALIGNED ld for ld_reset - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - mps_ld_reset(UNALIGNED, space); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/76.c b/mps/qa/argerr/76.c deleted file mode 100644 index 8ea6a76a37b..00000000000 --- a/mps/qa/argerr/76.c +++ /dev/null @@ -1,36 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = null space for ld_reset - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_ld_s ld; - mps_thr_t thread; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - mps_ld_reset(&ld,NULL); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/77.c b/mps/qa/argerr/77.c deleted file mode 100644 index fdb98b861c8..00000000000 --- a/mps/qa/argerr/77.c +++ /dev/null @@ -1,36 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = UNALIGNED space for ld_reset - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_ld_s ld; - mps_thr_t thread; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - mps_ld_reset(&ld,UNALIGNED); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/78.c b/mps/qa/argerr/78.c deleted file mode 100644 index 6372e1deafa..00000000000 --- a/mps/qa/argerr/78.c +++ /dev/null @@ -1,38 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = null ld for ld_add - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_ld_s ld; - mps_thr_t thread; - mps_addr_t p; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - mps_ld_reset(&ld, space); - - mps_ld_add(NULL, space, &p); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/79.c b/mps/qa/argerr/79.c deleted file mode 100644 index f211adc926f..00000000000 --- a/mps/qa/argerr/79.c +++ /dev/null @@ -1,38 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = UNALIGNED ld for ld_add - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_ld_s ld; - mps_thr_t thread; - mps_addr_t p; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - mps_ld_reset(&ld, space); - - mps_ld_add(UNALIGNED, space, &p); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/8.c b/mps/qa/argerr/8.c deleted file mode 100644 index f597cb76d92..00000000000 --- a/mps/qa/argerr/8.c +++ /dev/null @@ -1,50 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = NULL arg to fmt_destroy - language = c - link = testlib.o newfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "arg.h" -#include "newfmt.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - mps_fmt_destroy(NULL); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/80.c b/mps/qa/argerr/80.c deleted file mode 100644 index 5764dcb1f98..00000000000 --- a/mps/qa/argerr/80.c +++ /dev/null @@ -1,38 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = null space for ld_add - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_ld_s ld; - mps_thr_t thread; - mps_addr_t p; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - mps_ld_reset(&ld, space); - - mps_ld_add(&ld, NULL, &p); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/81.c b/mps/qa/argerr/81.c deleted file mode 100644 index 7677b5d30c1..00000000000 --- a/mps/qa/argerr/81.c +++ /dev/null @@ -1,38 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = UNALIGNED space for ld_add - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_ld_s ld; - mps_thr_t thread; - mps_addr_t p; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - mps_ld_reset(&ld, space); - - mps_ld_add(&ld, UNALIGNED, &p); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/82.c b/mps/qa/argerr/82.c deleted file mode 100644 index 545b8242789..00000000000 --- a/mps/qa/argerr/82.c +++ /dev/null @@ -1,38 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = null addr for ld_add - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_ld_s ld; - mps_thr_t thread; - mps_addr_t p; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - mps_ld_reset(&ld, space); - - mps_ld_add(&ld, space, NULL); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/83.c b/mps/qa/argerr/83.c deleted file mode 100644 index b1f320dc292..00000000000 --- a/mps/qa/argerr/83.c +++ /dev/null @@ -1,38 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = UNALIGNED addr for ld_add - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_ld_s ld; - mps_thr_t thread; - mps_addr_t p; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - mps_ld_reset(&ld, space); - - mps_ld_add(&ld, space, UNALIGNED); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/84.c b/mps/qa/argerr/84.c deleted file mode 100644 index 35f6fa03cf4..00000000000 --- a/mps/qa/argerr/84.c +++ /dev/null @@ -1,40 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = null ld for is_stale - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_ld_s ld; - mps_thr_t thread; - mps_addr_t p; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - mps_ld_reset(&ld, space); - - mps_ld_add(&ld, space, &p); - - mps_ld_isstale(NULL, space, &p); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/85.c b/mps/qa/argerr/85.c deleted file mode 100644 index e7919d8f741..00000000000 --- a/mps/qa/argerr/85.c +++ /dev/null @@ -1,40 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = UNALIGNED ld for is_stale - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_ld_s ld; - mps_thr_t thread; - mps_addr_t p; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - mps_ld_reset(&ld, space); - - mps_ld_add(&ld, space, &p); - - mps_ld_isstale(UNALIGNED, space, &p); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/86.c b/mps/qa/argerr/86.c deleted file mode 100644 index 975f7d1ac3d..00000000000 --- a/mps/qa/argerr/86.c +++ /dev/null @@ -1,40 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = NULL space for is_stale - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_ld_s ld; - mps_thr_t thread; - mps_addr_t p; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - mps_ld_reset(&ld, space); - - mps_ld_add(&ld, space, &p); - - mps_ld_isstale(&ld, NULL, &p); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/87.c b/mps/qa/argerr/87.c deleted file mode 100644 index c3991c6c83a..00000000000 --- a/mps/qa/argerr/87.c +++ /dev/null @@ -1,40 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = UNALIGNED space for is_stale - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_ld_s ld; - mps_thr_t thread; - mps_addr_t p; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - mps_ld_reset(&ld, space); - - mps_ld_add(&ld, space, &p); - - mps_ld_isstale(&ld, UNALIGNED, &p); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/88.c b/mps/qa/argerr/88.c deleted file mode 100644 index 7671744567b..00000000000 --- a/mps/qa/argerr/88.c +++ /dev/null @@ -1,40 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = NULL addr for is_stale - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_ld_s ld; - mps_thr_t thread; - mps_addr_t p; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - mps_ld_reset(&ld, space); - - mps_ld_add(&ld, space, &p); - - mps_ld_isstale(&ld, space, NULL); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/89.c b/mps/qa/argerr/89.c deleted file mode 100644 index e3fbe76bb16..00000000000 --- a/mps/qa/argerr/89.c +++ /dev/null @@ -1,40 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = UNALIGNED addr for is_stale - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_ld_s ld; - mps_thr_t thread; - mps_addr_t p; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - mps_ld_reset(&ld, space); - - mps_ld_add(&ld, space, &p); - - mps_ld_isstale(&ld, space, UNALIGNED); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/9.c b/mps/qa/argerr/9.c deleted file mode 100644 index c801466908f..00000000000 --- a/mps/qa/argerr/9.c +++ /dev/null @@ -1,50 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = UNALIGNED arg to fmt_destroy - language = c - link = testlib.o newfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "arg.h" -#include "newfmt.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - mps_fmt_destroy(UNALIGNED); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/90.c b/mps/qa/argerr/90.c deleted file mode 100644 index 0d772a1e531..00000000000 --- a/mps/qa/argerr/90.c +++ /dev/null @@ -1,42 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = null &root_t for mps_root_create - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static mps_res_t rootscan(mps_ss_t ss, void *p, size_t s) -{ - return MPS_RES_OK; -} - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie(mps_root_create(NULL, space, MPS_RANK_AMBIG, 0, - rootscan, NULL, 0), - "root create"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/91.c b/mps/qa/argerr/91.c deleted file mode 100644 index 8b44b3f6ad8..00000000000 --- a/mps/qa/argerr/91.c +++ /dev/null @@ -1,42 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = UNALIGNED &root_t for mps_root_create - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static mps_res_t rootscan(mps_ss_t ss, void *p, size_t s) -{ - return MPS_RES_OK; -} - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie(mps_root_create(UNALIGNED, space, MPS_RANK_AMBIG, 0, - rootscan, NULL, 0), - "root create"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/92.c b/mps/qa/argerr/92.c deleted file mode 100644 index ab13bfbc185..00000000000 --- a/mps/qa/argerr/92.c +++ /dev/null @@ -1,43 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = null space for mps_root_create - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static mps_res_t rootscan(mps_ss_t ss, void *p, size_t s) -{ - return MPS_RES_OK; -} - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - mps_root_t root; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie(mps_root_create(&root, NULL, MPS_RANK_AMBIG, 0, - rootscan, NULL, 0), - "root create"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/93.c b/mps/qa/argerr/93.c deleted file mode 100644 index ac93eaff013..00000000000 --- a/mps/qa/argerr/93.c +++ /dev/null @@ -1,43 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = UNALIGNED space for mps_root_create - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static mps_res_t rootscan(mps_ss_t ss, void *p, size_t s) -{ - return MPS_RES_OK; -} - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - mps_root_t root; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie(mps_root_create(&root, UNALIGNED, MPS_RANK_AMBIG, 0, - rootscan, NULL, 0), - "root create"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/94.c b/mps/qa/argerr/94.c deleted file mode 100644 index 51468d389ba..00000000000 --- a/mps/qa/argerr/94.c +++ /dev/null @@ -1,43 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = MPS_RANK_MIN-1 rank for mps_root_create - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static mps_res_t rootscan(mps_ss_t ss, void *p, size_t s) -{ - return MPS_RES_OK; -} - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - mps_root_t root; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie(mps_root_create(&root, space, MPS_RANK_MIN-1, 0, - rootscan, NULL, 0), - "root create"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/95.c b/mps/qa/argerr/95.c deleted file mode 100644 index 8709305b28c..00000000000 --- a/mps/qa/argerr/95.c +++ /dev/null @@ -1,43 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = MPS_RANK_MAX+1 rank for mps_root_create - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static mps_res_t rootscan(mps_ss_t ss, void *p, size_t s) -{ - return MPS_RES_OK; -} - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - mps_root_t root; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie(mps_root_create(&root, space, MPS_RANK_MAX+1, 0, - rootscan, NULL, 0), - "root create"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/96.c b/mps/qa/argerr/96.c deleted file mode 100644 index 747eea2da29..00000000000 --- a/mps/qa/argerr/96.c +++ /dev/null @@ -1,43 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = highbit set rank for mps_root_create - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static mps_res_t rootscan(mps_ss_t ss, void *p, size_t s) -{ - return MPS_RES_OK; -} - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - mps_root_t root; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie(mps_root_create(&root, space, MPS_RANK_AMBIG+HIGHBIT_INT, 0, - rootscan, NULL, 0), - "root create"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/97.c b/mps/qa/argerr/97.c deleted file mode 100644 index 1448cc96241..00000000000 --- a/mps/qa/argerr/97.c +++ /dev/null @@ -1,43 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = MIN-1 root mode for mps_root_create - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static mps_res_t rootscan(mps_ss_t ss, void *p, size_t s) -{ - return MPS_RES_OK; -} - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - mps_root_t root; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie(mps_root_create(&root, space, MPS_RANK_AMBIG, MPS_RM_MIN-1, - rootscan, NULL, 0), - "root create"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/98.c b/mps/qa/argerr/98.c deleted file mode 100644 index e99c2d54cc7..00000000000 --- a/mps/qa/argerr/98.c +++ /dev/null @@ -1,43 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = MAX+1 root mode for mps_root_create - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static mps_res_t rootscan(mps_ss_t ss, void *p, size_t s) -{ - return MPS_RES_OK; -} - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - mps_root_t root; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie(mps_root_create(&root, space, MPS_RANK_AMBIG, MPS_RM_MAX+1, - rootscan, NULL, 0), - "root create"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/argerr/99.c b/mps/qa/argerr/99.c deleted file mode 100644 index fdd05548abe..00000000000 --- a/mps/qa/argerr/99.c +++ /dev/null @@ -1,43 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = highbit set root mode for mps_root_create - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "arg.h" - -void *stackpointer; - -static mps_res_t rootscan(mps_ss_t ss, void *p, size_t s) -{ - return MPS_RES_OK; -} - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - mps_root_t root; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie(mps_root_create(&root, space, MPS_RANK_AMBIG, HIGHBIT_INT, - rootscan, NULL, 0), - "root create"); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/conerr/0.c b/mps/qa/conerr/0.c deleted file mode 100644 index c3fbb152576..00000000000 --- a/mps/qa/conerr/0.c +++ /dev/null @@ -1,27 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = create a space and then destroy it, twice! - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" - -static void test(void) -{ - mps_space_t space; - - cdie(mps_space_create(&space), "Create space"); - mps_space_destroy(space); - comment("Destroy space once."); - mps_space_destroy(space); - comment("Destroy space twice!"); -} - -int main(void) -{ - easy_tramp(test); - return 0; -} diff --git a/mps/qa/conerr/1.c b/mps/qa/conerr/1.c deleted file mode 100644 index 43a4fa4cb5d..00000000000 --- a/mps/qa/conerr/1.c +++ /dev/null @@ -1,24 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = destroy a space without creating it - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" - -static void test(void) -{ - mps_space_t space; - - mps_space_destroy(space); - comment("Destroy space."); -} - -int main(void) -{ - easy_tramp(test); - return 0; -} diff --git a/mps/qa/conerr/10.c b/mps/qa/conerr/10.c deleted file mode 100644 index fcf4b051041..00000000000 --- a/mps/qa/conerr/10.c +++ /dev/null @@ -1,56 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = destroy a format though uncreated - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmv.h" - -static void zilch(void) -{ -} - - -static mps_addr_t myskip(mps_addr_t object) -{ - return object; -} - -static void test(void) -{ - mps_space_t space; - mps_fmt_t format; - mps_fmt_A_s fmtA; - - - cdie(mps_space_create(&space), "create space"); - - fmtA.align = (mps_align_t) 1; - fmtA.scan = &zilch; - fmtA.skip = &myskip; - fmtA.copy = &zilch; - fmtA.fwd = &zilch; - fmtA.isfwd = &zilch; - fmtA.pad = &zilch; - -/* cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); -*/ - - mps_fmt_destroy(format); - comment("Destroyed format."); - - mps_space_destroy(space); - comment("Destroyed space."); -} - -int main(void) -{ - easy_tramp(test); - return 0; -} diff --git a/mps/qa/conerr/11.c b/mps/qa/conerr/11.c deleted file mode 100644 index cec34b530df..00000000000 --- a/mps/qa/conerr/11.c +++ /dev/null @@ -1,58 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = destroy a format twice - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmv.h" - -static void zilch(void) -{ -} - - -static mps_addr_t myskip(mps_addr_t object) -{ - return object; -} - -static void test(void) -{ - mps_space_t space; - mps_fmt_t format; - mps_fmt_A_s fmtA; - - - cdie(mps_space_create(&space), "create space"); - - fmtA.align = (mps_align_t) 1; - fmtA.scan = &zilch; - fmtA.skip = &myskip; - fmtA.copy = &zilch; - fmtA.fwd = &zilch; - fmtA.isfwd = &zilch; - fmtA.pad = &zilch; - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - mps_fmt_destroy(format); - comment("Destroyed format."); - - mps_fmt_destroy(format); - comment("Destroyed format."); - - mps_space_destroy(space); - comment("Destroyed space."); -} - -int main(void) -{ - easy_tramp(test); - return 0; -} diff --git a/mps/qa/conerr/12.c b/mps/qa/conerr/12.c deleted file mode 100644 index 8aeb122fcb0..00000000000 --- a/mps/qa/conerr/12.c +++ /dev/null @@ -1,62 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = destroy a format though attached to a pool - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpsclo.h" - -static void zilch(void) -{ -} - - -static mps_addr_t myskip(mps_addr_t object) -{ - return object; -} - -static void test(void) -{ - mps_space_t space; - mps_fmt_t format; - mps_fmt_A_s fmtA; - mps_pool_t pool; - - cdie(mps_space_create(&space), "create space"); - - fmtA.align = (mps_align_t) 1; - fmtA.scan = &zilch; - fmtA.skip = &myskip; - fmtA.copy = &zilch; - fmtA.fwd = &zilch; - fmtA.isfwd = &zilch; - fmtA.pad = &zilch; - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - cdie( - mps_pool_create(&pool, space, mps_class_lo(), format), - "create pool"); - - mps_fmt_destroy(format); - comment("Destroyed format."); - - mps_pool_destroy(pool); - comment("Destroyed pool."); - - mps_space_destroy(space); - comment("Destroyed space."); -} - -int main(void) -{ - easy_tramp(test); - return 0; -} diff --git a/mps/qa/conerr/13.c b/mps/qa/conerr/13.c deleted file mode 100644 index 3f571a9b6fd..00000000000 --- a/mps/qa/conerr/13.c +++ /dev/null @@ -1,45 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = create a pool in an uncreated space - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmv.h" - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - size_t extendBy; - size_t avgSize; - size_t maxSize; - - extendBy = (size_t) 4096; - avgSize = (size_t) 32; - maxSize = (size_t) 65536; - -/* cdie(mps_space_create(&space), "create space"); -*/ - space=malloc(64); - - cdie( - mps_pool_create(&pool, space, mps_class_mv(), - extendBy, avgSize, maxSize), - "create pool"); - - mps_pool_destroy(pool); - comment("Destroyed pool."); - - mps_space_destroy(space); - comment("Destroyed space."); -} - -int main(void) -{ - easy_tramp(test); - return 0; -} diff --git a/mps/qa/conerr/14.c b/mps/qa/conerr/14.c deleted file mode 100644 index c9bad18a920..00000000000 --- a/mps/qa/conerr/14.c +++ /dev/null @@ -1,40 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = create a pool in a destroyed space - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmv.h" - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - size_t extendBy; - size_t avgSize; - size_t maxSize; - - extendBy = (size_t) 4096; - avgSize = (size_t) 32; - maxSize = (size_t) 65536; - - cdie(mps_space_create(&space), "create space"); - - mps_space_destroy(space); - comment("Destroyed space."); - - cdie( - mps_pool_create(&pool, space, mps_class_mv(), - extendBy, avgSize, maxSize), - "create pool"); -} - -int main(void) -{ - easy_tramp(test); - return 0; -} diff --git a/mps/qa/conerr/15.c b/mps/qa/conerr/15.c deleted file mode 100644 index d4f280bd9fb..00000000000 --- a/mps/qa/conerr/15.c +++ /dev/null @@ -1,45 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = destroy an uncreated pool - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmv.h" - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - size_t extendBy; - size_t avgSize; - size_t maxSize; - - extendBy = (size_t) 4096; - avgSize = (size_t) 32; - maxSize = (size_t) 65536; - - cdie(mps_space_create(&space), "create space"); - -/* - cdie( - mps_pool_create(&pool, space, mps_class_mv(), - extendBy, avgSize, maxSize), - "create pool"); -*/ - - mps_pool_destroy(pool); - comment("Destroyed pool."); - - mps_space_destroy(space); - comment("Destroyed space."); -} - -int main(void) -{ - easy_tramp(test); - return 0; -} diff --git a/mps/qa/conerr/16.c b/mps/qa/conerr/16.c deleted file mode 100644 index dcfd885b20c..00000000000 --- a/mps/qa/conerr/16.c +++ /dev/null @@ -1,46 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = destroy a pool twice - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmv.h" - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - size_t extendBy; - size_t avgSize; - size_t maxSize; - - extendBy = (size_t) 4096; - avgSize = (size_t) 32; - maxSize = (size_t) 65536; - - cdie(mps_space_create(&space), "create space"); - - cdie( - mps_pool_create(&pool, space, mps_class_mv(), - extendBy, avgSize, maxSize), - "create pool"); - - mps_pool_destroy(pool); - comment("Destroyed pool."); - - mps_pool_destroy(pool); - comment("Destroyed pool again."); - - mps_space_destroy(space); - comment("Destroyed space."); -} - -int main(void) -{ - easy_tramp(test); - return 0; -} diff --git a/mps/qa/conerr/17.c b/mps/qa/conerr/17.c deleted file mode 100644 index 58ce32707c7..00000000000 --- a/mps/qa/conerr/17.c +++ /dev/null @@ -1,74 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = destroy a pool though containining an AP - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpsclo.h" - -static void zilch(void) -{ -} - - -static mps_addr_t myskip(mps_addr_t object) -{ - return *(mps_addr_t *)object; -} - - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - - mps_fmt_t format; - mps_fmt_A_s fmtA; - mps_ap_t ap; - - cdie(mps_space_create(&space), "create space"); - - fmtA.align = (mps_align_t) 1; - fmtA.scan = &zilch; - fmtA.skip = &myskip; - fmtA.copy = &zilch; - fmtA.fwd = &zilch; - fmtA.isfwd = &zilch; - fmtA.pad = &zilch; - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - cdie( - mps_pool_create(&pool, space, mps_class_lo(), format), - "create pool"); - - cdie( - mps_ap_create(&ap, pool, MPS_RANK_EXACT), - "create ap"); - -/* - mps_ap_destroy(ap); - comment("Destroyed ap."); -*/ - - mps_pool_destroy(pool); - comment("Destroyed pool."); - - mps_fmt_destroy(format); - comment("Destroyed format."); - - mps_space_destroy(space); - comment("Destroyed space."); -} - -int main(void) -{ - easy_tramp(test); - return 0; -} diff --git a/mps/qa/conerr/18.c b/mps/qa/conerr/18.c deleted file mode 100644 index dfb3e2e4b6a..00000000000 --- a/mps/qa/conerr/18.c +++ /dev/null @@ -1,68 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = create a pool with a format in the wrong space - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpsclo.h" - -static void zilch(void) -{ -} - - -static mps_addr_t myskip(mps_addr_t object) -{ - return *(mps_addr_t *)object; -} - - -static void test(void) -{ - mps_space_t space; - mps_space_t space1; - mps_pool_t pool; - - mps_fmt_t format; - mps_fmt_A_s fmtA; - - cdie(mps_space_create(&space), "create space 0"); - cdie(mps_space_create(&space1), "create space 1"); - - fmtA.align = (mps_align_t) 1; - fmtA.scan = &zilch; - fmtA.skip = &myskip; - fmtA.copy = &zilch; - fmtA.fwd = &zilch; - fmtA.isfwd = &zilch; - fmtA.pad = &zilch; - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format in space 0"); - - cdie( - mps_pool_create(&pool, space1, mps_class_lo(), format), - "create pool in space 1"); - - mps_pool_destroy(pool); - comment("Destroyed pool."); - - mps_fmt_destroy(format); - comment("Destroyed format."); - - mps_space_destroy(space); - comment("Destroyed space 0."); - mps_space_destroy(space1); - comment("Destroyed space 1."); -} - -int main(void) -{ - easy_tramp(test); - return 0; -} diff --git a/mps/qa/conerr/19.c b/mps/qa/conerr/19.c deleted file mode 100644 index b9e9e69a4ef..00000000000 --- a/mps/qa/conerr/19.c +++ /dev/null @@ -1,49 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = alloc in an uncreated pool - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmv.h" - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - size_t extendBy; - size_t avgSize; - size_t maxSize; - - mps_addr_t obj; - - extendBy = (size_t) 4096; - avgSize = (size_t) 32; - maxSize = (size_t) 65536; - - cdie(mps_space_create(&space), "create space"); - -/* - cdie( - mps_pool_create(&pool, space, mps_class_mv(), - extendBy, avgSize, maxSize), - "create pool"); -*/ - - cdie(mps_alloc(&obj, pool, 152), "allocate"); - - mps_pool_destroy(pool); - comment("Destroyed pool"); - - mps_space_destroy(space); - comment("Destroyed space."); -} - -int main(void) -{ - easy_tramp(test); - return 0; -} diff --git a/mps/qa/conerr/2.c b/mps/qa/conerr/2.c deleted file mode 100644 index 36534959a37..00000000000 --- a/mps/qa/conerr/2.c +++ /dev/null @@ -1,25 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = destroy a space which isn't a space - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" - -static void test(void) -{ - mps_space_t space; - - space = malloc(64); - mps_space_destroy(space); - comment("Destroy space."); -} - -int main(void) -{ - easy_tramp(test); - return 0; -} diff --git a/mps/qa/conerr/20.c b/mps/qa/conerr/20.c deleted file mode 100644 index 259474da70f..00000000000 --- a/mps/qa/conerr/20.c +++ /dev/null @@ -1,47 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = alloc in an destroyed pool - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmv.h" - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - size_t extendBy; - size_t avgSize; - size_t maxSize; - - mps_addr_t obj; - - extendBy = (size_t) 4096; - avgSize = (size_t) 32; - maxSize = (size_t) 65536; - - cdie(mps_space_create(&space), "create space"); - - cdie( - mps_pool_create(&pool, space, mps_class_mv(), - extendBy, avgSize, maxSize), - "create pool"); - - mps_pool_destroy(pool); - comment("Destroyed pool"); - - cdie(mps_alloc(&obj, pool, 152), "allocate"); - - mps_space_destroy(space); - comment("Destroyed space."); -} - -int main(void) -{ - easy_tramp(test); - return 0; -} diff --git a/mps/qa/conerr/21.c b/mps/qa/conerr/21.c deleted file mode 100644 index d61adbcd550..00000000000 --- a/mps/qa/conerr/21.c +++ /dev/null @@ -1,50 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = free in a destroyed pool - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmv.h" - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - size_t extendBy; - size_t avgSize; - size_t maxSize; - - mps_addr_t obj; - - extendBy = (size_t) 4096; - avgSize = (size_t) 32; - maxSize = (size_t) 65536; - - cdie(mps_space_create(&space), "create space"); - - cdie( - mps_pool_create(&pool, space, mps_class_mv(), - extendBy, avgSize, maxSize), - "create pool"); - - cdie(mps_alloc(&obj, pool, 152), "allocate"); - - mps_pool_destroy(pool); - comment("Destroyed pool"); - - mps_free(pool, obj, 512); - comment("Freed."); - - mps_space_destroy(space); - comment("Destroyed space."); -} - -int main(void) -{ - easy_tramp(test); - return 0; -} diff --git a/mps/qa/conerr/22.c b/mps/qa/conerr/22.c deleted file mode 100644 index 830ab613d54..00000000000 --- a/mps/qa/conerr/22.c +++ /dev/null @@ -1,50 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = free though not allocated - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmv.h" - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - size_t extendBy; - size_t avgSize; - size_t maxSize; - - mps_addr_t obj; - - extendBy = (size_t) 4096; - avgSize = (size_t) 32; - maxSize = (size_t) 65536; - - cdie(mps_space_create(&space), "create space"); - - cdie( - mps_pool_create(&pool, space, mps_class_mv(), - extendBy, avgSize, maxSize), - "create pool"); -/* - cdie(mps_alloc(&obj, pool, 152), "allocate"); -*/ - mps_free(pool, obj, 512); - comment("Freed."); - - mps_pool_destroy(pool); - comment("Destroyed pool"); - - mps_space_destroy(space); - comment("Destroyed space."); -} - -int main(void) -{ - easy_tramp(test); - return 0; -} diff --git a/mps/qa/conerr/23.c b/mps/qa/conerr/23.c deleted file mode 100644 index 8dfaa3e2659..00000000000 --- a/mps/qa/conerr/23.c +++ /dev/null @@ -1,53 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = free though not allocated - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmv.h" - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - size_t extendBy; - size_t avgSize; - size_t maxSize; - - mps_addr_t obj; - - extendBy = (size_t) 4096; - avgSize = (size_t) 32; - maxSize = (size_t) 65536; - - cdie(mps_space_create(&space), "create space"); - - cdie( - mps_pool_create(&pool, space, mps_class_mv(), - extendBy, avgSize, maxSize), - "create pool"); - - cdie(mps_alloc(&obj, pool, 152), "allocate"); - - mps_free(pool, obj, 152); - comment("Freed."); - - mps_free(pool, obj, 152); - comment("Freed again."); - - mps_pool_destroy(pool); - comment("Destroyed pool"); - - mps_space_destroy(space); - comment("Destroyed space."); -} - -int main(void) -{ - easy_tramp(test); - return 0; -} diff --git a/mps/qa/conerr/24.c b/mps/qa/conerr/24.c deleted file mode 100644 index 4263f792c9f..00000000000 --- a/mps/qa/conerr/24.c +++ /dev/null @@ -1,68 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = alloc in pool not supporting alloc - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpsclo.h" - -static void zilch(void) -{ -} - -static mps_addr_t myskip(mps_addr_t object) -{ - return object; -} - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_fmt_t format; - mps_fmt_A_s fmtA; - - mps_addr_t obj; - - cdie(mps_space_create(&space), "create space"); - - fmtA.align = (mps_align_t) 1; - fmtA.scan = &zilch; - fmtA.skip = &myskip; - fmtA.copy = &zilch; - fmtA.fwd = &zilch; - fmtA.isfwd = &zilch; - fmtA.pad = &zilch; - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - cdie( - mps_pool_create(&pool, space, mps_class_lo(), format), - "create pool"); - - cdie(mps_alloc(&obj, pool, 152), "allocate"); - - mps_free(pool, obj, 152); - comment("Freed."); - - mps_free(pool, obj, 152); - comment("Freed again."); - - mps_pool_destroy(pool); - comment("Destroyed pool"); - - mps_space_destroy(space); - comment("Destroyed space."); -} - -int main(void) -{ - easy_tramp(test); - return 0; -} diff --git a/mps/qa/conerr/25.c b/mps/qa/conerr/25.c deleted file mode 100644 index b7bfd32b9e8..00000000000 --- a/mps/qa/conerr/25.c +++ /dev/null @@ -1,70 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = free in pool not supporting alloc (n.b. this means no alloc at the moment) - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpsclo.h" - -static void zilch(void) -{ -} - -static mps_addr_t myskip(mps_addr_t object) -{ - return object; -} - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_fmt_t format; - mps_fmt_A_s fmtA; - - mps_addr_t obj; - - cdie(mps_space_create(&space), "create space"); - - fmtA.align = (mps_align_t) 1; - fmtA.scan = &zilch; - fmtA.skip = &myskip; - fmtA.copy = &zilch; - fmtA.fwd = &zilch; - fmtA.isfwd = &zilch; - fmtA.pad = &zilch; - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - cdie( - mps_pool_create(&pool, space, mps_class_lo(), format), - "create pool"); - -/* - cdie(mps_alloc(&obj, pool, 152), "allocate"); -*/ - - mps_free(pool, obj, 152); - comment("Freed."); - - mps_free(pool, obj, 152); - comment("Freed again."); - - mps_pool_destroy(pool); - comment("Destroyed pool"); - - mps_space_destroy(space); - comment("Destroyed space."); -} - -int main(void) -{ - easy_tramp(test); - return 0; -} diff --git a/mps/qa/conerr/26.c b/mps/qa/conerr/26.c deleted file mode 100644 index 35e081a58ae..00000000000 --- a/mps/qa/conerr/26.c +++ /dev/null @@ -1,51 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = free in the wrong pool - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmv.h" - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_pool_t pool1; - size_t extendBy; - size_t avgSize; - size_t maxSize; - - mps_addr_t obj; - - extendBy = (size_t) 4096; - avgSize = (size_t) 32; - maxSize = (size_t) 65536; - - cdie(mps_space_create(&space), "create space"); - - cdie( - mps_pool_create(&pool, space, mps_class_mv(), - extendBy, avgSize, maxSize), - "create pool 0"); - - cdie( - mps_pool_create(&pool1, space, mps_class_mv(), - extendBy, avgSize, maxSize), - "create pool 1"); - - cdie(mps_alloc(&obj, pool, 152), "allocate in 0"); - - mps_free(pool, obj, 512); - comment("Freed in 1."); - -} - -int main(void) -{ - easy_tramp(test); - return 0; -} diff --git a/mps/qa/conerr/27.c b/mps/qa/conerr/27.c deleted file mode 100644 index c1c7c22d07b..00000000000 --- a/mps/qa/conerr/27.c +++ /dev/null @@ -1,57 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = free in the wrong pool (and a destroyed pool at that!) - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmv.h" - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_pool_t pool1; - size_t extendBy; - size_t avgSize; - size_t maxSize; - - mps_addr_t obj; - - extendBy = (size_t) 4096; - avgSize = (size_t) 32; - maxSize = (size_t) 65536; - - cdie(mps_space_create(&space), "create space"); - - cdie( - mps_pool_create(&pool, space, mps_class_mv(), - extendBy, avgSize, maxSize), - "create pool 0"); - - cdie( - mps_pool_create(&pool1, space, mps_class_mv(), - extendBy, avgSize, maxSize), - "create pool 1"); - - cdie(mps_alloc(&obj, pool, 152), "allocate in 0"); - - mps_pool_destroy(pool1); - comment("Pool 1 destroyed."); - - mps_free(pool, obj, 512); - comment("Freed in 1."); - - mps_pool_destroy(pool); - comment("Pool 0 destroyed."); - -} - -int main(void) -{ - easy_tramp(test); - return 0; -} diff --git a/mps/qa/conerr/28.c b/mps/qa/conerr/28.c deleted file mode 100644 index d1d362f2d0f..00000000000 --- a/mps/qa/conerr/28.c +++ /dev/null @@ -1,74 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = create an AP in an uncreated pool - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpsclo.h" - -static void zilch(void) -{ -} - - -static mps_addr_t myskip(mps_addr_t object) -{ - return *(mps_addr_t *)object; -} - - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - - mps_fmt_t format; - mps_fmt_A_s fmtA; - mps_ap_t ap; - - cdie(mps_space_create(&space), "create space"); - - fmtA.align = (mps_align_t) 1; - fmtA.scan = &zilch; - fmtA.skip = &myskip; - fmtA.copy = &zilch; - fmtA.fwd = &zilch; - fmtA.isfwd = &zilch; - fmtA.pad = &zilch; - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - -/* - cdie( - mps_pool_create(&pool, space, mps_class_lo(), format), - "create pool"); -*/ - - cdie( - mps_ap_create(&ap, pool, MPS_RANK_EXACT), - "create ap"); - - mps_ap_destroy(ap); - comment("Destroyed ap."); - - mps_pool_destroy(pool); - comment("Destroyed pool."); - - mps_fmt_destroy(format); - comment("Destroyed format."); - - mps_space_destroy(space); - comment("Destroyed space."); -} - -int main(void) -{ - easy_tramp(test); - return 0; -} diff --git a/mps/qa/conerr/29.c b/mps/qa/conerr/29.c deleted file mode 100644 index 94fb96a4384..00000000000 --- a/mps/qa/conerr/29.c +++ /dev/null @@ -1,72 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = create an AP in a destroyed pool - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpsclo.h" - -static void zilch(void) -{ -} - - -static mps_addr_t myskip(mps_addr_t object) -{ - return *(mps_addr_t *)object; -} - - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - - mps_fmt_t format; - mps_fmt_A_s fmtA; - mps_ap_t ap; - - cdie(mps_space_create(&space), "create space"); - - fmtA.align = (mps_align_t) 1; - fmtA.scan = &zilch; - fmtA.skip = &myskip; - fmtA.copy = &zilch; - fmtA.fwd = &zilch; - fmtA.isfwd = &zilch; - fmtA.pad = &zilch; - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - cdie( - mps_pool_create(&pool, space, mps_class_lo(), format), - "create pool"); - - mps_pool_destroy(pool); - comment("Destroyed pool."); - - cdie( - mps_ap_create(&ap, pool, MPS_RANK_EXACT), - "create ap"); - - mps_ap_destroy(ap); - comment("Destroyed ap."); - - mps_fmt_destroy(format); - comment("Destroyed format."); - - mps_space_destroy(space); - comment("Destroyed space."); -} - -int main(void) -{ - easy_tramp(test); - return 0; -} diff --git a/mps/qa/conerr/3.c b/mps/qa/conerr/3.c deleted file mode 100644 index a216336276a..00000000000 --- a/mps/qa/conerr/3.c +++ /dev/null @@ -1,25 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = destroy a space which isn't a space, with a pointer in - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" - -static void test(void) -{ - mps_space_t space; - - space = &space; - mps_space_destroy(space); - comment("Destroy space."); -} - -int main(void) -{ - easy_tramp(test); - return 0; -} diff --git a/mps/qa/conerr/30.c b/mps/qa/conerr/30.c deleted file mode 100644 index 29b609f8318..00000000000 --- a/mps/qa/conerr/30.c +++ /dev/null @@ -1,74 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = create an AP in a destroyed pool - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpsclo.h" - -static void zilch(void) -{ -} - - -static mps_addr_t myskip(mps_addr_t object) -{ - return *(mps_addr_t *)object; -} - - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - - mps_fmt_t format; - mps_fmt_A_s fmtA; - mps_ap_t ap; - - cdie(mps_space_create(&space), "create space"); - - fmtA.align = (mps_align_t) 1; - fmtA.scan = &zilch; - fmtA.skip = &myskip; - fmtA.copy = &zilch; - fmtA.fwd = &zilch; - fmtA.isfwd = &zilch; - fmtA.pad = &zilch; - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - cdie( - mps_pool_create(&pool, space, mps_class_lo(), format), - "create pool"); - -/* - cdie( - mps_ap_create(&ap, pool, MPS_RANK_EXACT), - "create ap"); -*/ - - mps_ap_destroy(ap); - comment("Destroyed ap."); - - mps_pool_destroy(pool); - comment("Destroyed pool."); - - mps_fmt_destroy(format); - comment("Destroyed format."); - - mps_space_destroy(space); - comment("Destroyed space."); -} - -int main(void) -{ - easy_tramp(test); - return 0; -} diff --git a/mps/qa/conerr/31.c b/mps/qa/conerr/31.c deleted file mode 100644 index 19db46b2289..00000000000 --- a/mps/qa/conerr/31.c +++ /dev/null @@ -1,75 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = destroy an AP twice - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpsclo.h" - -static void zilch(void) -{ -} - - -static mps_addr_t myskip(mps_addr_t object) -{ - return *(mps_addr_t *)object; -} - - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - - mps_fmt_t format; - mps_fmt_A_s fmtA; - mps_ap_t ap; - - cdie(mps_space_create(&space), "create space"); - - fmtA.align = (mps_align_t) 1; - fmtA.scan = &zilch; - fmtA.skip = &myskip; - fmtA.copy = &zilch; - fmtA.fwd = &zilch; - fmtA.isfwd = &zilch; - fmtA.pad = &zilch; - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - cdie( - mps_pool_create(&pool, space, mps_class_lo(), format), - "create pool"); - - cdie( - mps_ap_create(&ap, pool, MPS_RANK_EXACT), - "create ap"); - - mps_ap_destroy(ap); - comment("Destroyed ap."); - - mps_ap_destroy(ap); - comment("Destroyed ap again."); - - mps_pool_destroy(pool); - comment("Destroyed pool."); - - mps_fmt_destroy(format); - comment("Destroyed format."); - - mps_space_destroy(space); - comment("Destroyed space."); -} - -int main(void) -{ - easy_tramp(test); - return 0; -} diff --git a/mps/qa/conerr/32.c b/mps/qa/conerr/32.c deleted file mode 100644 index 055f613aa8f..00000000000 --- a/mps/qa/conerr/32.c +++ /dev/null @@ -1,49 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = create AP in a pool that doesn't support it - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmv.h" - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - size_t extendBy; - size_t avgSize; - size_t maxSize; - mps_ap_t ap; - - mps_addr_t obj; - - extendBy = (size_t) 4096; - avgSize = (size_t) 32; - maxSize = (size_t) 65536; - - cdie(mps_space_create(&space), "create space"); - - cdie( - mps_pool_create(&pool, space, mps_class_mv(), - extendBy, avgSize, maxSize), - "create pool"); - - cdie(mps_ap_create(&ap, pool, MPS_RANK_EXACT), - "create ap"); - - mps_pool_destroy(pool); - comment("Destroyed pool"); - - mps_space_destroy(space); - comment("Destroyed space."); -} - -int main(void) -{ - easy_tramp(test); - return 0; -} diff --git a/mps/qa/conerr/33.c b/mps/qa/conerr/33.c deleted file mode 100644 index 9f5a3ca9bf5..00000000000 --- a/mps/qa/conerr/33.c +++ /dev/null @@ -1,72 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = create an AP with a rank not supported by its pool - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" - -static void zilch(void) -{ -} - - -static mps_addr_t myskip(mps_addr_t object) -{ - return *(mps_addr_t *)object; -} - - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - - mps_fmt_t format; - mps_fmt_A_s fmtA; - mps_ap_t ap; - - cdie(mps_space_create(&space), "create space"); - - fmtA.align = (mps_align_t) 4; - fmtA.scan = &zilch; - fmtA.skip = &myskip; - fmtA.copy = &zilch; - fmtA.fwd = &zilch; - fmtA.isfwd = &zilch; - fmtA.pad = &zilch; - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - cdie( - mps_pool_create(&pool, space, mps_class_amc(), format), - "create pool"); - - cdie( - mps_ap_create(&ap, pool, MPS_RANK_AMBIG), - "create ap"); - - mps_ap_destroy(ap); - comment("Destroyed ap."); - - mps_pool_destroy(pool); - comment("Destroyed pool."); - - mps_fmt_destroy(format); - comment("Destroyed format."); - - mps_space_destroy(space); - comment("Destroyed space."); -} - -int main(void) -{ - easy_tramp(test); - return 0; -} diff --git a/mps/qa/conerr/33a.c b/mps/qa/conerr/33a.c deleted file mode 100644 index 8d7ad42b439..00000000000 --- a/mps/qa/conerr/33a.c +++ /dev/null @@ -1,80 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = create an AP with a rank not supported by its pool - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" - -static void zilch(void) -{ -} - - -static mps_addr_t myskip(mps_addr_t object) -{ - return *(mps_addr_t *)object; -} - - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - - mps_fmt_t format; - mps_fmt_A_s fmtA; - mps_ap_t ap; - mps_addr_t p; - - cdie(mps_space_create(&space), "create space"); - - fmtA.align = (mps_align_t) 4; - fmtA.scan = &zilch; - fmtA.skip = &myskip; - fmtA.copy = &zilch; - fmtA.fwd = &zilch; - fmtA.isfwd = &zilch; - fmtA.pad = &zilch; - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - cdie( - mps_pool_create(&pool, space, mps_class_amc(), format), - "create pool"); - - cdie( - mps_ap_create(&ap, pool, MPS_RANK_AMBIG), - "create ap"); - -do - { - cdie(mps_reserve(&p, ap, 0x100), "Reserve: "); - } - while (!mps_commit(ap, p, 0x100)); - comment("Committed."); - - mps_ap_destroy(ap); - comment("Destroyed ap."); - - mps_pool_destroy(pool); - comment("Destroyed pool."); - - mps_fmt_destroy(format); - comment("Destroyed format."); - - mps_space_destroy(space); - comment("Destroyed space."); -} - -int main(void) -{ - easy_tramp(test); - return 0; -} diff --git a/mps/qa/conerr/34.c b/mps/qa/conerr/34.c deleted file mode 100644 index 6614721b81e..00000000000 --- a/mps/qa/conerr/34.c +++ /dev/null @@ -1,78 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = allocate in uncreated AP - language = c - link = myfmt.o testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "myfmt.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_ap_t ap; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - cdie( - mps_pool_create(&pool, space, mps_class_amc(), format), - "create pool"); - -/* - cdie( - mps_ap_create(&ap, pool, MPS_RANK_EXACT), - "create ap"); -*/ - - allocone(ap, 0, NULL, NULL, 0x100); - - mps_ap_destroy(ap); - comment("Destroyed ap."); - - mps_pool_destroy(pool); - comment("Destroyed pool."); - - mps_fmt_destroy(format); - comment("Destroyed format."); - - mps_root_destroy(root); - comment("Destroyed root."); - - mps_thread_dereg(thread); - comment("Deregistered thread."); - - mps_space_destroy(space); - comment("Destroyed space."); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} - diff --git a/mps/qa/conerr/35.c b/mps/qa/conerr/35.c deleted file mode 100644 index a9240fa25fd..00000000000 --- a/mps/qa/conerr/35.c +++ /dev/null @@ -1,76 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = allocate in destroyed AP - language = c - link = myfmt.o testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "myfmt.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_ap_t ap; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - cdie( - mps_pool_create(&pool, space, mps_class_amc(), format), - "create pool"); - - cdie( - mps_ap_create(&ap, pool, MPS_RANK_EXACT), - "create ap"); - - mps_ap_destroy(ap); - comment("Destroyed ap."); - - allocone(ap, 0, NULL, NULL, 0x100); - - mps_pool_destroy(pool); - comment("Destroyed pool."); - - mps_fmt_destroy(format); - comment("Destroyed format."); - - mps_root_destroy(root); - comment("Destroyed root."); - - mps_thread_dereg(thread); - comment("Deregistered thread."); - - mps_space_destroy(space); - comment("Destroyed space."); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} - diff --git a/mps/qa/conerr/36.c b/mps/qa/conerr/36.c deleted file mode 100644 index ec08901e8c1..00000000000 --- a/mps/qa/conerr/36.c +++ /dev/null @@ -1,80 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = destroy AP between reserve and commit - language = c - link = myfmt.o testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "myfmt.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_ap_t ap; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - cdie( - mps_pool_create(&pool, space, mps_class_amc(), format), - "create pool"); - - cdie( - mps_ap_create(&ap, pool, MPS_RANK_EXACT), - "create ap"); - -{ - mps_addr_t p; - - cdie(mps_reserve(&p, ap, 0x100), "Reserve: "); -} - - mps_ap_destroy(ap); - comment("Destroyed ap."); - - mps_pool_destroy(pool); - comment("Destroyed pool."); - - mps_fmt_destroy(format); - comment("Destroyed format."); - - mps_root_destroy(root); - comment("Destroyed root."); - - mps_thread_dereg(thread); - comment("Deregistered thread."); - - mps_space_destroy(space); - comment("Destroyed space."); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} - diff --git a/mps/qa/conerr/37.c b/mps/qa/conerr/37.c deleted file mode 100644 index fe4d3bb9939..00000000000 --- a/mps/qa/conerr/37.c +++ /dev/null @@ -1,84 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = reserve and commit with different address - language = c - link = myfmt.o testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "myfmt.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_ap_t ap; - mps_addr_t p; - mps_addr_t q; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - cdie( - mps_pool_create(&pool, space, mps_class_amc(), format), - "create pool"); - - cdie( - mps_ap_create(&ap, pool, MPS_RANK_EXACT), - "create ap"); - - do - { - cdie(mps_reserve(&p, ap, 0x100), "Reserve: "); - q = (mps_addr_t) ((char *)p + 0x10); - } - while (!mps_commit(ap, q, 0x100)); - comment("Committed."); - - mps_ap_destroy(ap); - comment("Destroyed ap."); - - mps_pool_destroy(pool); - comment("Destroyed pool."); - - mps_fmt_destroy(format); - comment("Destroyed format."); - - mps_root_destroy(root); - comment("Destroyed root."); - - mps_thread_dereg(thread); - comment("Deregistered thread."); - - mps_space_destroy(space); - comment("Destroyed space."); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} - diff --git a/mps/qa/conerr/37f.c b/mps/qa/conerr/37f.c deleted file mode 100644 index ad61ec1c0e4..00000000000 --- a/mps/qa/conerr/37f.c +++ /dev/null @@ -1,87 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = reserve and commit with different address - language = c - link = myfmt.o testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "myfmt.h" - -#undef mps_reserve -#undef mps_commit - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_ap_t ap; - mps_addr_t p; - mps_addr_t q; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - cdie( - mps_pool_create(&pool, space, mps_class_amc(), format), - "create pool"); - - cdie( - mps_ap_create(&ap, pool, MPS_RANK_EXACT), - "create ap"); - - do - { - cdie(mps_reserve(&p, ap, 0x100), "Reserve: "); - q = (mps_addr_t) ((char *)p + 0x10); - } - while (!mps_commit(ap, q, 0x100)); - comment("Committed."); - - mps_ap_destroy(ap); - comment("Destroyed ap."); - - mps_pool_destroy(pool); - comment("Destroyed pool."); - - mps_fmt_destroy(format); - comment("Destroyed format."); - - mps_root_destroy(root); - comment("Destroyed root."); - - mps_thread_dereg(thread); - comment("Deregistered thread."); - - mps_space_destroy(space); - comment("Destroyed space."); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} - diff --git a/mps/qa/conerr/38.c b/mps/qa/conerr/38.c deleted file mode 100644 index a1241bd2740..00000000000 --- a/mps/qa/conerr/38.c +++ /dev/null @@ -1,84 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = reserve and commit with different sizes - language = c - link = myfmt.o testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "myfmt.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_ap_t ap; - mps_addr_t p; - mps_addr_t q; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - cdie( - mps_pool_create(&pool, space, mps_class_amc(), format), - "create pool"); - - cdie( - mps_ap_create(&ap, pool, MPS_RANK_EXACT), - "create ap"); - - do - { - cdie(mps_reserve(&p, ap, 0x100), "Reserve: "); - q = (mps_addr_t) ((char *)p); - } - while (!mps_commit(ap, q, 0x110)); - comment("Committed."); - - mps_ap_destroy(ap); - comment("Destroyed ap."); - - mps_pool_destroy(pool); - comment("Destroyed pool."); - - mps_fmt_destroy(format); - comment("Destroyed format."); - - mps_root_destroy(root); - comment("Destroyed root."); - - mps_thread_dereg(thread); - comment("Deregistered thread."); - - mps_space_destroy(space); - comment("Destroyed space."); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} - diff --git a/mps/qa/conerr/38f.c b/mps/qa/conerr/38f.c deleted file mode 100644 index 1a5b0354b55..00000000000 --- a/mps/qa/conerr/38f.c +++ /dev/null @@ -1,87 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = reserve and commit with different sizes - language = c - link = myfmt.o testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "myfmt.h" - -#undef mps_reserve -#undef mps_commit - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_ap_t ap; - mps_addr_t p; - mps_addr_t q; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - cdie( - mps_pool_create(&pool, space, mps_class_amc(), format), - "create pool"); - - cdie( - mps_ap_create(&ap, pool, MPS_RANK_EXACT), - "create ap"); - - do - { - cdie(mps_reserve(&p, ap, 0x100), "Reserve: "); - q = (mps_addr_t) ((char *)p); - } - while (!mps_commit(ap, q, 0x110)); - comment("Committed."); - - mps_ap_destroy(ap); - comment("Destroyed ap."); - - mps_pool_destroy(pool); - comment("Destroyed pool."); - - mps_fmt_destroy(format); - comment("Destroyed format."); - - mps_root_destroy(root); - comment("Destroyed root."); - - mps_thread_dereg(thread); - comment("Deregistered thread."); - - mps_space_destroy(space); - comment("Destroyed space."); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} - diff --git a/mps/qa/conerr/39.c b/mps/qa/conerr/39.c deleted file mode 100644 index 9b65d451657..00000000000 --- a/mps/qa/conerr/39.c +++ /dev/null @@ -1,85 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = commit without reserving - language = c - link = myfmt.o testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "myfmt.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_ap_t ap; - mps_addr_t p; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - cdie( - mps_pool_create(&pool, space, mps_class_amc(), format), - "create pool"); - - cdie( - mps_ap_create(&ap, pool, MPS_RANK_EXACT), - "create ap"); - - allocone(ap, 0, NULL, NULL, 0x20); - - do - { -/* cdie(mps_reserve(&p, ap, 0x100), "Reserve: "); -*/ - } - while (!mps_commit(ap, p, 0x20)); - comment("Committed."); - - mps_ap_destroy(ap); - comment("Destroyed ap."); - - mps_pool_destroy(pool); - comment("Destroyed pool."); - - mps_fmt_destroy(format); - comment("Destroyed format."); - - mps_root_destroy(root); - comment("Destroyed root."); - - mps_thread_dereg(thread); - comment("Deregistered thread."); - - mps_space_destroy(space); - comment("Destroyed space."); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} - diff --git a/mps/qa/conerr/39f.c b/mps/qa/conerr/39f.c deleted file mode 100644 index 309b808ec82..00000000000 --- a/mps/qa/conerr/39f.c +++ /dev/null @@ -1,88 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = commit without reserving - language = c - link = myfmt.o testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "myfmt.h" - -#undef mps_reserve -#undef mps_commit - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_ap_t ap; - mps_addr_t p; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - cdie( - mps_pool_create(&pool, space, mps_class_amc(), format), - "create pool"); - - cdie( - mps_ap_create(&ap, pool, MPS_RANK_EXACT), - "create ap"); - - allocone(ap, 0, NULL, NULL, 0x20); - - do - { -/* cdie(mps_reserve(&p, ap, 0x100), "Reserve: "); -*/ - } - while (!mps_commit(ap, p, 0x20)); - comment("Committed."); - - mps_ap_destroy(ap); - comment("Destroyed ap."); - - mps_pool_destroy(pool); - comment("Destroyed pool."); - - mps_fmt_destroy(format); - comment("Destroyed format."); - - mps_root_destroy(root); - comment("Destroyed root."); - - mps_thread_dereg(thread); - comment("Deregistered thread."); - - mps_space_destroy(space); - comment("Destroyed space."); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} - diff --git a/mps/qa/conerr/4.c b/mps/qa/conerr/4.c deleted file mode 100644 index 82b0d791408..00000000000 --- a/mps/qa/conerr/4.c +++ /dev/null @@ -1,39 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = destroy a space which contains a pool - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmv.h" - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - size_t extendBy; - size_t avgSize; - size_t maxSize; - - extendBy = (size_t) 4096; - avgSize = (size_t) 32; - maxSize = (size_t) 65536; - - cdie(mps_space_create(&space), "create space"); - - cdie( - mps_pool_create(&pool, space, mps_class_mv(), - extendBy, avgSize, maxSize), - "create pool"); - mps_space_destroy(space); - comment("Destroy space."); -} - -int main(void) -{ - easy_tramp(test); - return 0; -} diff --git a/mps/qa/conerr/40.c b/mps/qa/conerr/40.c deleted file mode 100644 index 4af4ea3d5e6..00000000000 --- a/mps/qa/conerr/40.c +++ /dev/null @@ -1,83 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = reserve twice without committing - language = c - link = myfmt.o testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "myfmt.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_ap_t ap; - mps_addr_t p; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - cdie( - mps_pool_create(&pool, space, mps_class_amc(), format), - "create pool"); - - cdie( - mps_ap_create(&ap, pool, MPS_RANK_EXACT), - "create ap"); - - do - { - cdie(mps_reserve(&p, ap, 0x100), "Reserve: "); - cdie(mps_reserve(&p, ap, 0x100), "Reserve again: "); - } - while (!mps_commit(ap, p, 0x110)); - comment("Committed."); - - mps_ap_destroy(ap); - comment("Destroyed ap."); - - mps_pool_destroy(pool); - comment("Destroyed pool."); - - mps_fmt_destroy(format); - comment("Destroyed format."); - - mps_root_destroy(root); - comment("Destroyed root."); - - mps_thread_dereg(thread); - comment("Deregistered thread."); - - mps_space_destroy(space); - comment("Destroyed space."); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} - diff --git a/mps/qa/conerr/40f.c b/mps/qa/conerr/40f.c deleted file mode 100644 index b1044d80cf7..00000000000 --- a/mps/qa/conerr/40f.c +++ /dev/null @@ -1,86 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = reserve twice without committing - language = c - link = myfmt.o testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "myfmt.h" - -#undef mps_reserve -#undef mps_commit - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_ap_t ap; - mps_addr_t p; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - cdie( - mps_pool_create(&pool, space, mps_class_amc(), format), - "create pool"); - - cdie( - mps_ap_create(&ap, pool, MPS_RANK_EXACT), - "create ap"); - - do - { - cdie(mps_reserve(&p, ap, 0x100), "Reserve: "); - cdie(mps_reserve(&p, ap, 0x100), "Reserve again: "); - } - while (!mps_commit(ap, p, 0x110)); - comment("Committed."); - - mps_ap_destroy(ap); - comment("Destroyed ap."); - - mps_pool_destroy(pool); - comment("Destroyed pool."); - - mps_fmt_destroy(format); - comment("Destroyed format."); - - mps_root_destroy(root); - comment("Destroyed root."); - - mps_thread_dereg(thread); - comment("Deregistered thread."); - - mps_space_destroy(space); - comment("Destroyed space."); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} - diff --git a/mps/qa/conerr/41.c b/mps/qa/conerr/41.c deleted file mode 100644 index cb0b356b0f3..00000000000 --- a/mps/qa/conerr/41.c +++ /dev/null @@ -1,45 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = create root in uncreated space - language = c - link = myfmt.o testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "myfmt.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_root_t root; - mps_addr_t roottable[10]; - -/* - cdie(mps_space_create(&space), "create space"); -*/ - - cdie( - mps_root_create_table(&root, space, MPS_RANK_AMBIG, 0, - roottable, sizeof(mps_addr_t[10])), "create root"); - - mps_root_destroy(root); - comment("Destroyed root."); - - mps_space_destroy(space); - comment("Destroyed space."); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} - diff --git a/mps/qa/conerr/42.c b/mps/qa/conerr/42.c deleted file mode 100644 index 4dcef268a5d..00000000000 --- a/mps/qa/conerr/42.c +++ /dev/null @@ -1,44 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = create root in destroyed space - language = c - link = myfmt.o testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "myfmt.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_root_t root; - mps_addr_t roottable[10]; - - cdie(mps_space_create(&space), "create space"); - - mps_space_destroy(space); - comment("Destroyed space."); - - cdie( - mps_root_create_table(&root, space, MPS_RANK_AMBIG, 0, - roottable, sizeof(mps_addr_t[10])), "create root"); - - mps_root_destroy(root); - comment("Destroyed root."); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} - diff --git a/mps/qa/conerr/43.c b/mps/qa/conerr/43.c deleted file mode 100644 index fb3e8f4e436..00000000000 --- a/mps/qa/conerr/43.c +++ /dev/null @@ -1,45 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = destroy root though uncreated - language = c - link = myfmt.o testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "myfmt.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_root_t root; - mps_addr_t roottable[10]; - - cdie(mps_space_create(&space), "create space"); - -/* - cdie( - mps_root_create_table(&root, space, MPS_RANK_AMBIG, 0, - roottable, sizeof(mps_addr_t[10])), "create root"); -*/ - - mps_root_destroy(root); - comment("Destroyed root."); - - mps_space_destroy(space); - comment("Destroyed space."); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} - diff --git a/mps/qa/conerr/44.c b/mps/qa/conerr/44.c deleted file mode 100644 index ab8e741e555..00000000000 --- a/mps/qa/conerr/44.c +++ /dev/null @@ -1,46 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = destroy root twice - language = c - link = myfmt.o testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "myfmt.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_root_t root; - mps_addr_t roottable[10]; - - cdie(mps_space_create(&space), "create space"); - - cdie( - mps_root_create_table(&root, space, MPS_RANK_AMBIG, 0, - roottable, sizeof(mps_addr_t[10])), "create root"); - - mps_root_destroy(root); - comment("Destroyed root."); - - mps_root_destroy(root); - comment("Destroyed root again."); - - mps_space_destroy(space); - comment("Destroyed space."); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} - diff --git a/mps/qa/conerr/44a.c b/mps/qa/conerr/44a.c deleted file mode 100644 index 34edab6599a..00000000000 --- a/mps/qa/conerr/44a.c +++ /dev/null @@ -1,53 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = create register root without registering thread - language = c - link = myfmt.o testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "myfmt.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - mps_root_t root; - - cdie(mps_space_create(&space), "create space"); - -/* - cdie(mps_thread_reg(&thread, space), "register thread"); -*/ - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - mps_root_destroy(root); - comment("Destroyed root."); - -/* - mps_thread_dereg(thread); - comment("Deregistered thread."); -*/ - - mps_space_destroy(space); - comment("Destroyed space."); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} - diff --git a/mps/qa/conerr/45.c b/mps/qa/conerr/45.c deleted file mode 100644 index 86863e098f3..00000000000 --- a/mps/qa/conerr/45.c +++ /dev/null @@ -1,42 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = register thread in uncreated space - language = c - link = myfmt.o testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "myfmt.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - -/* - cdie(mps_space_create(&space), "create space"); -*/ - - cdie(mps_thread_reg(&thread, space), "register thread"); - - mps_thread_dereg(thread); - comment("Deregistered thread."); - - mps_space_destroy(space); - comment("Destroyed space."); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} - diff --git a/mps/qa/conerr/46.c b/mps/qa/conerr/46.c deleted file mode 100644 index 8962ec590a2..00000000000 --- a/mps/qa/conerr/46.c +++ /dev/null @@ -1,43 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = register thread in destroyed space - language = c - link = myfmt.o testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "myfmt.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - - cdie(mps_space_create(&space), "create space"); - - mps_space_destroy(space); - comment("Destroyed space."); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - mps_thread_dereg(thread); - comment("Deregistered thread."); - - mps_space_destroy(space); - comment("Destroyed space."); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} - diff --git a/mps/qa/conerr/47.c b/mps/qa/conerr/47.c deleted file mode 100644 index 9e972d846c9..00000000000 --- a/mps/qa/conerr/47.c +++ /dev/null @@ -1,42 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = deregister thread without registering it first - language = c - link = myfmt.o testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "myfmt.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - - cdie(mps_space_create(&space), "create space"); - -/* - cdie(mps_thread_reg(&thread, space), "register thread"); -*/ - - mps_thread_dereg(thread); - comment("Deregistered thread."); - - mps_space_destroy(space); - comment("Destroyed space."); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} - diff --git a/mps/qa/conerr/48.c b/mps/qa/conerr/48.c deleted file mode 100644 index 0b07d61029e..00000000000 --- a/mps/qa/conerr/48.c +++ /dev/null @@ -1,43 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = deregister thread twice - language = c - link = myfmt.o testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "myfmt.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - mps_thread_dereg(thread); - comment("Deregistered thread."); - - mps_thread_dereg(thread); - comment("Deregistered thread again."); - - mps_space_destroy(space); - comment("Destroyed space."); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} - diff --git a/mps/qa/conerr/49.c b/mps/qa/conerr/49.c deleted file mode 100644 index a26f1541894..00000000000 --- a/mps/qa/conerr/49.c +++ /dev/null @@ -1,46 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = register thread twice - language = c - link = myfmt.o testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "myfmt.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - mps_thr_t thread2; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie(mps_thread_reg(&thread2, space), "register thread 2"); - - mps_thread_dereg(thread); - comment("Deregistered thread."); - - mps_thread_dereg(thread2); - comment("Deregistered thread 2."); - - mps_space_destroy(space); - comment("Destroyed space."); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} - diff --git a/mps/qa/conerr/5.c b/mps/qa/conerr/5.c deleted file mode 100644 index ea8569cf790..00000000000 --- a/mps/qa/conerr/5.c +++ /dev/null @@ -1,51 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = destroy a space which contains a format - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmv.h" - -static void zilch(void) -{ -} - - -static mps_addr_t myskip(mps_addr_t object) -{ - return object; -} - -static void test(void) -{ - mps_space_t space; - mps_fmt_t format; - mps_fmt_A_s fmtA; - - cdie(mps_space_create(&space), "create space"); - - fmtA.align = (mps_align_t) 1; - fmtA.scan = &zilch; - fmtA.skip = &myskip; - fmtA.copy = &zilch; - fmtA.fwd = &zilch; - fmtA.isfwd = &zilch; - fmtA.pad = &zilch; - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - mps_space_destroy(space); - comment("Destroy space."); -} - -int main(void) -{ - easy_tramp(test); - return 0; -} diff --git a/mps/qa/conerr/50.c b/mps/qa/conerr/50.c deleted file mode 100644 index c1c79a20b10..00000000000 --- a/mps/qa/conerr/50.c +++ /dev/null @@ -1,35 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = reset ld in uncreated space - language = c - link = myfmt.o testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "myfmt.h" - -static void test(void) -{ - mps_space_t space; - mps_ld_s ld; - -/* - cdie(mps_space_create(&space), "create space"); -*/ - - mps_ld_reset(&ld, space); - comment("Reset ld."); - - mps_space_destroy(space); - comment("Destroyed space."); -} - -int main(void) -{ - easy_tramp(test); - return 0; -} - diff --git a/mps/qa/conerr/51.c b/mps/qa/conerr/51.c deleted file mode 100644 index e489ff8dfda..00000000000 --- a/mps/qa/conerr/51.c +++ /dev/null @@ -1,33 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = reset ld in destroyed space - language = c - link = myfmt.o testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "myfmt.h" - -static void test(void) -{ - mps_space_t space; - mps_ld_s ld; - - cdie(mps_space_create(&space), "create space"); - - mps_space_destroy(space); - comment("Destroyed space."); - - mps_ld_reset(&ld, space); - comment("Reset ld."); -} - -int main(void) -{ - easy_tramp(test); - return 0; -} - diff --git a/mps/qa/conerr/52.c b/mps/qa/conerr/52.c deleted file mode 100644 index 58297e0ce5d..00000000000 --- a/mps/qa/conerr/52.c +++ /dev/null @@ -1,37 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = reset ld again, in destroyed space - language = c - link = myfmt.o testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "myfmt.h" - -static void test(void) -{ - mps_space_t space; - mps_ld_s ld; - - cdie(mps_space_create(&space), "create space"); - - mps_ld_reset(&ld, space); - comment("Reset ld."); - - mps_space_destroy(space); - comment("Destroyed space."); - - mps_ld_reset(&ld, space); - comment("Reset ld again."); - -} - -int main(void) -{ - easy_tramp(test); - return 0; -} - diff --git a/mps/qa/conerr/53.c b/mps/qa/conerr/53.c deleted file mode 100644 index 347a495ebd9..00000000000 --- a/mps/qa/conerr/53.c +++ /dev/null @@ -1,39 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = add to ld without resetting - language = c - link = myfmt.o testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "myfmt.h" - -static void test(void) -{ - mps_space_t space; - mps_ld_s ld; - - cdie(mps_space_create(&space), "create space"); - -/* - mps_ld_reset(&ld, space); - comment("Reset ld."); -*/ - - mps_ld_add(&ld, space, &space); - comment("Added to ld."); - - mps_space_destroy(space); - comment("Destroyed space."); - -} - -int main(void) -{ - easy_tramp(test); - return 0; -} - diff --git a/mps/qa/conerr/54.c b/mps/qa/conerr/54.c deleted file mode 100644 index 9bdb992c2a8..00000000000 --- a/mps/qa/conerr/54.c +++ /dev/null @@ -1,43 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = is_stale without resetting - language = c - link = myfmt.o testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "myfmt.h" - -static void test(void) -{ - mps_space_t space; - mps_ld_s ld; - - cdie(mps_space_create(&space), "create space"); - -/* - mps_ld_reset(&ld, space); - comment("Reset ld."); -*/ - -/* - mps_ld_add(&ld, space, &space); - comment("Added to ld."); -*/ - - report("isstale", "%d", mps_ld_isstale(&ld, space, &space)); - - mps_space_destroy(space); - comment("Destroyed space."); - -} - -int main(void) -{ - easy_tramp(test); - return 0; -} - diff --git a/mps/qa/conerr/55.c b/mps/qa/conerr/55.c deleted file mode 100644 index b351c905aea..00000000000 --- a/mps/qa/conerr/55.c +++ /dev/null @@ -1,42 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = add to ld in destroyed space - language = c - link = myfmt.o testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "myfmt.h" - -static void test(void) -{ - mps_space_t space; - mps_ld_s ld; - - cdie(mps_space_create(&space), "create space"); - - mps_ld_reset(&ld, space); - comment("Reset ld."); - - mps_ld_add(&ld, space, &space); - comment("Added to ld."); - - report("isstale", "%d", mps_ld_isstale(&ld, space, &space)); - - mps_space_destroy(space); - comment("Destroyed space."); - - mps_ld_add(&ld, space, &space); - comment("Added to ld."); - -} - -int main(void) -{ - easy_tramp(test); - return 0; -} - diff --git a/mps/qa/conerr/56.c b/mps/qa/conerr/56.c deleted file mode 100644 index 23d65b21546..00000000000 --- a/mps/qa/conerr/56.c +++ /dev/null @@ -1,40 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = isstale in destroyed space - language = c - link = myfmt.o testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "myfmt.h" - -static void test(void) -{ - mps_space_t space; - mps_ld_s ld; - - cdie(mps_space_create(&space), "create space"); - - mps_ld_reset(&ld, space); - comment("Reset ld."); - - mps_ld_add(&ld, space, &space); - comment("Added to ld."); - - report("isstale", "%d", mps_ld_isstale(&ld, space, &space)); - - mps_space_destroy(space); - comment("Destroyed space."); - - report("isstale2", "%d", mps_ld_isstale(&ld, space, &space)); -} - -int main(void) -{ - easy_tramp(test); - return 0; -} - diff --git a/mps/qa/conerr/57.c b/mps/qa/conerr/57.c deleted file mode 100644 index 374fea66fac..00000000000 --- a/mps/qa/conerr/57.c +++ /dev/null @@ -1,38 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = add to ld in wrong space - language = c - link = myfmt.o testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "myfmt.h" - -static void test(void) -{ - mps_space_t space; - mps_space_t space1; - mps_ld_s ld; - - cdie(mps_space_create(&space), "create space"); - cdie(mps_space_create(&space1), "create space 1"); - - mps_ld_reset(&ld, space); - comment("Reset ld."); - - mps_ld_add(&ld, space1, &space); - comment("Added to ld."); - - mps_space_destroy(space); - comment("Destroyed space."); -} - -int main(void) -{ - easy_tramp(test); - return 0; -} - diff --git a/mps/qa/conerr/58.c b/mps/qa/conerr/58.c deleted file mode 100644 index b9ff36dad5a..00000000000 --- a/mps/qa/conerr/58.c +++ /dev/null @@ -1,37 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = isstale on ld in wrong space - language = c - link = myfmt.o testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "myfmt.h" - -static void test(void) -{ - mps_space_t space; - mps_space_t space1; - mps_ld_s ld; - - cdie(mps_space_create(&space), "create space"); - cdie(mps_space_create(&space1), "create space 1"); - - mps_ld_reset(&ld, space); - comment("Reset ld."); - - report("isstale", "%d", mps_ld_isstale(&ld, space1, &space)); - - mps_space_destroy(space); - comment("Destroyed space."); -} - -int main(void) -{ - easy_tramp(test); - return 0; -} - diff --git a/mps/qa/conerr/59.c b/mps/qa/conerr/59.c deleted file mode 100644 index 9144b6ff314..00000000000 --- a/mps/qa/conerr/59.c +++ /dev/null @@ -1,51 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = free though not allocated - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmv.h" - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - size_t extendBy; - size_t avgSize; - size_t maxSize; - - mps_addr_t obj; - - extendBy = (size_t) 4096; - avgSize = (size_t) 32; - maxSize = (size_t) 65536; - - cdie(mps_space_create(&space), "create space"); - - cdie( - mps_pool_create(&pool, space, mps_class_mv(), - extendBy, avgSize, maxSize), - "create pool"); - cdie(mps_alloc(&obj, pool, 152), "allocate"); - cdie(mps_alloc(&obj, pool, 4), "alloc2"); - - - mps_free(pool, obj, 512); - comment("Freed."); - - mps_pool_destroy(pool); - comment("Destroyed pool"); - - mps_space_destroy(space); - comment("Destroyed space."); -} - -int main(void) -{ - easy_tramp(test); - return 0; -} diff --git a/mps/qa/conerr/6.c b/mps/qa/conerr/6.c deleted file mode 100644 index 336a47b3d3f..00000000000 --- a/mps/qa/conerr/6.c +++ /dev/null @@ -1,41 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = destroy a space which contains a root - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmv.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - mps_root_t root; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - mps_space_destroy(space); - comment("Destroy space."); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/conerr/7.c b/mps/qa/conerr/7.c deleted file mode 100644 index 16669682af3..00000000000 --- a/mps/qa/conerr/7.c +++ /dev/null @@ -1,35 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = destroy a space which contains a thread - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmv.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_thr_t thread; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - mps_space_destroy(space); - comment("Destroy space."); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/conerr/8.c b/mps/qa/conerr/8.c deleted file mode 100644 index 28a18b76dce..00000000000 --- a/mps/qa/conerr/8.c +++ /dev/null @@ -1,53 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = create a format in an uncreated space - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmv.h" - -static void zilch(void) -{ -} - - -static mps_addr_t myskip(mps_addr_t object) -{ - return object; -} - -static void test(void) -{ - mps_space_t space; - mps_fmt_t format; - mps_fmt_A_s fmtA; - - space=malloc(64); - - /* cdie(mps_space_create(&space), "create space"); - */ - fmtA.align = (mps_align_t) 1; - fmtA.scan = &zilch; - fmtA.skip = &myskip; - fmtA.copy = &zilch; - fmtA.fwd = &zilch; - fmtA.isfwd = &zilch; - fmtA.pad = &zilch; - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - mps_space_destroy(space); - comment("Destroy space."); -} - -int main(void) -{ - easy_tramp(test); - return 0; -} diff --git a/mps/qa/conerr/9.c b/mps/qa/conerr/9.c deleted file mode 100644 index 67d9bc1c802..00000000000 --- a/mps/qa/conerr/9.c +++ /dev/null @@ -1,53 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = create a format in a destroyed space - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmv.h" - -static void zilch(void) -{ -} - - -static mps_addr_t myskip(mps_addr_t object) -{ - return object; -} - -static void test(void) -{ - mps_space_t space; - mps_fmt_t format; - mps_fmt_A_s fmtA; - - - cdie(mps_space_create(&space), "create space"); - - fmtA.align = (mps_align_t) 1; - fmtA.scan = &zilch; - fmtA.skip = &myskip; - fmtA.copy = &zilch; - fmtA.fwd = &zilch; - fmtA.isfwd = &zilch; - fmtA.pad = &zilch; - - mps_space_destroy(space); - comment("Destroy space."); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - -} - -int main(void) -{ - easy_tramp(test); - return 0; -} diff --git a/mps/qa/data/af_six.txt b/mps/qa/data/af_six.txt deleted file mode 100644 index 48094e2d841..00000000000 --- a/mps/qa/data/af_six.txt +++ /dev/null @@ -1,17 +0,0 @@ -af_six - -allocate and free log for temp pool in ScriptWorks. - -trunk of 1998-09-10, -30MB for rip, separations, 1024dpi, testhqn, extra grays. - -Jobs ripped: - mnchenwk.ps - ausenpln.ps - hgp101.hpg - a1p101.hpg - musician.ps - radiocas.ps - -Log generated with anchovy.3, variety.ti, dumper.exe and alloclog.pl. - diff --git a/mps/qa/function/0.c b/mps/qa/function/0.c deleted file mode 100644 index d7a1eb22a5e..00000000000 --- a/mps/qa/function/0.c +++ /dev/null @@ -1,18 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = test that the mps header file is accepted by the compiler - language = c - link = testlib.o -END_HEADER -*/ - -#include "mps.h" -#include "testlib.h" - -int main(void) -{ - pass(); - return 0; -} - diff --git a/mps/qa/function/1.c b/mps/qa/function/1.c deleted file mode 100644 index e42f3172a07..00000000000 --- a/mps/qa/function/1.c +++ /dev/null @@ -1,25 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = create a space and then destroy it - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" - -static void test(void) -{ - mps_space_t space; - - cdie(mps_space_create(&space), "create space"); - mps_space_destroy(space); -} - -int main(void) -{ - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/10.c b/mps/qa/function/10.c deleted file mode 100644 index 1465135602f..00000000000 --- a/mps/qa/function/10.c +++ /dev/null @@ -1,118 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = Allocate but never look at objects - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" - -void *stackpointer; - -static mps_res_t myscan(mps_ss_t ss, mps_addr_t base, mps_addr_t limit) -{ - MPS_SCAN_BEGIN(ss) - MPS_SCAN_END(ss); - return MPS_RES_OK; -} - -static mps_addr_t myskip(mps_addr_t object) -{ - return (mps_addr_t) ((char *) object + 1); -} - -static void mycopy(mps_addr_t object, mps_addr_t to) -{ -} - -static void mypad(mps_addr_t base, size_t size) -{ -} - -static mps_addr_t myisfwd(mps_addr_t object) -{ - return NULL; -} - -static void myfwd(mps_addr_t object, mps_addr_t to) -{ -} - -struct mps_fmt_A_s fmtA = -{ - 1, - &myscan, - &myskip, - &mycopy, - &myfwd, - &myisfwd, - &mypad -}; - - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_ap_t ap; - - mps_addr_t p; - - int i; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - cdie( - mps_pool_create(&pool, space, mps_class_amc(), format), - "create pool"); - - cdie( - mps_ap_create(&ap, pool, MPS_RANK_EXACT), - "create ap"); - - for(i=0; i<1000; i++) - { - do - { die(mps_reserve(&p, ap, 1024*1024), "Reserve: "); - } - while (!mps_commit(ap, p, 1024*1024)); - comment("%i megabytes allocated", i); - } - - mps_ap_destroy(ap); - mps_pool_destroy(pool); - mps_fmt_destroy(format); - mps_root_destroy(root); - mps_thread_dereg(thread); - mps_space_destroy(space); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} - diff --git a/mps/qa/function/100.c b/mps/qa/function/100.c deleted file mode 100644 index c0111909bb4..00000000000 --- a/mps/qa/function/100.c +++ /dev/null @@ -1,139 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = MFS functional test allocate and free in manual fixed small pool - language = c - link = testlib.o -END_HEADER -*/ - -#include -#include "testlib.h" -#include "mpscmfs.h" - -#define MAXNUMBER 1000000 - -void *stackpointer; -mps_space_t space; - -static mps_addr_t queue[MAXNUMBER]; - -enum {SEQ=0, RAN=1, SEQGAP=2, RANGAP=3}; -static char *tdesc[] = {"sequential", "random", - "sequential gap", "random gap"}; - -static void dotest(int kind, size_t unitSize, size_t extendBy, - int number, int iter) -{ - mps_pool_t pool; - int i, hd; - clock_t time0, time1; - int secs; - - asserts(number <= MAXNUMBER, "number too big"); - asserts(unitSize >= sizeof(int), "unitSize too small"); - - time0 = clock(); - asserts(time0 != -1, "processor time not available"); - - die( - mps_pool_create(&pool, space, mps_class_mfs(), extendBy, unitSize), - "create pool"); - - for(hd=0; hd -#include "testlib.h" -#include "mpscmv.h" - -#define MAXNUMBER 1000000 - -void *stackpointer; -mps_space_t space; - -static struct {mps_addr_t addr; size_t size;} queue[MAXNUMBER]; - -enum {SEQ=0, RAN=1, SEQGAP=2, RANGAP=3, DUMMY=4}; -static char *tdesc[] = {"sequential", "random", - "sequential gap", "random gap", "dummy"}; - -static void setobj(mps_addr_t a, size_t size, unsigned char val) -{ - unsigned char *b; - b = a; - - while (size>0) - { - *b=val; - /* comment("%p = %i", b, (int) val); - */ - b++; - size--; - } -} - -static int chkobj(mps_addr_t a, size_t size, unsigned char val) -{ - unsigned char *b; - b = a; - - while (size>0) - { - /* comment("%p == %i", b, (int) val); - */ - if (*b != val) return 0; - b++; - size--; - } - return 1; -} - -static void dt(int kind, - size_t extendBy, size_t avgSize, size_t maxSize, - size_t mins, size_t maxs, int number, int iter) -{ - mps_pool_t pool; - int i, hd; - clock_t time0, time1; - size_t size; - int secs; - - asserts(number <= MAXNUMBER, "number too big"); - - time0 = clock(); - asserts(time0 != -1, "processor time not available"); - - die( - mps_pool_create(&pool, space, mps_class_mv(), - extendBy, avgSize, maxSize), - "create pool"); - - for(hd=0; hd -#include "testlib.h" -#include "mpscepdl.h" -#include "mpsavm.h" - -#define MAXNUMBER 1000000 - -void *stackpointer; -mps_space_t space; - -static struct {mps_addr_t addr; size_t size;} queue[MAXNUMBER]; - -enum {SEQ=0, RAN=1, SEQGAP=2, RANGAP=3, DUMMY=4}; -static char *tdesc[] = {"sequential", "random", - "sequential gap", "random gap", "dummy"}; - -static void setobj(mps_addr_t a, size_t size, unsigned char val) -{ - unsigned char *b; - b = a; - - while (size>0) - { - *b=val; - /* comment("%p = %i", b, (int) val); - */ - b++; - size--; - } -} - -static int chkobj(mps_addr_t a, size_t size, unsigned char val) -{ - unsigned char *b; - b = a; - - while (size>0) - { - /* comment("%p == %i", b, (int) val); - */ - if (*b != val) return 0; - b++; - size--; - } - return 1; -} - -static void dt(int kind, - size_t extendBy, size_t avgSize, size_t maxSize, - size_t mins, size_t maxs, int number, int iter) -{ - mps_pool_t pool; - int i, hd; - clock_t time0, time1; - size_t size; - int secs; - - asserts(number <= MAXNUMBER, "number too big"); - - time0 = clock(); - asserts(time0 != -1, "processor time not available"); - - die( - mps_pool_create(&pool, space, mps_class_epdl(), - extendBy, avgSize, 8), - "create pool"); - - for(hd=0; hdtag & 3) == MCdata, "odd check at %p (%p)", obj, obj->tag); - - if (obj->data.checkedflag == oldstamp) { - obj->data.checkedflag = newstamp; - if (obj->data.assoc != NULL) { - tracegraph(obj->data.assoc); - } - for (i=0; i<(obj->data.numrefs); i++) { - if (obj->data.ref[i].addr != NULL) { - tracegraph(obj->data.ref[i].addr); - } - } - } else { - asserts(obj->data.checkedflag == newstamp, - "I. trace on old object at %p", obj); - } -} - - -static void stepper(mps_addr_t addr, mps_fmt_t fmt, mps_pool_t pool, - void *V, size_t S) -{ - mycell *a; - - asserts((mycell *) V == MAGICPOINT, "VII. Void * didn't get passed!"); - asserts(S == MAGICSIZE, "VII. Size didn't get passed!"); - asserts(fmt == format, "VII. Format didn't get passed!"); - a = addr; - asserts(((a->tag) & 0x3) == MCdata || ((a->tag) & 0x3) == MCpad, - "V. step onto bad object at %p", addr); - if (((a->tag) & 0x3) == MCdata) { - appcount += 1; - asserts(a->data.checkedflag != newstamp, - "III/IV. step on object again at %p", a); - commentif(a->data.checkedflag != oldstamp, - "*. step on unreachable object at %p", a); - asserts(oldstamp - a->data.checkedflag < 3, - "IV. unreachable object %d stayed alive at %p", a->data.id, a); - a->data.checkedflag = newstamp; - } else { - apppadcount +=1; - } -} - - -static void test(void) -{ - mycell *a[4], /* a is a table of exact roots */ - *b[4]; /* b is a table of ambiguous roots */ - int i, j, k; - mps_chain_t chain; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), mmqaArenaSIZE), - "create arena"); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie(mps_root_create_table(&root, arena, MPS_RANK_EXACT, 0, - (mps_addr_t *)&a[0], 4), - "create a root table"); - - cdie(mps_root_create_table(&root1, arena, MPS_RANK_AMBIG, 0, - (mps_addr_t *)&b[0], 4), - "create b root table"); - - cdie(mps_fmt_create_A(&format, arena, &fmtA), "create format"); - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - die(mmqa_pool_create_chain(&poolamc, arena, mps_class_amc(), format, chain), - "create pool(amc)"); - - die(mmqa_pool_create_chain(&poollo, arena, mps_class_amcz(), format, chain), - "create pool(amcz)"); - - die(mps_pool_create(&poolawl, arena, mps_class_awl(), format), - "create pool(awl)"); - - cdie( - mps_ap_create(&apamc, poolamc, MPS_RANK_EXACT), - "create ap(amc)"); - - cdie( - mps_ap_create(&aplo, poollo, MPS_RANK_EXACT), - "create ap(amcz)"); - - cdie( - mps_ap_create(&apawl, poolawl, MPS_RANK_EXACT), - "create ap(awl)"); - - newstamp = 0; - - for (i=0; i<4; i++) { - die(allocrdumb(&a[i], aplo, 64, MPS_RANK_EXACT), "alloc failed"); - a[i]->data.checkedflag = newstamp; - die(allocrone(&b[i], apawl, 5, MPS_RANK_EXACT), "alloc failed"); - b[i]->data.checkedflag = newstamp; - b[i]->data.ref[0].addr = a[i]; - die(allocrone(&a[i], apamc, 5, MPS_RANK_EXACT), "alloc failed"); - a[i]->data.checkedflag = newstamp; - a[i]->data.ref[0].addr = b[i]; - } - - - for (j=0; j<100; j++) { - - comment("%i of 100", j); - - for (i=0; i<10000; i++) { - k = ranint(4); - die(allocrdumb(&a[k], aplo, 64, MPS_RANK_EXACT), "alloc failed"); - a[k]->data.checkedflag = newstamp; - k = ranint(4); - die(allocrone(&b[k], apawl, 5, MPS_RANK_EXACT), "alloc failed"); - b[k]->data.checkedflag = newstamp; - b[k]->data.ref[0].addr = a[ranint(4)]; - b[k]->data.ref[1].addr = b[ranint(4)]; - die(allocrone(&a[k], apamc, 5, MPS_RANK_EXACT), "alloc failed"); - a[k]->data.checkedflag = newstamp; - a[k]->data.ref[2].addr = b[ranint(4)]; - } - - comment("walking..."); - - mps_arena_park(arena); - mps_arena_collect(arena); - - oldstamp = newstamp; - newstamp += 1; - mps_arena_formatted_objects_walk(arena, stepper, - (void *)MAGICPOINT, MAGICSIZE); - mps_arena_release(arena); - - comment("tracing..."); - - oldstamp = newstamp; - newstamp += 1; - tracegraph((mycell *) exfmt_root); - tracegraph(a[0]); - tracegraph(a[1]); - tracegraph(a[2]); - tracegraph(a[3]); - tracegraph(b[0]); - tracegraph(b[1]); - tracegraph(b[2]); - tracegraph(b[3]); - - comment("ok"); - } - - mps_ap_destroy(apamc); - mps_ap_destroy(aplo); - mps_ap_destroy(apawl); - comment("Destroyed aps."); - - mps_pool_destroy(poolamc); - mps_pool_destroy(poollo); - mps_pool_destroy(poolawl); - comment("Destroyed pools."); - - mps_chain_destroy(chain); - mps_fmt_destroy(format); - mps_root_destroy(root); - mps_root_destroy(root1); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/105.c b/mps/qa/function/105.c deleted file mode 100644 index 2c36bf45004..00000000000 --- a/mps/qa/function/105.c +++ /dev/null @@ -1,99 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!105.c(trunk.2) $ - summary = weak refs to nailed amc objects are not splatted - language = c - link = testlib.o rankfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscawl.h" -#include "mpscamc.h" -#include "rankfmt.h" -#include "mpsavm.h" - - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - - -void *stackpointer; - - -static void test(void) -{ - mps_arena_t arena; - mps_pool_t poolamc, poolawl; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_chain_t chain; - mps_ap_t apamc, apawl, apweak; - - mycell *a, *b; - - RC; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), mmqaArenaSIZE), - "create arena"); - - die(mps_thread_reg(&thread, arena), "register thread"); - die(mps_root_create_reg(&root, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - die(mps_fmt_create_A(&format, arena, &fmtA), "create format"); - die(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - die(mmqa_pool_create_chain(&poolamc, arena, mps_class_amc(), format, chain), - "create pool(amc)"); - - cdie(mps_pool_create(&poolawl, arena, mps_class_awl(), format), - "create pool(awl)"); - - cdie(mps_ap_create(&apweak, poolawl, MPS_RANK_WEAK), - "create ap(weak)"); - - cdie(mps_ap_create(&apawl, poolawl, MPS_RANK_EXACT), - "create ap(awl)"); - - cdie(mps_ap_create(&apamc, poolamc, MPS_RANK_EXACT), - "create ap(amc)"); - - b = allocone(apamc, 1, MPS_RANK_EXACT); - a = allocone(apweak, 1, MPS_RANK_WEAK); - - mps_ap_destroy(apawl); - mps_ap_destroy(apamc); - mps_ap_destroy(apweak); - comment("Destroyed aps."); - /* buffered segments aren't condemned! */ - - setref(a, 0, b); - mps_arena_collect(arena); - asserts(getref(a, 0) == b, "Reference changed or was splatted."); - - mps_pool_destroy(poolamc); - mps_pool_destroy(poolawl); - mps_chain_destroy(chain); - mps_fmt_destroy(format); - mps_root_destroy(root); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/106.c b/mps/qa/function/106.c deleted file mode 100644 index c110a061d6f..00000000000 --- a/mps/qa/function/106.c +++ /dev/null @@ -1,124 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!106.c(trunk.3) $ - summary = string twiddling with an AMCZ pool - language = c - link = lofmt.o testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "lofmt.h" -#include -#include "mpsavm.h" - - -#define MAXLEN 1000000; - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - - -void *stackpointer; -mps_ap_t ap; - - -static locell *string_ch(char* x) -{ - size_t len; - locell *y; - - len = strlen(x); - - y = alloclo(ap, len+1); - memcpy(y->data.data, x, len+1); - y->data.len = len; - - return y; -} - - -static locell *conc(locell *x, locell *y) -{ - size_t l, m; - locell *z; - - l = x->data.len; - m = y->data.len; - - z = alloclo(ap, l+m+1); - memcpy(z->data.data, x->data.data, l); - memcpy(&(z->data.data[l]), y->data.data, m); - z->data.data[l+m] = '\0'; - z->data.len = l+m; - - return z; -} - - -static void test(void) -{ - mps_arena_t arena; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_chain_t chain; - - locell *a,*b,*c; - int i; - - alloclocomments = 0; - allowlocopies = 0; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), mmqaArenaSIZE), - "create arena"); - - die(mps_thread_reg(&thread, arena), "register thread"); - die(mps_root_create_reg(&root, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - die(mps_fmt_create_A(&format, arena, &fmtLO), "create format"); - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - die(mmqa_pool_create_chain(&pool, arena, mps_class_amcz(), format, chain), - "create pool"); - - cdie( - mps_ap_create(&ap, pool, MPS_RANK_EXACT), - "create ap"); - - a = string_ch("Hello there"); - b = string_ch("Wibble wobble foo"); - c = string_ch("Ba "); - - for (i=0; i<10000; i++) { - a = conc(string_ch("B"), a); - c = conc(string_ch("Hello there"), string_ch(" folks!")); - } - - mps_ap_destroy(ap); - mps_pool_destroy(pool); - mps_chain_destroy(chain); - mps_fmt_destroy(format); - mps_root_destroy(root); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/107.c b/mps/qa/function/107.c deleted file mode 100644 index 3a35032e0b9..00000000000 --- a/mps/qa/function/107.c +++ /dev/null @@ -1,125 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!107.c(trunk.3) $ - summary = big allocation with an AMCZ pool - language = c - link = lofmt.o testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "lofmt.h" -#include -#include "mpsavm.h" - - -#define MAXLEN 1000000; - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - - -void *stackpointer; -mps_ap_t ap; - - -static locell *string_ch(char* x) -{ - size_t len; - locell *y; - - len = strlen(x); - - y = alloclo(ap, len+1); - memcpy(y->data.data, x, len+1); - y->data.len = len; - - return y; -} - - -static locell *conc(locell *x, locell *y) -{ - size_t l, m; - locell *z; - - l = x->data.len; - m = y->data.len; - - z = alloclo(ap, l+m+1); - memcpy(z->data.data, x->data.data, l); - memcpy(&(z->data.data[l]), y->data.data, m); - z->data.data[l+m] = '\0'; - z->data.len = l+m; - - return z; -} - - -static void test(void) -{ - mps_arena_t arena; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_chain_t chain; - - locell *a,*b,*c,*z; - int i; - - alloclocomments = 0; - allowlocopies = 0; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), mmqaArenaSIZE), - "create arena"); - - die(mps_thread_reg(&thread, arena), "register thread"); - die(mps_root_create_reg(&root, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - die(mps_fmt_create_A(&format, arena, &fmtLO), "create format"); - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - die(mmqa_pool_create_chain(&pool, arena, mps_class_amcz(), format, chain), - "create pool"); - - cdie( - mps_ap_create(&ap, pool, MPS_RANK_EXACT), - "create ap"); - - a = string_ch("Hello there"); - b = string_ch("Wibble wobble foo"); - c = string_ch("Ba "); - - for (i=0; i<10000; i++) { - a = conc(string_ch("B"), a); - c = conc(string_ch("Hello there"), string_ch(" folks!")); - z = alloclo(ap, 0x4000); - } - - mps_ap_destroy(ap); - mps_pool_destroy(pool); - mps_chain_destroy(chain); - mps_fmt_destroy(format); - mps_root_destroy(root); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/108.c b/mps/qa/function/108.c deleted file mode 100644 index d78850bdfcb..00000000000 --- a/mps/qa/function/108.c +++ /dev/null @@ -1,106 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!108.c(trunk.2) $ - summary = try to provoke request.dylan.170463 using AMCZ pool - language = c - link = testlib.o awlfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscawl.h" -#include "mpscamc.h" -#include "awlfmt.h" -#include "mpsavm.h" - - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - - -void *stackpointer; - - -static void test(void) -{ - mps_arena_t arena; - mps_pool_t poolamc, poollo; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_chain_t chain; - mps_ap_t apamc, aplo; - - mycell *a[100], *b; - - int i; - int j; - int k,z; - - alloccomments = 1; - formatcomments = 1; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), mmqaArenaSIZE), - "create arena"); - - die(mps_thread_reg(&thread, arena), "register thread"); - die(mps_root_create_reg(&root, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - die(mps_fmt_create_A(&format, arena, &fmtA), "create format"); - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - die(mmqa_pool_create_chain(&poolamc, arena, mps_class_amc(), format, chain), - "create pool"); - die(mmqa_pool_create_chain(&poollo, arena, mps_class_amcz(), format, chain), - "create pool"); - - cdie( - mps_ap_create(&aplo, poollo, MPS_RANK_EXACT), - "create ap"); - - cdie( - mps_ap_create(&apamc, poolamc, MPS_RANK_EXACT), - "create ap"); - - for(i=0; i<100; i++) { - a[i] = allocone(aplo, 6, 1); - } - - for(i=0; i<10000; i++) { - j = ranint(100); - comment("New object %i", j); - a[j] = allocone(aplo, 5+ranint(50), 1); - k = ranint(50); - z = ranint(5); - comment("setting %i (%p) %i", k, a[k], z); - setref(a[k], z, a[j]); - b = allocdumb(apamc, 0x400*64, 0); - } - - mps_ap_destroy(aplo); - mps_ap_destroy(apamc); - mps_pool_destroy(poolamc); - mps_pool_destroy(poollo); - mps_chain_destroy(chain); - mps_fmt_destroy(format); - mps_root_destroy(root); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/109.c b/mps/qa/function/109.c deleted file mode 100644 index 908592602af..00000000000 --- a/mps/qa/function/109.c +++ /dev/null @@ -1,296 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!109.c(trunk.5) $ - summary = finalization tests with AMC, AWL and AMCZ - language = c - link = testlib.o rankfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscawl.h" -#include "mpscamc.h" -#include "mpsavm.h" -#include "rankfmt.h" - - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - - -void *stackpointer; - -mps_arena_t arena; - -int final_count = 0; - - -enum { - FINAL_DISCARD, - FINAL_REREGISTER, - FINAL_STORE, - FINAL_QUEUE -}; - - -mps_message_t mqueue[10000]; - -int qhd = 0; -int qtl = 0; - - -static void nq(mps_message_t mess) -{ - mqueue[qhd] = mess; - qhd = (qhd+1) % 10000; - asserts(qhd != qtl, "No space in message queue."); -} - - -static int qmt(void) -{ - if (qhd == qtl) { - return 1; - } else { - return 0; - } -} - - -static int dq(mps_message_t *mess) -{ - if (qhd == qtl) { - return 0; - } else { - *mess = mqueue[qtl]; - qtl = (qtl+1) % 10000; - return 1; - } -} - - -static void process_mess(mps_message_t message, int faction, mps_addr_t *ref) -{ - mps_addr_t ffref; - - switch (faction) { - case FINAL_DISCARD: - mps_message_discard(arena, message); - break; - case FINAL_REREGISTER: - mps_message_finalization_ref(&ffref, arena, message); - mps_finalize(arena, &ffref); - final_count +=1; - mps_message_discard(arena, message); - break; - case FINAL_STORE: - mps_message_finalization_ref(ref, arena, message); - mps_message_discard(arena, message); - break; - case FINAL_QUEUE: - nq(message); - break; - default: - asserts(0, "Unknown finalization action."); - } -} - - -static void qpoll(mycell **ref, int faction) -{ - mps_message_t message; - - if (dq(&message)) { - process_mess(message, faction, (mps_addr_t*)ref); - } -} - - -static void finalpoll(mycell **ref, int faction) -{ - mps_message_t message; - - if (mps_message_get(&message, arena, MPS_MESSAGE_TYPE_FINALIZATION)) { - final_count -=1; - process_mess(message, faction, (mps_addr_t*)ref); - } -} - - -static void test(void) -{ - mps_pool_t poolamc, poolawl, poollo; - mps_thr_t thread; - mps_root_t root0, root1; - - mps_fmt_t format; - mps_chain_t chain; - mps_ap_t apamc, apawl, aplo; - - mycell *a, *b, *c, *d, *z; - - long int j; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t)1024*1024*30), - "create arena"); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie(mps_root_create_reg(&root0, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie(mps_root_create_table(&root1, arena, MPS_RANK_AMBIG, 0, - (mps_addr_t*)&exfmt_root, 1), - "create table root"); - - cdie(mps_fmt_create_A(&format, arena, &fmtA), - "create format"); - - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - cdie(mmqa_pool_create_chain(&poolamc, arena, mps_class_amc(), format, chain), - "create pool(amc)"); - - cdie(mps_pool_create(&poolawl, arena, mps_class_awl(), format), - "create pool(awl)"); - - cdie(mmqa_pool_create_chain(&poollo, arena, mps_class_amcz(), format, chain), - "create pool(amcz)"); - - cdie(mps_ap_create(&apawl, poolawl, MPS_RANK_WEAK), - "create ap(awl)"); - - cdie(mps_ap_create(&apamc, poolamc, MPS_RANK_EXACT), - "create ap(amc)"); - - cdie(mps_ap_create(&aplo, poollo, MPS_RANK_EXACT), - "create ap(amcz)"); - - mps_message_type_enable(arena, mps_message_type_finalization()); - - /* register loads of objects for finalization (1000*4) */ - - a = allocone(apamc, 2, 1); - b = a; - - for (j=0; j<1000; j++) { - a = allocone(apamc, 2, MPS_RANK_EXACT); - c = allocone(apawl, 2, MPS_RANK_WEAK); - d = allocone(aplo, 2, MPS_RANK_EXACT); /* rank irrelevant here! */ - mps_finalize(arena, (mps_addr_t*)&a); - mps_finalize(arena, (mps_addr_t*)&c); - mps_finalize(arena, (mps_addr_t*)&d); - mps_finalize(arena, (mps_addr_t*)&d); - final_count += 4; - setref(a, 0, b); - setref(a, 1, c); - setref(c, 1, d); - b = a; - } - - /* throw them all away and collect everything */ - - a = NULL; - b = NULL; - c = NULL; - d = NULL; - - mps_arena_collect(arena); - - while (mps_message_poll(arena)) { - finalpoll(&z, FINAL_DISCARD); - } - - /* How many are left? (Ideally, this would be 0 but there's no guarantee.) */ - - report("count1", "%i", final_count); - - /* now to test leaving messages open for a long time! */ - - for (j=0; j<1000; j++) { - comment("%d of 1000", j); - a = allocone(apamc, 10000, MPS_RANK_EXACT); - mps_finalize(arena, (mps_addr_t*)&a); - final_count +=1; - comment("finalize"); - finalpoll(&z, FINAL_QUEUE); - } - - comment("reregister"); - - for (j=0; j<500; j++) { - comment("%d of 500", j); - qpoll(&z, FINAL_REREGISTER); - } - - b = a; - z = a; - - for (j=0; j<1000; j++) { - comment("%d of 1000", j); - finalpoll(&z, FINAL_QUEUE); - qpoll(&z, FINAL_STORE); - a = allocone(apamc, 2, MPS_RANK_EXACT); - setref(z, 0, b); - setref(a, 1, z); - b = a; - } - - - for (j=0; j<1000; j++) { - a = allocone(apamc, 2, MPS_RANK_EXACT); - qpoll(&z, FINAL_DISCARD); - finalpoll(&z, FINAL_DISCARD); - setref(a, 0, b); - b = a; - } - - /* Force old objects to be killed */ - - while (qmt() == 0) { - qpoll(&z, FINAL_DISCARD); - } - - mps_root_destroy(root0); - mps_root_destroy(root1); - comment("Destroyed roots."); - - mps_arena_collect(arena); - comment("Collected arena."); - - while (mps_message_poll(arena)) { - finalpoll(&z, FINAL_DISCARD); - } - - report("count2", "%d", final_count); - - mps_ap_destroy(apawl); - mps_ap_destroy(apamc); - mps_ap_destroy(aplo); - comment("Destroyed aps."); - - mps_pool_destroy(poolamc); - mps_pool_destroy(poolawl); - mps_pool_destroy(poollo); - comment("Destroyed pools."); - - mps_chain_destroy(chain); - mps_fmt_destroy(format); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/11.c b/mps/qa/function/11.c deleted file mode 100644 index d6c5002cb4f..00000000000 --- a/mps/qa/function/11.c +++ /dev/null @@ -1,99 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!11.c(trunk.7) $ - summary = lots of allocation to provoke mmap error in sunos - language = c - link = myfmt.o testlib.o -END_HEADER -*/ - -/* this is same as test 3.c, with input of 0x4000 - and a limit of 100 not 10000 iterations -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "mpsavm.h" -#include "myfmt.h" - - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - - -void *stackpointer; - - -static void test(void) -{ - mps_arena_t arena; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_chain_t chain; - mps_ap_t ap; - - mycell *a,*b,*c; - size_t inpsize; - - int i,j; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t)(1024*1024*20)), - "create arena"); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - cdie(mps_root_create_reg(&root, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie(mps_fmt_create_A(&format, arena, &fmtA), "create format"); - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - formatcomments = 0; - - cdie(mmqa_pool_create_chain(&pool, arena, mps_class_amc(), format, chain), - "create pool"); - - cdie( - mps_ap_create(&ap, pool, MPS_RANK_EXACT), - "create ap"); - - inpsize=0x4000; - - for (j=0; j<100; j++) { - a = allocone(ap, 0, NULL, NULL, inpsize); - b = a; - - for (i=1; i<100; i++) { - c = allocone(ap, i, NULL, NULL, inpsize); - b->ref[0] = c; - b = c; - } - - comment("%d: %x", j, (int) a); - } - - mps_ap_destroy(ap); - mps_pool_destroy(pool); - mps_chain_destroy(chain); - mps_fmt_destroy(format); - mps_root_destroy(root); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed space."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/110.c b/mps/qa/function/110.c deleted file mode 100644 index 63cadfc2ccf..00000000000 --- a/mps/qa/function/110.c +++ /dev/null @@ -1,304 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!110.c(trunk.5) $ - summary = finalization tests with AMC, AWL and AMCZ - language = c - link = testlib.o rankfmt.o -OUTPUT_SPEC - count1 < 50 - count2 < 50 - result = pass -END_HEADER -*/ - -#include "testlib.h" -#include "mpscawl.h" -#include "mpscamc.h" -#include "mpsavm.h" -#include "rankfmt.h" - - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - - -void *stackpointer; - -mps_arena_t arena; - -int final_count = 0; - - -enum { - FINAL_DISCARD, - FINAL_REREGISTER, - FINAL_STORE, - FINAL_QUEUE -}; - - -mps_message_t mqueue[10000]; - -int qhd = 0; -int qtl = 0; - - -static void nq(mps_message_t mess) -{ - mqueue[qhd] = mess; - qhd = (qhd+1) % 10000; - asserts(qhd != qtl, "No space in message queue."); -} - - -static int qmt(void) -{ - if (qhd == qtl) { - return 1; - } else { - return 0; - } -} - - -static int dq(mps_message_t *mess) -{ - if (qhd == qtl) { - return 0; - } else { - *mess = mqueue[qtl]; - qtl = (qtl+1) % 10000; - return 1; - } -} - - -static void process_mess(mps_message_t message, int faction, mps_addr_t *ref) -{ - mps_addr_t ffref; - - switch (faction) { - case FINAL_DISCARD: - mps_message_discard(arena, message); - break; - case FINAL_REREGISTER: - mps_message_finalization_ref(&ffref, arena, message); - mps_finalize(arena, &ffref); - final_count +=1; - mps_message_discard(arena, message); - break; - case FINAL_STORE: - mps_message_finalization_ref(ref, arena, message); - mps_message_discard(arena, message); - break; - case FINAL_QUEUE: - nq(message); - break; - default: - asserts(0, "Unknown finalization action."); - } -} - - -static void qpoll(mycell **ref, int faction) -{ - mps_message_t message; - - if (dq(&message)) { - process_mess(message, faction, (mps_addr_t*)ref); - } -} - - -static void finalpoll(mycell **ref, int faction) -{ - mps_message_t message; - - if (mps_message_get(&message, arena, MPS_MESSAGE_TYPE_FINALIZATION)) { - final_count -=1; - process_mess(message, faction, (mps_addr_t*)ref); - } -} - - -static void test(void) -{ - mps_pool_t poolamc, poolawl, poollo; - mps_thr_t thread; - mps_root_t root0, root1; - - mps_fmt_t format; - mps_chain_t chain; - mps_ap_t apamc, apawl, aplo; - - mycell *a, *b, *c, *d, *z; - - long int j; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t)1024*1024*30), - "create arena"); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie(mps_root_create_reg(&root0, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie(mps_root_create_table(&root1, arena, MPS_RANK_AMBIG, 0, - (mps_addr_t*)&exfmt_root, 1), - "create table root"); - - cdie(mps_fmt_create_A(&format, arena, &fmtA), - "create format"); - - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - die(mmqa_pool_create_chain(&poolamc, arena, mps_class_amc(), format, chain), - "create pool(amc)"); - - cdie(mps_pool_create(&poolawl, arena, mps_class_awl(), format), - "create pool(awl)"); - - cdie(mmqa_pool_create_chain(&poollo, arena, mps_class_amcz(), format, chain), - "create pool(amcz)"); - - cdie(mps_ap_create(&apawl, poolawl, MPS_RANK_WEAK), - "create ap(awl)"); - - cdie(mps_ap_create(&apamc, poolamc, MPS_RANK_EXACT), - "create ap(amc)"); - - cdie(mps_ap_create(&aplo, poollo, MPS_RANK_EXACT), - "create ap(amcz)"); - - mps_message_type_enable(arena, mps_message_type_finalization()); - - /* register loads of objects for finalization (1000*4) */ - - a = allocone(apamc, 2, 1); - b = a; - - for (j=0; j<10; j++) { - a = allocone(apamc, 2, MPS_RANK_EXACT); - c = allocone(apawl, 2, MPS_RANK_WEAK); - d = allocone(aplo, 2, MPS_RANK_EXACT); /* rank irrelevant here! */ - mps_finalize(arena, (mps_addr_t*)&a); - mps_finalize(arena, (mps_addr_t*)&c); - mps_finalize(arena, (mps_addr_t*)&d); - mps_finalize(arena, (mps_addr_t*)&d); - final_count += 4; - setref(a, 0, b); - setref(a, 1, c); - setref(c, 1, d); - b = a; - } - - /* throw them all away and collect everything */ - - a = NULL; - b = NULL; - c = NULL; - d = NULL; - - mps_arena_collect(arena); - - while (mps_message_poll(arena)) { - finalpoll(&z, FINAL_DISCARD); - } - - /* how many are left? (Ideally, this would be 0 but there's no guarantee.) */ - - report("count1", "%i", final_count); - - /* now to test leaving messages open for a long time! */ - - for (j=0; j<10; j++) { - comment("%d of 10", j); - a = allocone(apamc, 10000, MPS_RANK_EXACT); - mps_finalize(arena, (mps_addr_t*)&a); - final_count +=1; - comment("finalize"); - finalpoll(&z, FINAL_QUEUE); - } - - comment("reregister"); - - for (j=0; j<10; j++) { - comment("%d of 10", j); - qpoll(&z, FINAL_REREGISTER); - } - - b = a; - z = a; - - for (j=0; j<10; j++) { - comment("%d of 10", j); - finalpoll(&z, FINAL_QUEUE); - qpoll(&z, FINAL_STORE); - a = allocone(apamc, 2, MPS_RANK_EXACT); - setref(z, 0, b); - setref(a, 1, z); - b = a; - } - - - for (j=0; j<10; j++) { - a = allocone(apamc, 2, MPS_RANK_EXACT); - qpoll(&z, FINAL_DISCARD); - finalpoll(&z, FINAL_DISCARD); - setref(a, 0, b); - b = a; - } - - /* Force old objects to be killed */ - - while (qmt() == 0) { - qpoll(&z, FINAL_DISCARD); - } - - while (mps_message_poll(arena)) { - finalpoll(&z, FINAL_DISCARD); - } - - mps_root_destroy(root0); - mps_root_destroy(root1); - comment("Destroyed roots."); - - mps_ap_destroy(apawl); - mps_ap_destroy(apamc); - mps_ap_destroy(aplo); - comment("Destroyed aps."); - - mps_arena_collect(arena); - comment("Collected arena."); - - while (mps_message_poll(arena)) { - finalpoll(&z, FINAL_DISCARD); - } - - report("count2", "%d", final_count); - - mps_pool_destroy(poolamc); - mps_pool_destroy(poolawl); - mps_pool_destroy(poollo); - comment("Destroyed pools."); - - mps_chain_destroy(chain); - mps_fmt_destroy(format); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/111.c b/mps/qa/function/111.c deleted file mode 100644 index 5e43216a0be..00000000000 --- a/mps/qa/function/111.c +++ /dev/null @@ -1,222 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!111.c(trunk.5) $ - summary = wait until all registered objects are finalized - language = c - link = testlib.o rankfmt.o -OUTPUT_SPEC - count = 0 - iter < 4 - result = pass -END_HEADER -*/ - -#include "testlib.h" -#include "mpscawl.h" -#include "mpscamc.h" -#include "mpsavm.h" -#include "rankfmt.h" - - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - - -void *stackpointer; - -mps_arena_t arena; - -int final_count = 0; - - -enum { - FINAL_DISCARD, - FINAL_REREGISTER, - FINAL_STORE, - FINAL_QUEUE -}; - - -mps_message_t mqueue[10000]; - -int qhd = 0; -int qtl = 0; - - -static void nq(mps_message_t mess) -{ - mqueue[qhd] = mess; - qhd = (qhd+1) % 10000; - asserts(qhd != qtl, "No space in message queue."); -} - - -static void process_mess(mps_message_t message, int faction, mps_addr_t *ref) -{ - mps_addr_t ffref; - - switch (faction) { - case FINAL_DISCARD: - mps_message_discard(arena, message); - break; - case FINAL_REREGISTER: - mps_message_finalization_ref(&ffref, arena, message); - mps_finalize(arena, &ffref); - final_count +=1; - mps_message_discard(arena, message); - break; - case FINAL_STORE: - mps_message_finalization_ref(ref, arena, message); - mps_message_discard(arena, message); - break; - case FINAL_QUEUE: - nq(message); - break; - default: - asserts(0, "Unknown finalization action."); - } -} - - -static void finalpoll(mycell **ref, int faction) -{ - mps_message_t message; - - if (mps_message_get(&message, arena, MPS_MESSAGE_TYPE_FINALIZATION)) { - final_count -=1; - process_mess(message, faction, (mps_addr_t*)ref); - } -} - - -static void test(void) -{ - mps_pool_t poolamc, poolawl, poollo; - mps_thr_t thread; - mps_root_t root0, root1; - - mps_fmt_t format; - mps_chain_t chain; - mps_ap_t apamc, apawl, aplo; - - mycell *a, *b, *c, *d, *z; - - long int i,j; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t)1024*1024*30), - "create arena"); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie(mps_root_create_reg(&root0, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie(mps_root_create_table(&root1, arena, MPS_RANK_AMBIG, 0, - (mps_addr_t*)&exfmt_root, 1), - "create table root"); - - cdie(mps_fmt_create_A(&format, arena, &fmtA), - "create format"); - - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - die(mmqa_pool_create_chain(&poolamc, arena, mps_class_amc(), format, chain), - "create pool(amc)"); - - cdie(mps_pool_create(&poolawl, arena, mps_class_awl(), format), - "create pool(awl)"); - - cdie(mmqa_pool_create_chain(&poollo, arena, mps_class_amcz(), format, chain), - "create pool(amcz)"); - - cdie(mps_ap_create(&apawl, poolawl, MPS_RANK_WEAK), - "create ap(awl)"); - - cdie(mps_ap_create(&apamc, poolamc, MPS_RANK_EXACT), - "create ap(amc)"); - - cdie(mps_ap_create(&aplo, poollo, MPS_RANK_EXACT), - "create ap(amcz)"); - - mps_message_type_enable(arena, mps_message_type_finalization()); - - /* register loads of objects for finalization (1000*4) */ - - a = allocone(apamc, 2, 1); - b = a; - - for (j=0; j<1000; j++) { - a = allocone(apamc, 2, MPS_RANK_EXACT); - c = allocone(apawl, 2, MPS_RANK_WEAK); - d = allocone(aplo, 2, MPS_RANK_EXACT); /* rank irrelevant here! */ - mps_finalize(arena, (mps_addr_t*)&a); - mps_finalize(arena, (mps_addr_t*)&c); - mps_finalize(arena, (mps_addr_t*)&d); - mps_finalize(arena, (mps_addr_t*)&d); - final_count += 4; - } - - /* throw them all away and collect everything */ - - a = NULL; - b = NULL; - c = NULL; - d = NULL; - - mps_root_destroy(root0); - mps_root_destroy(root1); - comment("Destroyed roots."); - - mps_arena_collect(arena); - - i = 0; - - while (final_count != 0 && i < 10) { - finalpoll(&z, FINAL_DISCARD); - if (mps_message_poll(arena) == 0) { - i++; - a = allocdumb(apawl, 1024, MPS_RANK_WEAK); - a = allocdumb(apamc, 1024, MPS_RANK_EXACT); - a = allocdumb(aplo, 1024, MPS_RANK_EXACT); - mps_arena_collect(arena); - comment(" %i", final_count); - } - } - - /* how many are left? (Ideally, this would be 0 but there's no guarantee.) */ - - report("count", "%i", final_count); - report("iter", "%i", i); - - /* now to test leaving messages open for a long time! */ - - mps_ap_destroy(apawl); - mps_ap_destroy(apamc); - mps_ap_destroy(aplo); - comment("Destroyed aps."); - - mps_pool_destroy(poolamc); - mps_pool_destroy(poolawl); - mps_pool_destroy(poollo); - comment("Destroyed pools."); - - mps_chain_destroy(chain); - mps_fmt_destroy(format); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/112.c b/mps/qa/function/112.c deleted file mode 100644 index 2a583d8ca0b..00000000000 --- a/mps/qa/function/112.c +++ /dev/null @@ -1,94 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!112.c(trunk.3) $ - summary = AMCZ pool should get collected - language = c - link = testlib.o rankfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "rankfmt.h" -#include "mpsavm.h" - - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - - -void *stackpointer; - -mps_arena_t arena; - - -static void test(void) { - mps_pool_t poollo; - mps_thr_t thread; - mps_root_t root0, root1; - - mps_fmt_t format; - mps_chain_t chain; - mps_ap_t aplo; - - mycell *a; - - long int j; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t)1024*1024*30), - "create arena"); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - cdie(mps_root_create_reg(&root0, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie(mps_root_create_table(&root1, arena, MPS_RANK_AMBIG, 0, - (mps_addr_t*)&exfmt_root, 1), - "create table root"); - - cdie(mps_fmt_create_A(&format, arena, &fmtA), - "create format"); - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - die(mmqa_pool_create_chain(&poollo, arena, mps_class_amcz(), format, chain), - "create pool"); - - cdie(mps_ap_create(&aplo, poollo, MPS_RANK_EXACT), - "create ap"); - - /* alloc lots in an LO pool; it should be collected away */ - - for(j=0; j<1000; j++) { - a = allocdumb(aplo, 1024ul*1024, MPS_RANK_EXACT); - } - - /* (total allocated is 1000 M) */ - - mps_root_destroy(root0); - mps_root_destroy(root1); - comment("Destroyed roots."); - - mps_ap_destroy(aplo); - mps_pool_destroy(poollo); - mps_chain_destroy(chain); - mps_fmt_destroy(format); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena."); - - pass(); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/113.c b/mps/qa/function/113.c deleted file mode 100644 index bff372d420f..00000000000 --- a/mps/qa/function/113.c +++ /dev/null @@ -1,126 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = AWL and AWL performance - language = c - link = testlib.o fastfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscawl.h" -#include "mpscamc.h" -#include "mpsclo.h" -#include "fastfmt.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t poolamc, poolawl; - mps_thr_t thread; - mps_root_t root, root1; - - mps_fmt_t format; - mps_ap_t apamc, apawl; - - mycell *a, *b, *c, *d, *e, *f, *g; - - int i; - int j; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_root_create_table(&root1,space,MPS_RANK_AMBIG,0,&exfmt_root,1), - "create table root"); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - cdie( - mps_pool_create(&poolamc, space, mps_class_awl(), format), - "create pool"); - - cdie( - mps_pool_create(&poolawl, space, mps_class_awl(), format), - "create pool"); - - cdie( - mps_ap_create(&apawl, poolawl, MPS_RANK_EXACT), - "create ap"); - - cdie( - mps_ap_create(&apamc, poolamc, MPS_RANK_EXACT), - "create ap"); - - b = allocone(apamc, 1, MPS_RANK_EXACT); - - for (j=1; j<100; j++) - { - comment("%i of 100.", j); - a = allocone(apamc, 5, MPS_RANK_EXACT); - b = a; - c = a; - d = a; - e = a; - f = a; - g = a; - - for (i=1; i<5000; i++) - { - c = allocone(apamc, 20, MPS_RANK_EXACT); - d = allocone(apawl, 20, MPS_RANK_EXACT); - if (ranint(8) == 0) e = c; - if (ranint(8) == 0) f = c; - if (ranint(8) == 0) g = c; - setref(b, 0, c); - setref(c, 1, d); - setref(c, 2, e); - setref(c, 3, f); - setref(c, 4, g); - b = c; - } - } - - mps_ap_destroy(apawl); - mps_ap_destroy(apamc); - comment("Destroyed aps."); - - mps_pool_destroy(poolamc); - mps_pool_destroy(poolawl); - comment("Destroyed pools."); - - mps_fmt_destroy(format); - comment("Destroyed format."); - - mps_root_destroy(root); - mps_root_destroy(root1); - comment("Destroyed roots."); - - mps_thread_dereg(thread); - comment("Deregistered thread."); - - mps_space_destroy(space); - comment("Destroyed space."); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/114.c b/mps/qa/function/114.c deleted file mode 100644 index 6bdc8fdcbd9..00000000000 --- a/mps/qa/function/114.c +++ /dev/null @@ -1,126 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = AWL performance - language = c - link = testlib.o fastfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscawl.h" -#include "mpscamc.h" -#include "mpsclo.h" -#include "fastfmt.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t poolamc, poolawl; - mps_thr_t thread; - mps_root_t root, root1; - - mps_fmt_t format; - mps_ap_t apamc, apawl; - - mycell *a, *b, *c, *d, *e, *f, *g; - - int i; - int j; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_root_create_table(&root1,space,MPS_RANK_AMBIG,0,&exfmt_root,1), - "create table root"); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - cdie( - mps_pool_create(&poolamc, space, mps_class_awl(), format), - "create pool"); - - cdie( - mps_pool_create(&poolawl, space, mps_class_awl(), format), - "create pool"); - - cdie( - mps_ap_create(&apawl, poolawl, MPS_RANK_EXACT), - "create ap"); - - cdie( - mps_ap_create(&apamc, poolawl, MPS_RANK_EXACT), - "create ap"); - - b = allocone(apamc, 1, MPS_RANK_EXACT); - - for (j=1; j<100; j++) - { - comment("%i of 100.", j); - a = allocone(apamc, 5, MPS_RANK_EXACT); - b = a; - c = a; - d = a; - e = a; - f = a; - g = a; - - for (i=1; i<5000; i++) - { - c = allocone(apamc, 20, MPS_RANK_EXACT); - d = allocone(apawl, 20, MPS_RANK_EXACT); - if (ranint(8) == 0) e = c; - if (ranint(8) == 0) f = c; - if (ranint(8) == 0) g = c; - setref(b, 0, c); - setref(c, 1, d); - setref(c, 2, e); - setref(c, 3, f); - setref(c, 4, g); - b = c; - } - } - - mps_ap_destroy(apawl); - mps_ap_destroy(apamc); - comment("Destroyed aps."); - - mps_pool_destroy(poolamc); - mps_pool_destroy(poolawl); - comment("Destroyed pools."); - - mps_fmt_destroy(format); - comment("Destroyed format."); - - mps_root_destroy(root); - mps_root_destroy(root1); - comment("Destroyed roots."); - - mps_thread_dereg(thread); - comment("Deregistered thread."); - - mps_space_destroy(space); - comment("Destroyed space."); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/115.c b/mps/qa/function/115.c deleted file mode 100644 index d6c7a41c9b0..00000000000 --- a/mps/qa/function/115.c +++ /dev/null @@ -1,176 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = EPDL allocation test (with new alignment) - language = c - link = testlib.o -END_HEADER -*/ - -#include -#include "testlib.h" -#include "mpscepdl.h" -#include "mpsavm.h" - -#define MAXNUMBER 1000000 - -void *stackpointer; -mps_space_t space; - -static struct {mps_addr_t addr; size_t size;} queue[MAXNUMBER]; - -enum {SEQ=0, RAN=1, SEQGAP=2, RANGAP=3, DUMMY=4}; -static char *tdesc[] = {"sequential", "random", - "sequential gap", "random gap", "dummy"}; - -static void setobj(mps_addr_t a, size_t size, unsigned char val) -{ - unsigned char *b; - b = a; - - while (size>0) - { - *b=val; - /* comment("%p = %i", b, (int) val); - */ - b++; - size--; - } -} - -static int chkobj(mps_addr_t a, size_t size, unsigned char val) -{ - unsigned char *b; - b = a; - - while (size>0) - { - /* comment("%p == %i", b, (int) val); - */ - if (*b != val) return 0; - b++; - size--; - } - return 1; -} - -static void dt(int kind, - size_t extendBy, size_t avgSize, size_t maxSize, - size_t mins, size_t maxs, int number, int iter) -{ - mps_pool_t pool; - int i, hd; - clock_t time0, time1; - size_t size; - int secs; - - asserts(number <= MAXNUMBER, "number too big"); - - time0 = clock(); - asserts(time0 != -1, "processor time not available"); - - die( - mps_pool_create(&pool, space, mps_class_epdl(), - extendBy, avgSize, 8), - "create pool"); - - for(hd=0; hd 10000000 - drop13 > 10000000 -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "mpsavm.h" -#include "rankfmt.h" - - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - - -void *stackpointer; - -mps_arena_t arena; - - -static void test(void) -{ - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_chain_t chain; - mps_ap_t ap; - - mycell *a, *b; - - size_t x, y, z; - - int i; - - /* create an arena that can't grow beyond 128 M */ - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t) (1024*1024*128)), - "create arena"); - - die(mps_thread_reg(&thread, arena), "register thread"); - die(mps_root_create_reg(&root, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - die(mps_fmt_create_A(&format, arena, &fmtA), "create format"); - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - die(mmqa_pool_create_chain(&pool, arena, mps_class_amc(), format, chain), - "create pool"); - - cdie( - mps_ap_create(&ap, pool, MPS_RANK_EXACT), - "create ap"); - - /* allocate a jolly big chain of objects */ - - b = allocone(ap, 4, MPS_RANK_EXACT); - - for (i = 0; i < 256*1024; i++) { - a = allocone(ap, 4, MPS_RANK_EXACT); - setref(a, 0, b); - b = a; - } - - comment("%d objs allocated.", i); - - mps_arena_collect(arena); - x = mps_arena_committed(arena); - report("livesize", "%d", x); - - /* now let everything die, by destroying the only root and mps_arena_collect */ - - mps_root_destroy(root); - mps_arena_collect(arena); - y = mps_arena_committed(arena); - report("rootless", "%d", y); - - mps_ap_destroy(ap); - mps_arena_collect(arena); - z = mps_arena_committed(arena); - report("apless", "%d", z); - - report("drop12", "%d", x - y); - report("drop13", "%d", x - z); - mps_pool_destroy(pool); - comment("Destroyed pool."); - - mps_chain_destroy(chain); - mps_fmt_destroy(format); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/118.c b/mps/qa/function/118.c deleted file mode 100644 index 82c17d907c5..00000000000 --- a/mps/qa/function/118.c +++ /dev/null @@ -1,146 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!118.c(trunk.5) $ - summary = Collect with a fully initialised (but not committed) buffer - language = c - link = testlib.o -END_HEADER - */ - -#include "testlib.h" -#include "mpscamc.h" -#include "mpsavm.h" - - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - -#define testArenaSIZE ((size_t)64<<20) -/* objSIZE should be such that when this size is requested in a reserve */ -/* the buffer gets filled with exactly this much memory */ -#define objSIZE 8192 - - -static mps_ap_t ap; - - -static mps_res_t simple_scan(mps_ss_t ss, mps_addr_t base, mps_addr_t limit) -{ - return MPS_RES_OK; -} - -static mps_addr_t simple_skip(mps_addr_t limit) -{ - return (void *)((char *)limit + objSIZE); -} - -static void simple_fwd(mps_addr_t old, mps_addr_t new) -{ - ((mps_addr_t *)old)[1] = new; - ((mps_word_t *)old)[0] = 1; -} - -static mps_addr_t simple_is_fwd(mps_addr_t obj) -{ - if(*(mps_word_t *)obj) { - return ((mps_addr_t *)obj)[1]; - } else { - return NULL; - } -} - -static void simple_pad(mps_addr_t addr, size_t size) -{ -} - -static void simple_copy(mps_addr_t obj, mps_addr_t to) -{ - error("copy method not implemented in this test"); -} - - -struct mps_fmt_A_s simple_fmt_A = { - 4, - &simple_scan, - &simple_skip, - &simple_copy, - &simple_fwd, - &simple_is_fwd, - &simple_pad -}; - - -static mps_addr_t make(void) -{ - size_t size = objSIZE; - mps_addr_t p; - mps_res_t res; - - do { - MPS_RESERVE_BLOCK(res, p, ap, size); - if(res) - die(res, "MPS_RESERVE_BLOCK"); - *(mps_word_t *)p = 0; - } while(!mps_commit(ap, p, size)); - - return p; -} - - -static void test(void) -{ - mps_addr_t busy_init; - mps_ap_t busy_ap; - mps_arena_t arena; - mps_thr_t thread; - mps_fmt_t format; - mps_chain_t chain; - mps_pool_t pool; - unsigned long i; - - die(mps_arena_create(&arena, mps_arena_class_vm(), testArenaSIZE), - "arena_create"); - - die(mps_thread_reg(&thread, arena), "thread_reg"); - - die(mps_fmt_create_A(&format, arena, &simple_fmt_A), "fmt_create"); - die(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - die(mmqa_pool_create_chain(&pool, arena, mps_class_amc(), format, chain), - "create pool"); - - die(mps_ap_create(&ap, pool, MPS_RANK_EXACT), "BufferCreate"); - die(mps_ap_create(&busy_ap, pool, MPS_RANK_EXACT), "BufferCreate"); - - /* create an ap, and leave it busy */ - die(mps_reserve(&busy_init, busy_ap, objSIZE), "mps_reserve busy"); - - /* now simulate first part of commit */ - busy_ap->init = busy_ap->alloc; - - for(i = 0; i < 100000; ++i) { - make(); - } - - /* now simulate rest of commit */ - (void)(busy_ap->limit != 0 || mps_ap_trip(busy_ap, busy_init, objSIZE)); - - mps_ap_destroy(busy_ap); - mps_ap_destroy(ap); - mps_pool_destroy(pool); - mps_chain_destroy(chain); - mps_fmt_destroy(format); - mps_thread_dereg(thread); - mps_arena_destroy(arena); -} - - -int main(void) -{ - easy_tramp(test); - - pass(); - return 0; -} diff --git a/mps/qa/function/119.c b/mps/qa/function/119.c deleted file mode 100644 index 40a8c91144d..00000000000 --- a/mps/qa/function/119.c +++ /dev/null @@ -1,38 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = create a VM arena with non-aligned size - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpsavm.h" - -void *stackpointer; - -mps_arena_t arena; - -static void test(void) -{ - -/* create an arena that can't grow beyond 128 M */ - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t) (1024*1024*10+1)), - "create arena"); - - mps_arena_destroy(arena); - comment("Destroyed arena."); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/12.c b/mps/qa/function/12.c deleted file mode 100644 index 608b76336c7..00000000000 --- a/mps/qa/function/12.c +++ /dev/null @@ -1,203 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!12.c(trunk.8) $ - summary = lots of APs with interleaved reserve and 2-stage commit - language = c - link = testlib.o newfmt.o -END_HEADER -*/ - -/* - This test needs some explanation. The object 'cells' contains - NCELL references to other objects. NAPS allocation points - are created. At each step, we choose one and nudge it on - a little. Each allocation point goes through the following - cycle of steps: reserve, init, begin commit, end commit. - At the init step, each reference in the reserved object is - set to point randomly to one of the objects referenced by - cells or (with probability PNULL) to NULL. If commit fails, - the object is thrown away. If it succeeds, it is written into - a random reference in cells. Repeat. - - Because it has to deal directly with reserve and commit, - this test can't use the nice functions provided by newfmt - all the time. -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "mpsavm.h" -#include "newfmt.h" - - -#define NCELLS 100 -#define NAPS 100 -#define PNULL (ranint(100)<25) -#define NUMREFS (ranint(20)) -#define BLAH 0 -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - - -void *stackpointer; - -mps_ap_t ap[NAPS]; -mycell *p[NAPS]; -size_t s[NAPS]; -int nrefs[NAPS]; -int ap_state[NAPS]; - - -static void test(void) -{ - mps_arena_t arena; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_chain_t chain; - - mycell *cells; - int h,i,j,k,l; - mycell *pobj; - size_t bytes; - size_t alignment; - mps_addr_t q; - int nextid = 0x1000000; - - /* turn on comments about copying and scanning */ - formatcomments = BLAH; - fixcomments = BLAH; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), mmqaArenaSIZE), - "create arena"); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie(mps_root_create_reg(&root, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie(mps_fmt_create_A(&format, arena, &fmtA), "create format"); - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - cdie(mmqa_pool_create_chain(&pool, arena, mps_class_amc(), format, chain), - "create pool"); - - for (i=0; idata.tag = 0xD033E2A6; - p[i]->data.id = nextid; - ap_state[i] = 1; - commentif(BLAH, "%i: reserve %li at %p", i, nextid, q); - nextid +=1; - break; - case 1: - commentif(BLAH, "%i: init %li", i, p[i]->data.id); - p[i]->data.tag = MCdata; - p[i]->data.numrefs = nrefs[i]; - p[i]->data.size = s[i]; - ap_state[i] = 2; - for (k=0; kdata.ref[k].addr = NULL; - p[i]->data.ref[k].id = 0; - } else { - l = ranint(NCELLS); - pobj = getref(cells, l); - p[i]->data.ref[k].addr = pobj; - p[i]->data.ref[k].id = (pobj==NULL ? 0 : pobj->data.id); - } - commentif(BLAH, " ref %i -> %li", k, p[i]->data.ref[k].id); - } - break; - case 2: - commentif(BLAH, "%i: begin commit %li", i, p[i]->data.id); - ap[i]->init = ap[i]->alloc; - ap_state[i] = 3; - break; - case 3: - commentif(BLAH, "%i: end commit %li", i, p[i]->data.id); - q = p[i]; - if (ap[i]->limit != 0 || mps_ap_trip(ap[i], p[i], s[i])) { - l = ranint(NCELLS); - setref(cells, l, q); - commentif(BLAH, "%i -> %i", i, l); - } - ap_state[i] = 0; - break; - } - } - checkfrom(cells); - } - - comment("Finished main loop"); - - for (i=0; idata.tag = MCdata; - p[i]->data.numrefs = 0; - p[i]->data.size = s[i]; - case 2: - commentif(BLAH, "%i begin commit", i); - ap[i]->init = ap[i]->alloc; - case 3: - commentif(BLAH, "% end commit", i); - (void) (ap[i]->limit != 0 || mps_ap_trip(ap[i], p[i], s[i])); - } - mps_ap_destroy(ap[i]); - } - - mps_pool_destroy(pool); - comment("Destroyed pool."); - mps_chain_destroy(chain); - mps_fmt_destroy(format); - mps_root_destroy(root); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/120.c b/mps/qa/function/120.c deleted file mode 100644 index da9cb86c502..00000000000 --- a/mps/qa/function/120.c +++ /dev/null @@ -1,126 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = mps_arena_commit_limit tests - language = c - link = testlib.o -OUTPUT_SPEC - commit0 = FAIL - commit10 = OK - com_less = FAIL - commit_min = OK - alloc_mv = COMMIT_LIMIT - commit_ext = OK - alloc_16 = OK - alloc_big = RESOURCE - poolcr = COMMIT_LIMIT - result = pass -END_HEADER -*/ - -#include "testlib.h" -#include "mpsavm.h" -#include "mpscmv.h" - -void *stackpointer; - -mps_arena_t arena; -mps_thr_t thread; -mps_pool_t pool; -mps_pool_t pools[100]; - -static void test(void) { - int i; - mps_addr_t a; - mps_res_t res; - -/* create an arena that can't grow beyond 20 M */ - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t) (1024*1024*20)), - "create arena"); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - -/* set the commit limit to 0MB, then to 10MB+1 byte */ - - report_res("commit0", - mps_arena_commit_limit_set(arena, (size_t) (1024*1024*0))); - - report_res("commit10", - mps_arena_commit_limit_set(arena, (size_t) (1+1024*1024*10))); - -/* create a pool */ - - cdie(mps_pool_create(&pool, arena, mps_class_mv(), (size_t) 64, (size_t) 64, (size_t) 64), "pool create"); - - for (i=0; i<100; i++) { - die(mps_alloc(&a, pool, (size_t) 64), "alloc"); - } -/* shouldn't be possible to set the commit limit to less than the amount - currently commited */ - - report_res("com_less", - mps_arena_commit_limit_set(arena, mps_arena_committed(arena)-1)); - -/* should be possible to set the commit limit to the amount currently - committed */ - - report_res("commit_min", - mps_arena_commit_limit_set(arena, mps_arena_committed(arena))); - - for (i=0; i<100; i++) { - res=mps_alloc(&a, pool, (size_t) 1024); - } - - report_res("alloc_mv", res); - -/* extending the commit-limit by 64K should allow an allocation of 16K - to succeed */ - - report_res("commit_ext", - mps_arena_commit_limit_set(arena, - mps_arena_commit_limit(arena) + (size_t) (1024*64))); - - report_res("alloc_16", mps_alloc(&a, pool, (size_t) (1024*16))); - -/* a really big allocation should fail on the arena's address space size, - not the commit limit */ - - report_res("alloc_big", mps_alloc(&a, pool, (size_t) (1024*1024*30))); - - mps_pool_destroy(pool); - -/* now we'll check that creating a pool can fail on the COMMIT_LIMIT */ - - cdie(mps_arena_commit_limit_set(arena, mps_arena_committed(arena)), - "back to minimum limit"); - - res = MPS_RES_OK; - - i = 0; - - while ((i < 100) && (res == MPS_RES_OK)) { - res = mps_pool_create(&pools[i], arena, mps_class_mv(), (size_t) 64, (size_t) 64, (size_t) 64); - i++; - } - report_res("poolcr", res); - - for (i -= 2; i >= 0; i--) { - mps_pool_destroy(pools[i]); - } - - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena."); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/121.c b/mps/qa/function/121.c deleted file mode 100644 index e1710aec083..00000000000 --- a/mps/qa/function/121.c +++ /dev/null @@ -1,61 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!121.c(trunk.2) $ - summary = very small arenas - language = c - link = testlib.o -OUTPUT_SPEC - result = pass -END_HEADER -*/ - -#include "testlib.h" -#include "mpsavm.h" -#include "mpscmv.h" - - -void *stackpointer; - -mps_arena_t arena; -mps_thr_t thread; -mps_pool_t pool; -mps_pool_t pools[100]; - - -static void test(void) -{ - int i; - for (i = 64; i >= 0; i--) { - mps_res_t res; - - comment("Trying arena of %d kB.", i); - res = mps_arena_create(&arena, mps_arena_class_vm(), (size_t)(1024*i)); - if (res == MPS_RES_OK) { - res = mps_thread_reg(&thread, arena); - if (res == MPS_RES_OK) { - mps_thread_dereg(thread); - } else { - if (res != MPS_RES_MEMORY) { - error("Wrong error code, %d, for mps_thread_reg.", res); - } - } - mps_arena_destroy(arena); - } else { - report_res("arena_create", res); - if (res != MPS_RES_MEMORY) { - error("Wrong error code."); - } - } - } -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/122.c b/mps/qa/function/122.c deleted file mode 100644 index 3a375622b28..00000000000 --- a/mps/qa/function/122.c +++ /dev/null @@ -1,195 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!122.c(trunk.5) $ - summary = test of mps_arena_roots_walk - language = c - link = testlib.o rankfmt.o -OUTPUT_SPEC - count1 = 6 - countspec > 0 - result = pass -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "mpscawl.h" -#include "mpsavm.h" -#include "rankfmt.h" - - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - -#define MAGICSIZE (342) - - -void *stackpointer; -long int rootcount; -long int speccount; - -int oldstamp, newstamp; - -mps_space_t arena; -mps_pool_t poolamc, poollo, poolawl; -mps_thr_t thread; -mps_root_t root, root1; - -mps_fmt_t format; -mps_ap_t apamc, aplo, apawl; - -/* root is the stack root */ -/* root1, root2, table roots */ -mps_root_t root, root1, root2; - - -static void root_step(mps_addr_t* ref, mps_root_t r, void *V, size_t S) -{ - mycell *a; - mycell *spec; - - spec = (mycell *) V; - - asserts(S == MAGICSIZE, "VII. Size didn't get passed!"); - asserts((r == root || r == root1 || r == root2), "Root didn't get passed!"); - a = *ref; - comment("root: %p -> %p", ref, a); - rootcount++; - if (spec == a) { - speccount++; - } - if (r != root) { - asserts(((a->tag) & 0x3) == MCdata, - "spurious ref claimed in root at %p->%p", ref, a); - a->data.checkedflag = newstamp; - } -} - - -static void walkroots (mycell *a) -{ - mps_arena_park(arena); - mps_arena_roots_walk(arena, root_step, (mps_addr_t) a, MAGICSIZE); - mps_arena_release(arena); -} - - -/* a is a table of exact roots */ -/* b a table of ambig roots */ -mycell *a[4], *b[4]; - - -static void test(void) -{ - mps_chain_t chain; - mycell *w, *x, *y; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t) 1024*1024*30), - "create space"); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - cdie( - mps_root_create_table_masked(&root1, arena, MPS_RANK_EXACT, 0, - (mps_addr_t*)&a[0], 4, 0x4), - "create a root table"); - - cdie( - mps_root_create_table(&root2, arena, MPS_RANK_AMBIG, 0, (mps_addr_t*)&b[0], 4), - "create b root table"); - - cdie( - mps_fmt_create_A(&format, arena, &fmtA), - "create format"); - - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - die(mmqa_pool_create_chain(&poolamc, arena, mps_class_amc(), format, chain), - "create pool"); - - die(mmqa_pool_create_chain(&poollo, arena, mps_class_amcz(), format, chain), - "create pool"); - - cdie( - mps_pool_create(&poolawl, arena, mps_class_awl(), format), - "create pool"); - - cdie( - mps_ap_create(&apamc, poolamc, MPS_RANK_EXACT), - "create ap"); - - cdie( - mps_ap_create(&aplo, poollo, MPS_RANK_EXACT), - "create ap"); - - cdie( - mps_ap_create(&apawl, poolawl, MPS_RANK_EXACT), - "create ap"); - - newstamp = 0; - alloccomments = 1; - - die(allocrdumb(&a[0], aplo, 64, MPS_RANK_EXACT), "alloc"); - die(allocrdumb(&a[1], apamc, 64, MPS_RANK_EXACT), "alloc"); - die(allocrdumb(&a[3], apawl, 64, MPS_RANK_EXACT), "alloc"); - a[2] = (mycell *)((int)a[3] | 4); - - die(allocrdumb(&b[0], aplo, 64, MPS_RANK_EXACT), "alloc"); - die(allocrdumb(&b[1], apamc, 64, MPS_RANK_EXACT), "alloc"); - b[2] = NULL; - die(allocrdumb(&b[3], apawl, 64, MPS_RANK_EXACT), "alloc"); - - rootcount = 0; - walkroots(NULL); - report("count1", "%ld", rootcount); - - cdie(mps_root_create_reg(&root, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), "create stack root"); - - x = allocdumb(apamc, 64, MPS_RANK_EXACT); - y = allocdumb(apamc, 64, MPS_RANK_EXACT); - w = allocdumb(apamc, 64, MPS_RANK_EXACT); - rootcount = 0; - speccount = 0; - walkroots(x); - report("count2", "%ld", rootcount); - report("countspec", "%ld", speccount); - - mps_ap_destroy(apamc); - mps_ap_destroy(aplo); - mps_ap_destroy(apawl); - comment("Destroyed aps."); - - mps_pool_destroy(poolamc); - mps_pool_destroy(poollo); - mps_pool_destroy(poolawl); - comment("Destroyed pools."); - - mps_chain_destroy(chain); - - mps_fmt_destroy(format); - comment("Destroyed format."); - - mps_root_destroy(root2); - mps_root_destroy(root1); - mps_root_destroy(root); - comment("Destroyed roots."); - - mps_thread_dereg(thread); - comment("Deregistered thread."); - - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - report("result", "pass"); - return 0; -} diff --git a/mps/qa/function/123.c b/mps/qa/function/123.c deleted file mode 100644 index 778d6ad4863..00000000000 --- a/mps/qa/function/123.c +++ /dev/null @@ -1,115 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = regression test for AWl bug (request.dylan.160094 - language = c - link = testlib.o rankfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscawl.h" -#include "mpscamc.h" -#include "mpsavm.h" -#include "rankfmt.h" - -void *stackpointer; - -mycell *a, *b; - -static void test(void) -{ - mps_arena_t space; - mps_pool_t poolamc, poolawl; - mps_thr_t thread; - mps_root_t root, rootb; - - mps_fmt_t format; - mps_ap_t apamc, apawl; - - unsigned int i, c; - - cdie(mps_arena_create(&space, mps_arena_class_vm(), (size_t) (60ul*1024*1024)), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie(mps_root_create_table(&root, space, MPS_RANK_AMBIG, 0, &b, 1), - "creat root"); - - cdie(mps_root_create_table(&rootb, space, MPS_RANK_AMBIG, 0, &exfmt_root, 1), - "create root b"); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - cdie( - mps_pool_create(&poolamc, space, mps_class_amc(), format), - "create pool"); - - cdie( - mps_pool_create(&poolawl, space, mps_class_awl(), format), - "create pool"); - - cdie( - mps_ap_create(&apawl, poolawl, MPS_RANK_WEAK), - "create ap"); - - cdie( - mps_ap_create(&apamc, poolamc, MPS_RANK_EXACT), - "create ap"); - - formatcomments = 0; - - b = allocone(apamc, 1024, MPS_RANK_EXACT); - - c = mps_collections(space); - - for (i=1; i<100; i++) - { - comment("%i of 100.", i); - while (mps_collections(space) == c) { - a = allocone(apamc, 1024, MPS_RANK_EXACT); - if (ranint(5)) { - setref(a, 0, b); - } - b = a; - } - c = mps_collections(space); - a = allocone(apawl, 1, MPS_RANK_WEAK); - a->data.id = 0; - setref(a, 0, b); - } - - mps_ap_destroy(apawl); - mps_ap_destroy(apamc); - comment("Destroyed aps."); - - mps_pool_destroy(poolamc); - mps_pool_destroy(poolawl); - comment("Destroyed pools."); - - mps_fmt_destroy(format); - comment("Destroyed format."); - - mps_root_destroy(root); - mps_root_destroy(rootb); - comment("Destroyed roots."); - - mps_thread_dereg(thread); - comment("Deregistered thread."); - - mps_space_destroy(space); - comment("Destroyed space."); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/124.c b/mps/qa/function/124.c deleted file mode 100644 index a5b985edb1c..00000000000 --- a/mps/qa/function/124.c +++ /dev/null @@ -1,159 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!124.c(trunk.2) $ - summary = test of ramp allocation - language = c - link = testlib.o rankfmt.o -OUTPUT_SPEC - result = pass -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "mpsavm.h" -#include "rankfmt.h" - - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - -#define ARENALIMIT (200) - -#define TABSIZE (50000) -#define ENTERRAMP (30000) -#define LEAVERAMP (100000) - -#define BACKSIZE (128) -#define BACKITER (32) -#define RAMPSIZE (128) - -#define ITERATIONS (1000000ul) - -#define RAMP_INTERFACE -/* -#define COLLECT_WORLD -*/ - - -void *stackpointer; - -mps_space_t arena; -mps_pool_t poolamc; -mps_thr_t thread; -mps_root_t root, root1; - -mps_fmt_t format; -mps_ap_t apamc; - -static mps_addr_t objtab[TABSIZE]; - - -static void alloc_back(void) -{ - long int i, j; - - for (j = 0; j < BACKITER; j++) { - i = ranint(ranint(ranint(ranint(TABSIZE)+1)+1)+1); - objtab[i] = allocdumb(apamc, BACKSIZE, MPS_RANK_EXACT); - } -} - - -static void test(void) -{ - mps_chain_t chain; - long int i; - long int rsize = 0; - int inramp; - mycell *r, *s; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), - (size_t) 1024*1024*ARENALIMIT), - "create space"); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - cdie( - mps_root_create_reg(&root, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_root_create_table(&root1, arena, MPS_RANK_EXACT, 0, &objtab[0], TABSIZE), - "create root table"); - - cdie(mps_fmt_create_A(&format, arena, &fmtA), "create format"); - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - die(mmqa_pool_create_chain(&poolamc, arena, mps_class_amc(), format, chain), - "create pool(amc)"); - - cdie( - mps_ap_create(&apamc, poolamc, MPS_RANK_EXACT), - "create ap"); - - inramp = 0; - r = NULL; /* r is always initialized, because inramp=0 at the start, but */ - /* the compiler doesn't know this. */ - - for (i = 0; i < ITERATIONS; i++) { - if (i % 10000 == 0) { - comment("%ld of %ld", i, ITERATIONS); - } - alloc_back(); - if (inramp) { - s = allocone(apamc, 3, MPS_RANK_EXACT); - setref(r, 0, s); - setref(s, 1, r); - r = s; - s = allocdumb(apamc, RAMPSIZE, MPS_RANK_EXACT); - setref(r, 2, s); - rsize ++; - if (ranint(LEAVERAMP) == 0) { - r = allocone(apamc, 2, MPS_RANK_EXACT); - s = allocone(apamc, 2, MPS_RANK_EXACT); -#ifdef RAMP_INTERFACE - mps_ap_alloc_pattern_end(apamc, mps_alloc_pattern_ramp()); -#endif -#ifdef COLLECT_WORLD - mps_arena_collect(arena); - mps_arena_release(arena); -#endif - comment("ramp end, %ld objects", rsize); - inramp = 0; - } - } else { - if (ranint(ENTERRAMP) == 0) { -#ifdef RAMP_INTERFACE - mps_ap_alloc_pattern_begin(apamc, mps_alloc_pattern_ramp()); -#endif - comment("ramp begin"); - r = allocone(apamc, 3, MPS_RANK_EXACT); - inramp = 1; - rsize = 0; - } - } - } - - mps_ap_destroy(apamc); - mps_pool_destroy(poolamc); - mps_chain_destroy(chain); - mps_fmt_destroy(format); - mps_root_destroy(root1); - mps_root_destroy(root); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed space."); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - report("result", "pass"); - return 0; -} diff --git a/mps/qa/function/125.c b/mps/qa/function/125.c deleted file mode 100644 index 9dfdfe201ae..00000000000 --- a/mps/qa/function/125.c +++ /dev/null @@ -1,102 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!125.c(trunk.2) $ - summary = extensible arena test (small objects) - language = c - link = testlib.o rankfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "mpsavm.h" -#include "rankfmt.h" - - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - - -void *stackpointer; - - -static void test(void) -{ - mps_arena_t arena; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root, root1; - - mps_fmt_t format; - mps_chain_t chain; - mps_ap_t ap; - - mycell *a, *b; - - int j; - - /* create an arena that can't grow beyond 1 Mb */ - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t) (1024*1024*1)), - "create arena"); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - cdie(mps_root_create_reg(&root, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie(mps_root_create_table(&root1, arena, MPS_RANK_AMBIG, 0, - (mps_addr_t*)&exfmt_root, 1), - "create table root"); - - cdie(mps_fmt_create_A(&format, arena, &fmtA), - "create format"); - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - die(mmqa_pool_create_chain(&pool, arena, mps_class_amc(), format, chain), - "create pool"); - - cdie(mps_ap_create(&ap, pool, MPS_RANK_EXACT), - "create ap"); - - comment("ready"); - - b = allocone(ap, 2, MPS_RANK_EXACT); - - /* allocate lots of little objects */ - - while (mps_arena_committed(arena) < 1024ul*1024ul*20) { - comment("reserved %ld, committed %ld", - mps_arena_reserved(arena), mps_arena_committed(arena)); - for (j=0; j<10000; j++) { - a = allocone(ap, 2, MPS_RANK_EXACT); - setref(a, 0, b); - b = a; - a = allocone(ap, 1, MPS_RANK_EXACT); - setref(b, 1, a); - } - mps_arena_collect(arena); - } - - mps_ap_destroy(ap); - mps_pool_destroy(pool); - mps_chain_destroy(chain); - mps_fmt_destroy(format); - mps_root_destroy(root); - mps_root_destroy(root1); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/126.c b/mps/qa/function/126.c deleted file mode 100644 index 836bbf38303..00000000000 --- a/mps/qa/function/126.c +++ /dev/null @@ -1,104 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!126.c(trunk.2) $ - summary = extensible arena test (huge objects) - language = c - link = testlib.o rankfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "mpsavm.h" -#include "rankfmt.h" - - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - - -void *stackpointer; - - -static void test(void) -{ - mps_arena_t arena; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root, root1; - - mps_fmt_t format; - mps_chain_t chain; - mps_ap_t ap; - - mycell *b; - - /* create an arena that can't grow beyond 1 Mb */ - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t) (1024*1024*1)), - "create arena"); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - cdie(mps_root_create_reg(&root, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie(mps_root_create_table(&root1, arena, MPS_RANK_AMBIG, 0, - (mps_addr_t*)&exfmt_root, 1), - "create table root"); - - cdie(mps_fmt_create_A(&format, arena, &fmtA), - "create format"); - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - die(mmqa_pool_create_chain(&pool, arena, mps_class_amc(), format, chain), - "create pool"); - - cdie(mps_ap_create(&ap, pool, MPS_RANK_EXACT), - "create ap"); - - comment("ready"); - - comment("reserved %ld, committed %ld", - mps_arena_reserved(arena), mps_arena_committed(arena)); - - b = allocdumb(ap, 1024ul*1024ul*40, MPS_RANK_EXACT); - comment("alloc 40 MB"); - - comment("reserved %ld, committed %ld", - mps_arena_reserved(arena), mps_arena_committed(arena)); - - b = allocdumb(ap, 1024ul*1024ul*40, MPS_RANK_EXACT); - comment("alloc 80 MB"); - - comment("reserved %ld, committed %ld", - mps_arena_reserved(arena), mps_arena_committed(arena)); - - mps_arena_collect(arena); - comment("collected"); - - comment("reserved %ld, committed %ld", - mps_arena_reserved(arena), mps_arena_committed(arena)); - - mps_ap_destroy(ap); - mps_pool_destroy(pool); - mps_chain_destroy(chain); - mps_fmt_destroy(format); - mps_root_destroy(root); - mps_root_destroy(root1); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/127.c b/mps/qa/function/127.c deleted file mode 100644 index 5b6d8b73c24..00000000000 --- a/mps/qa/function/127.c +++ /dev/null @@ -1,160 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = test of ramp allocation -- with collect world instead of ramps - language = c - link = testlib.o rankfmt.o -OUTPUT_SPEC - result = pass -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "mpsavm.h" -#include "rankfmt.h" - -#define ARENALIMIT (200) - -#define TABSIZE (50000) -#define ENTERRAMP (30000) -#define LEAVERAMP (100000) - -#define BACKSIZE (128) -#define BACKITER (32) -#define RAMPSIZE (128) - -#define ITERATIONS (1000000ul) - -/* -#define RAMP_INTERFACE -*/ -#define COLLECT_WORLD - -void *stackpointer; - -mps_space_t arena; -mps_pool_t poolamc; -mps_thr_t thread; -mps_root_t root, root1; - -mps_fmt_t format; -mps_ap_t apamc; - -static mps_addr_t objtab[TABSIZE]; - -static void alloc_back(void) { - long int i, j; - - for (j = 0; j < BACKITER; j++) { - i = ranint(ranint(ranint(ranint(TABSIZE)+1)+1)+1); - objtab[i] = allocdumb(apamc, BACKSIZE, MPS_RANK_EXACT); - } -} - - -static void test(void) { - long int i; - long int rsize; - - int inramp; - - mycell *r, *s; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), - (size_t) 1024*1024*ARENALIMIT), - "create space"); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie( - mps_root_create_reg(&root, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_root_create_table(&root1, arena, MPS_RANK_EXACT, 0, &objtab[0], TABSIZE), - "create root table"); - - cdie( - mps_fmt_create_A(&format, arena, &fmtA), - "create format"); - - cdie( - mps_pool_create(&poolamc, arena, mps_class_amc(), format), - "create pool"); - - cdie( - mps_ap_create(&apamc, poolamc, MPS_RANK_EXACT), - "create ap"); - - inramp = 0; - - for (i = 0; i < ITERATIONS; i++) { - if (i % 10000 == 0) { - comment("%ld of %ld", i, ITERATIONS); - } - alloc_back(); - if (inramp) { - s = allocone(apamc, 3, MPS_RANK_EXACT); - setref(r, 0, s); - setref(s, 1, r); - r = s; - s = allocdumb(apamc, RAMPSIZE, MPS_RANK_EXACT); - setref(r, 2, s); - rsize ++; - if (ranint(LEAVERAMP) == 0) { - r = allocone(apamc, 2, MPS_RANK_EXACT); - s = allocone(apamc, 2, MPS_RANK_EXACT); -#ifdef RAMP_INTERFACE - mps_ap_alloc_pattern_end(apamc, mps_alloc_pattern_ramp()); -#endif -#ifdef COLLECT_WORLD - mps_arena_collect(arena); - mps_arena_release(arena); -#endif - comment("ramp end, %ld objects", rsize); - inramp = 0; - } - } else { - if (ranint(ENTERRAMP) == 0) { -#ifdef RAMP_INTERFACE - mps_ap_alloc_pattern_begin(apamc, mps_alloc_pattern_ramp()); -#endif - comment("ramp begin"); - r = allocone(apamc, 3, MPS_RANK_EXACT); - inramp = 1; - rsize = 0; - } - } - } - - mps_ap_destroy(apamc); - comment("Destroyed ap."); - - mps_pool_destroy(poolamc); - comment("Destroyed pool."); - - mps_fmt_destroy(format); - comment("Destroyed format."); - - mps_root_destroy(root1); - mps_root_destroy(root); - comment("Destroyed roots."); - - mps_thread_dereg(thread); - comment("Deregistered thread."); - - mps_arena_destroy(arena); - comment("Destroyed space."); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - report("result", "pass"); - return 0; -} diff --git a/mps/qa/function/128.c b/mps/qa/function/128.c deleted file mode 100644 index 2bc0eb1fafb..00000000000 --- a/mps/qa/function/128.c +++ /dev/null @@ -1,160 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = test of ramp allocation -- no collect world or ramps - language = c - link = testlib.o rankfmt.o -OUTPUT_SPEC - result = pass -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "mpsavm.h" -#include "rankfmt.h" - -#define ARENALIMIT (200) - -#define TABSIZE (50000) -#define ENTERRAMP (30000) -#define LEAVERAMP (100000) - -#define BACKSIZE (128) -#define BACKITER (32) -#define RAMPSIZE (128) - -#define ITERATIONS (1000000ul) - -/* -#define RAMP_INTERFACE -#define COLLECT_WORLD -*/ - -void *stackpointer; - -mps_space_t arena; -mps_pool_t poolamc; -mps_thr_t thread; -mps_root_t root, root1; - -mps_fmt_t format; -mps_ap_t apamc; - -static mps_addr_t objtab[TABSIZE]; - -static void alloc_back(void) { - long int i, j; - - for (j = 0; j < BACKITER; j++) { - i = ranint(ranint(ranint(ranint(TABSIZE)+1)+1)+1); - objtab[i] = allocdumb(apamc, BACKSIZE, MPS_RANK_EXACT); - } -} - - -static void test(void) { - long int i; - long int rsize; - - int inramp; - - mycell *r, *s; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), - (size_t) 1024*1024*ARENALIMIT), - "create space"); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie( - mps_root_create_reg(&root, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_root_create_table(&root1, arena, MPS_RANK_EXACT, 0, &objtab[0], TABSIZE), - "create root table"); - - cdie( - mps_fmt_create_A(&format, arena, &fmtA), - "create format"); - - cdie( - mps_pool_create(&poolamc, arena, mps_class_amc(), format), - "create pool"); - - cdie( - mps_ap_create(&apamc, poolamc, MPS_RANK_EXACT), - "create ap"); - - inramp = 0; - - for (i = 0; i < ITERATIONS; i++) { - if (i % 10000 == 0) { - comment("%ld of %ld", i, ITERATIONS); - } - alloc_back(); - if (inramp) { - s = allocone(apamc, 3, MPS_RANK_EXACT); - setref(r, 0, s); - setref(s, 1, r); - r = s; - s = allocdumb(apamc, RAMPSIZE, MPS_RANK_EXACT); - setref(r, 2, s); - rsize ++; - if (ranint(LEAVERAMP) == 0) { - r = allocone(apamc, 2, MPS_RANK_EXACT); - s = allocone(apamc, 2, MPS_RANK_EXACT); -#ifdef RAMP_INTERFACE - mps_ap_alloc_pattern_end(apamc, mps_alloc_pattern_ramp()); -#endif -#ifdef COLLECT_WORLD - mps_arena_collect(arena); - mps_arena_release(arena); -#endif - comment("ramp end, %ld objects", rsize); - inramp = 0; - } - } else { - if (ranint(ENTERRAMP) == 0) { -#ifdef RAMP_INTERFACE - mps_ap_alloc_pattern_begin(apamc, mps_alloc_pattern_ramp()); -#endif - comment("ramp begin"); - r = allocone(apamc, 3, MPS_RANK_EXACT); - inramp = 1; - rsize = 0; - } - } - } - - mps_ap_destroy(apamc); - comment("Destroyed ap."); - - mps_pool_destroy(poolamc); - comment("Destroyed pool."); - - mps_fmt_destroy(format); - comment("Destroyed format."); - - mps_root_destroy(root1); - mps_root_destroy(root); - comment("Destroyed roots."); - - mps_thread_dereg(thread); - comment("Deregistered thread."); - - mps_arena_destroy(arena); - comment("Destroyed space."); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - report("result", "pass"); - return 0; -} diff --git a/mps/qa/function/129.c b/mps/qa/function/129.c deleted file mode 100644 index a6ebc663b53..00000000000 --- a/mps/qa/function/129.c +++ /dev/null @@ -1,160 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!129.c(trunk.2) $ - summary = test of ramp allocation with small arena - language = c - link = testlib.o rankfmt.o -OUTPUT_SPEC - result = pass -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "mpsavm.h" -#include "rankfmt.h" - -#define ARENALIMIT (2) - -#define TABSIZE (50000) -#define ENTERRAMP (30000) -#define LEAVERAMP (100000) - -#define BACKSIZE (128) -#define BACKITER (32) -#define RAMPSIZE (128) - -#define ITERATIONS (1000000ul) - -#define RAMP_INTERFACE -/* -#define COLLECT_WORLD -*/ - -void *stackpointer; - -mps_space_t arena; -mps_pool_t poolamc; -mps_thr_t thread; -mps_root_t root, root1; - -mps_fmt_t format; -mps_ap_t apamc; - -static mps_addr_t objtab[TABSIZE]; - - -static void alloc_back(void) { - long int i, j; - - for (j = 0; j < BACKITER; j++) { - i = ranint(ranint(ranint(ranint(TABSIZE)+1)+1)+1); - objtab[i] = allocdumb(apamc, BACKSIZE, MPS_RANK_EXACT); - } -} - - -static void test(void) { - long int i; - long int rsize = 0; - int inramp; - mycell *r = NULL, *s; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), - (size_t) 1024*1024*ARENALIMIT), - "create space"); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie( - mps_root_create_reg(&root, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_root_create_table(&root1, arena, MPS_RANK_EXACT, 0, &objtab[0], TABSIZE), - "create root table"); - - cdie( - mps_fmt_create_A(&format, arena, &fmtA), - "create format"); - - cdie( - mps_pool_create(&poolamc, arena, mps_class_amc(), format), - "create pool"); - - cdie( - mps_ap_create(&apamc, poolamc, MPS_RANK_EXACT), - "create ap"); - - inramp = 0; - - for (i = 0; i < ITERATIONS; i++) { - if (i % 10000 == 0) { - comment("%ld of %ld", i, ITERATIONS); - } - alloc_back(); - if (inramp) { - s = allocone(apamc, 3, MPS_RANK_EXACT); - setref(r, 0, s); - setref(s, 1, r); - r = s; - s = allocdumb(apamc, RAMPSIZE, MPS_RANK_EXACT); - setref(r, 2, s); - rsize ++; - if (ranint(LEAVERAMP) == 0) { - r = allocone(apamc, 2, MPS_RANK_EXACT); - s = allocone(apamc, 2, MPS_RANK_EXACT); -#ifdef RAMP_INTERFACE - mps_ap_alloc_pattern_end(apamc, mps_alloc_pattern_ramp()); -#endif -#ifdef COLLECT_WORLD - mps_arena_collect(arena); - mps_arena_release(arena); -#endif - comment("ramp end, %ld objects", rsize); - inramp = 0; - } - } else { - if (ranint(ENTERRAMP) == 0) { -#ifdef RAMP_INTERFACE - mps_ap_alloc_pattern_begin(apamc, mps_alloc_pattern_ramp()); -#endif - comment("ramp begin"); - r = allocone(apamc, 3, MPS_RANK_EXACT); - inramp = 1; - rsize = 0; - } - } - } - - mps_ap_destroy(apamc); - comment("Destroyed ap."); - - mps_pool_destroy(poolamc); - comment("Destroyed pool."); - - mps_fmt_destroy(format); - comment("Destroyed format."); - - mps_root_destroy(root1); - mps_root_destroy(root); - comment("Destroyed roots."); - - mps_thread_dereg(thread); - comment("Deregistered thread."); - - mps_arena_destroy(arena); - comment("Destroyed space."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - report("result", "pass"); - return 0; -} diff --git a/mps/qa/function/12p.c b/mps/qa/function/12p.c deleted file mode 100644 index 6a0373fecfb..00000000000 --- a/mps/qa/function/12p.c +++ /dev/null @@ -1,215 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = lots of APs with interleaved reserve and 2-stage commit - language = c - link = testlib.o newfmt.o -END_HEADER -*/ - -/* - This test needs some explanation. The object 'cells' contains - NCELL references to other objects. NAPS allocation points - are created. At each step, we choose one and nudge it on - a little. Each allocation point goes through the following - cycle of steps: reserve, init, begin commit, end commit. - At the init step, each reference in the reserved object is - set to point randomly to one of the objects referenced by - cells or (with probability PNULL) to NULL. If commit fails, - the object is thrown away. If it succeeds, it is written into - a random reference in cells. Repeat. - - Because it has to deal directly with reserve and commit, - this test can't use the nice functions provided by newfmt - all the time. -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "newfmt.h" - -void *stackpointer; - -#define NCELLS 100 -#define NAPS 100 -#define PNULL (ranint(100)<25) -#define NUMREFS (ranint(20)) -#define BLAH 0 - -mps_ap_t ap[NAPS]; -size_t s[NAPS]; -int nrefs[NAPS]; -int ap_state[NAPS]; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mycell *cells; - - int h,i,j,k,l; - mycell *p[NAPS]; - mycell *pobj; - size_t bytes; - size_t alignment; - mps_addr_t q; - int nextid = 0x1000000; - -/* turn on comments about copying and scanning */ - formatcomments = BLAH; - fixcomments = BLAH; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - cdie( - mps_pool_create(&pool, space, mps_class_amc(), format), - "create pool"); - - for (i=0; idata.tag = 0xD033E2A6; - p[i]->data.id = nextid; - ap_state[i] = 1; - commentif(BLAH, "%i: reserve %li at %p", i, nextid, q); - nextid +=1; - break; - case 1: - commentif(BLAH, "%i: init %li", i, p[i]->data.id); - p[i]->data.tag = MCdata; - p[i]->data.numrefs = nrefs[i]; - p[i]->data.size = s[i]; - ap_state[i] = 2; - for (k=0; kdata.ref[k].addr = NULL; - p[i]->data.ref[k].id = 0; - } - else - { - l = ranint(NCELLS); - pobj = getref(cells, l); - p[i]->data.ref[k].addr = pobj; - p[i]->data.ref[k].id = (pobj==NULL ? 0 : pobj->data.id); - } - commentif(BLAH, " ref %i -> %li", k, p[i]->data.ref[k].id); - } - break; - case 2: - commentif(BLAH, "%i: begin commit %li", i, p[i]->data.id); - ap[i]->init = ap[i]->alloc; - ap_state[i] = 3; - break; - case 3: case 4: case 5: case 6: case 7: case 8: case 9: - ap_state[i]+=1; - break; - case 10: - commentif(BLAH, "%i: end commit %li", i, p[i]->data.id); - q=p[i]; - if (ap[i]->limit != 0 || mps_ap_trip(ap[i], p[i], s[i])) - { - l = ranint(NCELLS); - setref(cells, l, q); - commentif(BLAH, "%i -> %i", i, l); - } - ap_state[i] = 0; - break; - } - } - checkfrom(cells); - } - - comment("Finished main loop"); - - for (i=0; idata.tag = MCdata; - p[i]->data.numrefs = 0; - p[i]->data.size = s[i]; - case 2: - commentif(BLAH, "%i begin commit", i); - ap[i]->init = ap[i]->alloc; - case 3: - commentif(BLAH, "% end commit", i); - (void) (ap[i]->limit != 0 || mps_ap_trip(ap[i], p[i], s[i])); - } - mps_ap_destroy(ap[i]); - } - - mps_pool_destroy(pool); - comment("Destroyed pool."); - - mps_fmt_destroy(format); - comment("Destroyed format."); - - mps_root_destroy(root); - comment("Destroyed root."); - - mps_thread_dereg(thread); - comment("Deregistered thread."); - - mps_space_destroy(space); - comment("Destroyed space."); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/13.c b/mps/qa/function/13.c deleted file mode 100644 index 0b1cbc5e574..00000000000 --- a/mps/qa/function/13.c +++ /dev/null @@ -1,211 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = interleaved APs (like 12, but produce comments for debugging) - language = c - link = testlib.o newfmt.o -END_HEADER -*/ - -/* - This test needs some explanation. The object 'cells' contains - NCELL references to other objects. NAPS allocation points - are created. At each step, we choose one and nudge it on - a little. Each allocation point goes through the following - cycle of steps: reserve, init, begin commit, end commit. - At the init step, each reference in the reserved object is - set to point randomly to one of the objects referenced by - cells or (with probability PNULL) to NULL. If commit fails, - the object is thrown away. If it succeeds, it is written into - a random reference in cells. Repeat. - - Because it has to deal directly with reserve and commit, - this test can't use the nice functions provided by newfmt - all the time. -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "newfmt.h" - -void *stackpointer; - -#define NCELLS 100 -#define NAPS 100 -#define PNULL (ranint(100)<25) -#define NUMREFS (ranint(20)) -#define BLAH 1 - -mps_ap_t ap[NAPS]; -mycell *p[NAPS]; -size_t s[NAPS]; -int nrefs[NAPS]; -int ap_state[NAPS]; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mycell *cells; - - int h,i,j,k,l; - mycell *pobj; - size_t bytes; - size_t alignment; - mps_addr_t q; - int nextid = 0x1000000; - -/* turn on comments about copying and scanning */ - formatcomments = BLAH; - fixcomments = BLAH; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - cdie( - mps_pool_create(&pool, space, mps_class_amc(), format), - "create pool"); - - for (i=0; idata.tag = 0xD033E2A6; - p[i]->data.id = nextid; - ap_state[i] = 1; - commentif(BLAH, "%i: reserve %li at %p", i, nextid, q); - nextid +=1; - break; - case 1: - commentif(BLAH, "%i: init %li", i, p[i]->data.id); - p[i]->data.tag = MCdata; - p[i]->data.numrefs = nrefs[i]; - p[i]->data.size = s[i]; - ap_state[i] = 2; - for (k=0; kdata.ref[k].addr = NULL; - p[i]->data.ref[k].id = 0; - } - else - { - l = ranint(NCELLS); - pobj = getref(cells, l); - p[i]->data.ref[k].addr = pobj; - p[i]->data.ref[k].id = (pobj==NULL ? 0 : pobj->data.id); - } - commentif(BLAH, " ref %i -> %li", k, p[i]->data.ref[k].id); - } - break; - case 2: - commentif(BLAH, "%i: begin commit %li", i, p[i]->data.id); - ap[i]->init = ap[i]->alloc; - ap_state[i] = 3; - break; - case 3: - commentif(BLAH, "%i: end commit %li", i, p[i]->data.id); - q=p[i]; - if (ap[i]->limit != 0 || mps_ap_trip(ap[i], p[i], s[i])) - { - l = ranint(NCELLS); - setref(cells, l, q); - commentif(BLAH, "succeeded %i -> %i", i, l); - } - ap_state[i] = 0; - break; - } - } - checkfrom(cells); - } - - commentif(BLAH, "Finished main loop"); - - for (i=0; idata.tag = MCdata; - p[i]->data.numrefs = 0; - p[i]->data.size = s[i]; - case 2: - commentif(BLAH, "%i begin commit", i); - ap[i]->init = ap[i]->alloc; - case 3: - commentif(BLAH, "% end commit", i); - (void) (ap[i]->limit != 0 || mps_ap_trip(ap[i], p[i], s[i])); - } - mps_ap_destroy(ap[i]); - } - - mps_pool_destroy(pool); - comment("Destroyed pool."); - - mps_fmt_destroy(format); - comment("Destroyed format."); - - mps_root_destroy(root); - comment("Destroyed root."); - - mps_thread_dereg(thread); - comment("Deregistered thread."); - - mps_space_destroy(space); - comment("Destroyed space."); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/130.c b/mps/qa/function/130.c deleted file mode 100644 index f596151ac9c..00000000000 --- a/mps/qa/function/130.c +++ /dev/null @@ -1,117 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!130.c(trunk.2) $ - summary = allocation shouldn't fail if there's garbage to collect (2) - language = c - link = testlib.o rankfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "mpsavm.h" -#include "rankfmt.h" - - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - - -void *stackpointer; - -mps_pool_t poolmv; -mps_arena_t arena; - - -static void test(void) -{ - mps_pool_t pool; - mps_thr_t thread; - - mps_root_t root; - - mps_fmt_t format; - mps_chain_t chain; - mps_ap_t ap, ap2; - - mycell *a, *b; - - mps_res_t res; - int i; - - /* create an arena that can't grow beyond 30 M */ - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t) (1024*1024*30)), - "create arena"); - mps_arena_commit_limit_set(arena, (size_t) (1024*1024*40)); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - cdie(mps_root_create_reg(&root, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie(mps_fmt_create_A(&format, arena, &fmtA), - "create format"); - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - die(mmqa_pool_create_chain(&pool, arena, mps_class_amc(), format, chain), - "create pool"); - - cdie(mps_ap_create(&ap, pool, MPS_RANK_EXACT), - "create ap"); - - /* allocate until full */ - - i = 0; - b = NULL; - - while (allocrone(&a, ap, 128, MPS_RANK_EXACT) == MPS_RES_OK) { - i++; - setref(a, 0, b); - b = a; - } - - comment("%d objs allocated.", i); - report("committed", "%ld", mps_arena_committed(arena)); - - /* try to allocate 10 times */ - - cdie(mps_ap_create(&ap2, pool, MPS_RANK_EXACT), "create second ap"); - mps_ap_destroy(ap); - - for (i = 0; i < 10; i++) { - res = allocrone(&a, ap2, 128, MPS_RANK_EXACT); - report("predie", "%s", err_text(res)); - } - - /* now let everything die, and try to allocate 10 times */ - - mps_root_destroy(root); - - for (i = 0; i < 10; i++) { - res = allocrone(&a, ap2, 128, MPS_RANK_EXACT); - report("postdie", "%s", err_text(res)); - } - - die(allocrone(&a, ap2, 128, MPS_RANK_EXACT), "alloc failed"); - - mps_ap_destroy(ap2); - mps_pool_destroy(pool); - mps_chain_destroy(chain); - mps_fmt_destroy(format); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/131.c b/mps/qa/function/131.c deleted file mode 100644 index 0979b5f8637..00000000000 --- a/mps/qa/function/131.c +++ /dev/null @@ -1,122 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!131.c(trunk.4) $ - summary = allocation shouldn't fail if there's garbage to collect (2) - language = c - link = testlib.o rankfmt.o - harness = 2.0 -OUTPUT_SPEC - predie = COMMIT_LIMIT - postdie = OK - completed = yes -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "mpsavm.h" -#include "rankfmt.h" - - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - - -void *stackpointer; - -mps_pool_t poolmv; -mps_arena_t arena; - - -static void test(void) -{ - mps_pool_t pool; - mps_thr_t thread; - - mps_root_t root; - - mps_fmt_t format; - mps_chain_t chain; - mps_ap_t ap, ap2; - - mycell *a, *b; - - mps_res_t res; - int i; - - /* create an arena that can't grow beyond 30 M */ - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t) (1024*1024*40)), - "create arena"); - mps_arena_commit_limit_set(arena, (size_t) (1024*1024*30)); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - cdie(mps_root_create_reg(&root, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(&format, arena, &fmtA), - "create format"); - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - die(mmqa_pool_create_chain(&pool, arena, mps_class_amc(), format, chain), - "create pool"); - - cdie( - mps_ap_create(&ap, pool, MPS_RANK_EXACT), - "create ap"); - - /* allocate until full */ - - i = 0; - b = NULL; - - while (allocrone(&a, ap, 128, MPS_RANK_EXACT) == MPS_RES_OK) { - i++; - setref(a, 0, b); - b = a; - } - - comment("%d objs allocated.", i); - report("committed", "%ld", mps_arena_committed(arena)); - - /* try to allocate 10 times */ - - cdie(mps_ap_create(&ap2, pool, MPS_RANK_EXACT), "create second ap"); - mps_ap_destroy(ap); - - for (i = 0; i < 10; i++) { - res = allocrone(&a, ap2, 128, MPS_RANK_EXACT); - report("predie", "%s", err_text(res)); - } - - /* now let everything die, and try to allocate 10 times */ - - mps_root_destroy(root); - - for (i = 0; i < 10; i++) { - res = allocrone(&a, ap2, 128, MPS_RANK_EXACT); - report("postdie", "%s", err_text(res)); - } - - mps_ap_destroy(ap2); - mps_pool_destroy(pool); - mps_chain_destroy(chain); - mps_fmt_destroy(format); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/132.c b/mps/qa/function/132.c deleted file mode 100644 index 5fe94a0dbfb..00000000000 --- a/mps/qa/function/132.c +++ /dev/null @@ -1,187 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!132.c(trunk.6) $ - summary = low-memory reservoir tests with commit limit, part I - language = c - harness = 2.1 - link = testlib.o rankfmt.o -OUTPUT_SPEC - lim0 = 0 - avail0 = 0 - lim1 > 5000000 - lim1 < 6000000 - deficit1 = 0 - lim2 > 1045 - lim2 < 32768 - deficit2 = 0 - deficit3 > 8000000 - spill3 <= 0 - spill4 <= 0 - grow4 > 500000 - allocfail < 20 - failres = COMMIT_LIMIT - spill5 <= 0 - grow5 = 0 - avail5 > 1500000 - allocfail2 > 10000 - failres2 = MEMORY - shrink6 > 1000000 - spill6 <= 0 - completed = yes -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "mpsavm.h" -#include "rankfmt.h" - - -#define ARENA_SIZE ((size_t) 1024*1024*30) - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - - -void *stackpointer; - - -static void test(void) -{ - mps_arena_t arena; - mps_pool_t poolamc; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_chain_t chain; - mps_ap_t apamc; - - mycell *p, *q; - int i; - mps_res_t res; - size_t lim0, avail0, lim1, avail1, commit1, lim2, avail2, commit2; - size_t lim3, avail3, commit3, lim4, avail4, commit4; - size_t lim5, avail5, commit5, lim6, avail6, commit6; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), ARENA_SIZE), - "create arena"); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - cdie(mps_root_create_reg(&root, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create stack root"); - - cdie(mps_fmt_create_A(&format, arena, &fmtA), "create format"); - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - die(mmqa_pool_create_chain(&poolamc, arena, mps_class_amc(), format, chain), - "create pool"); - - cdie( - mps_ap_create(&apamc, poolamc, MPS_RANK_EXACT), - "create ap"); - - report("lim0", "%d", lim0 = mps_reservoir_limit(arena)); - report("avail0", "%d", avail0 = mps_reservoir_available(arena)); - mps_reservoir_limit_set(arena, (size_t) 0); - - mps_reservoir_limit_set(arena, (size_t) (5ul*1024*1024)); - report("lim1", "%d", lim1 = mps_reservoir_limit(arena)); - report("avail1", "%d", avail1 = mps_reservoir_available(arena)); - report("commit1", "%d", commit1 = arena_committed_and_used(arena)); - report("deficit1", "%d", lim1-avail1); - - mps_reservoir_limit_set(arena, (size_t) (1045)); - report("lim2", "%d", lim2 = mps_reservoir_limit(arena)); - report("avail2", "%d", avail2 = mps_reservoir_available(arena)); - report("commit2", "%d", commit2 = arena_committed_and_used(arena)); - report("deficit2", "%d", lim2-avail2); - - /* set commit limit to whatever is currently committed plus 1 MB */ - - mps_arena_commit_limit_set(arena, arena_committed_and_used(arena)+1024*1024); - mps_reservoir_limit_set(arena, (size_t) (10ul*1024*1024)); - report("lim3", "%d", lim3 = mps_reservoir_limit(arena)); - report("avail3", "%d", avail3 = mps_reservoir_available(arena)); - report("commit3", "%d", commit3 = arena_committed_and_used(arena)); - report("deficit3", "%d", lim3-avail3); - report("spill3", "%d", commit3-mps_arena_commit_limit(arena)); - - /* now raise it by 1/2 MB -- reservoir should grow */ - - mps_arena_commit_limit_set(arena, arena_committed_and_used(arena)+512*1024); - report("lim4", "%d", lim4 = mps_reservoir_limit(arena)); - report("avail4", "%d", avail4 = mps_reservoir_available(arena)); - report("commit4", "%d", commit4 = arena_committed_and_used(arena)); - report("grow4", "%d", avail4-avail3); - report("spill4", "%d", commit4-mps_arena_commit_limit(arena)); - - /* try some allocation -- more than a small amount should fail */ - - i = -1; - p = NULL; - res = MPS_RES_OK; - while (res == MPS_RES_OK) { - res = allocrone(&q, apamc, 10, MPS_RANK_EXACT); - if (res == MPS_RES_OK) { - setref(q, 0, p); - p = q; - } - i++; - } - report("allocfail", "%d", i); - report_res("failres", res); - - /* available shouldn't have changed since before allocation */ - - report("lim5", "%d", lim5 = mps_reservoir_limit(arena)); - report("avail5", "%d", avail5 = mps_reservoir_available(arena)); - report("commit5", "%d", commit5 = arena_committed_and_used(arena)); - report("grow5", "%d", avail5-avail4); - report("spill5", "%d", commit5-mps_arena_commit_limit(arena)); - - /* try some allocation from reservoir -- not much should fail */ - - i = -1; - res = MPS_RES_OK; - while (res == MPS_RES_OK) { - res = reservoir_allocrone(&q, apamc, 10, MPS_RANK_EXACT); - if (res == MPS_RES_OK) { - setref(q, 0, p); - p = q; - } - i++; - } - report("allocfail2", "%d", i); - report_res("failres2", res); - - /* available should have changed now */ - - report("lim6", "%d", lim6 = mps_reservoir_limit(arena)); - report("avail6", "%d", avail6 = mps_reservoir_available(arena)); - report("commit6", "%d", commit6 = arena_committed_and_used(arena)); - report("spill6", "%d", commit6-mps_arena_commit_limit(arena)); - report("shrink6", "%d", avail5-avail6); - - mps_root_destroy(root); - mps_ap_destroy(apamc); - mps_pool_destroy(poolamc); - mps_fmt_destroy(format); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - report("completed", "yes"); - return 0; -} diff --git a/mps/qa/function/133.c b/mps/qa/function/133.c deleted file mode 100644 index a381d3797ac..00000000000 --- a/mps/qa/function/133.c +++ /dev/null @@ -1,139 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = low-memory reservoir tests with commit limit, part II - language = c - link = testlib.o rankfmt.o -OUTPUT_SPEC - allocfail3 > 8000 - failres3 = COMMIT_LIMIT - spill8 <= 0 - spill9 <= 0 - grow9 > 1000000 -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "mpsavm.h" -#include "rankfmt.h" - -#define ARENA_SIZE ((size_t) 1024*1024*30) - -void *stackpointer; - -mps_space_t arena; -mps_pool_t poolamc; -mps_pool_t poolmv; -mps_thr_t thread; -mps_root_t root; - -mps_fmt_t format; -mps_ap_t apamc; - -mps_root_t root; - -static void test(void) { - - mycell *p, *q; - int i; - mps_res_t res; - size_t lim7, avail7, commit7, lim8, avail8, commit8; - size_t lim9, avail9, commit9; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), ARENA_SIZE), - "create space"); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie(mps_root_create_reg(&root, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), "create stack root"); - - cdie( - mps_fmt_create_A(&format, arena, &fmtA), - "create format"); - - cdie( - mps_pool_create(&poolamc, arena, mps_class_amc(), format), - "create pool"); - - cdie( - mps_ap_create(&apamc, poolamc, MPS_RANK_EXACT), - "create ap"); - - mps_arena_commit_limit_set(arena, mps_arena_committed(arena)+1024*1024); - - mps_reservoir_limit_set(arena, 0); - report("lim7", "%d", lim7 = mps_reservoir_limit(arena)); - report("avail7", "%d", avail7 = mps_reservoir_available(arena)); - report("commit7", "%d", commit7 = mps_arena_committed(arena)); - -/* available should be zero, but should be able to allocate with - reservoir permit, until commit_limit is reached -*/ - - i = -1; - p = NULL; - res = MPS_RES_OK; - while (res == MPS_RES_OK) { - res = reservoir_allocrone(&q, apamc, 10, MPS_RANK_EXACT); - if (res == MPS_RES_OK) { - setref(q, 0, p); - p = q; - } - i++; - } - report("allocfail3", "%d", i); - report_res("failres3", res); - -/* should be none left to make available */ - - mps_reservoir_limit_set(arena, 10ul*1024*1024); - report("lim8", "%d", lim8 = mps_reservoir_limit(arena)); - report("avail8", "%d", avail8 = mps_reservoir_available(arena)); - report("commit8", "%d", commit8 = mps_arena_committed(arena)); - report("spill8", "%d", commit8-mps_arena_commit_limit(arena)); - -/* throw away objects and collect world */ - - p = NULL; - q = NULL; - mps_root_destroy(root); - mps_arena_collect(arena); - -/* available should have gone up now */ - - report("lim9", "%d", lim9 = mps_reservoir_limit(arena)); - report("avail9", "%d", avail9 = mps_reservoir_available(arena)); - report("commit9", "%d", commit9 = mps_arena_committed(arena)); - report("grow9", "%d", avail9-avail8); - report("spill9", "%d", commit9-mps_arena_commit_limit(arena)); - -/* destroy everything remaining -*/ - - mps_ap_destroy(apamc); - comment("Destroyed ap."); - - mps_pool_destroy(poolamc); - comment("Destroyed pool."); - - mps_fmt_destroy(format); - comment("Destroyed format."); - - mps_thread_dereg(thread); - comment("Deregistered thread."); - - mps_arena_destroy(arena); - comment("Destroyed space."); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - report("result", "pass"); - return 0; -} diff --git a/mps/qa/function/134.c b/mps/qa/function/134.c deleted file mode 100644 index 72d3ae64282..00000000000 --- a/mps/qa/function/134.c +++ /dev/null @@ -1,160 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = test of ramp allocation with smallish arena (64MB) - language = c - link = testlib.o rankfmt.o -OUTPUT_SPEC - result = pass -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "mpsavm.h" -#include "rankfmt.h" - -#define ARENALIMIT (64) - -#define TABSIZE (50000) -#define ENTERRAMP (30000) -#define LEAVERAMP (100000) - -#define BACKSIZE (128) -#define BACKITER (32) -#define RAMPSIZE (128) - -#define ITERATIONS (1000000ul) - -#define RAMP_INTERFACE -/* -#define COLLECT_WORLD -*/ - -void *stackpointer; - -mps_space_t arena; -mps_pool_t poolamc; -mps_thr_t thread; -mps_root_t root, root1; - -mps_fmt_t format; -mps_ap_t apamc; - -static mps_addr_t objtab[TABSIZE]; - -static void alloc_back(void) { - long int i, j; - - for (j = 0; j < BACKITER; j++) { - i = ranint(ranint(ranint(ranint(TABSIZE)+1)+1)+1); - objtab[i] = allocdumb(apamc, BACKSIZE, MPS_RANK_EXACT); - } -} - - -static void test(void) { - long int i; - long int rsize; - - int inramp; - - mycell *r, *s; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), - (size_t) 1024*1024*ARENALIMIT), - "create space"); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie( - mps_root_create_reg(&root, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_root_create_table(&root1, arena, MPS_RANK_EXACT, 0, &objtab[0], TABSIZE), - "create root table"); - - cdie( - mps_fmt_create_A(&format, arena, &fmtA), - "create format"); - - cdie( - mps_pool_create(&poolamc, arena, mps_class_amc(), format), - "create pool"); - - cdie( - mps_ap_create(&apamc, poolamc, MPS_RANK_EXACT), - "create ap"); - - inramp = 0; - - for (i = 0; i < ITERATIONS; i++) { - if (i % 10000 == 0) { - comment("%ld of %ld", i, ITERATIONS); - } - alloc_back(); - if (inramp) { - s = allocone(apamc, 3, MPS_RANK_EXACT); - setref(r, 0, s); - setref(s, 1, r); - r = s; - s = allocdumb(apamc, RAMPSIZE, MPS_RANK_EXACT); - setref(r, 2, s); - rsize ++; - if (ranint(LEAVERAMP) == 0) { - r = allocone(apamc, 2, MPS_RANK_EXACT); - s = allocone(apamc, 2, MPS_RANK_EXACT); -#ifdef RAMP_INTERFACE - mps_ap_alloc_pattern_end(apamc, mps_alloc_pattern_ramp()); -#endif -#ifdef COLLECT_WORLD - mps_arena_collect(arena); - mps_arena_release(arena); -#endif - comment("ramp end, %ld objects", rsize); - inramp = 0; - } - } else { - if (ranint(ENTERRAMP) == 0) { -#ifdef RAMP_INTERFACE - mps_ap_alloc_pattern_begin(apamc, mps_alloc_pattern_ramp()); -#endif - comment("ramp begin"); - r = allocone(apamc, 3, MPS_RANK_EXACT); - inramp = 1; - rsize = 0; - } - } - } - - mps_ap_destroy(apamc); - comment("Destroyed ap."); - - mps_pool_destroy(poolamc); - comment("Destroyed pool."); - - mps_fmt_destroy(format); - comment("Destroyed format."); - - mps_root_destroy(root1); - mps_root_destroy(root); - comment("Destroyed roots."); - - mps_thread_dereg(thread); - comment("Deregistered thread."); - - mps_arena_destroy(arena); - comment("Destroyed space."); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - report("result", "pass"); - return 0; -} diff --git a/mps/qa/function/135.c b/mps/qa/function/135.c deleted file mode 100644 index 1cb3bbb6ff6..00000000000 --- a/mps/qa/function/135.c +++ /dev/null @@ -1,64 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = mps_arena_commit_limit and small arena chunks - language = c - link = testlib.o -OUTPUT_SPEC - count < 10 -END_HEADER -*/ - -#include "testlib.h" -#include "mpsavm.h" -#include "mpscmv.h" - -void *stackpointer; - -mps_arena_t arena; -mps_thr_t thread; -mps_pool_t pool; - -static void test(void) { - int i; - mps_addr_t a; - -/* create an arena with chunk size of 2 M */ - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t) (1024*1024*20)), - "create arena"); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - -/* set the commit limit to 10MB */ - - report_res("commit0", - mps_arena_commit_limit_set(arena, (size_t) (1024*1024*10))); - - -/* create a pool */ - - cdie(mps_pool_create(&pool, arena, mps_class_mv(), (size_t) 64, (size_t) 64, (size_t) 64), "pool create"); - - for (i=0; i<200; i++) { - report("count", "%i", i); - die(mps_alloc(&a, pool, (size_t) 1024*1024), "alloc"); - } - - mps_pool_destroy(pool); - - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena."); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/136.c b/mps/qa/function/136.c deleted file mode 100644 index 6bcd865a7ab..00000000000 --- a/mps/qa/function/136.c +++ /dev/null @@ -1,164 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!136.c(trunk.4) $ - summary = MVFF low-memory test; reusing arena in other pool - language = c - link = testlib.o -END_HEADER -*/ - -/* Purpose: - * This is a grey-box test intended to expose problems in the - * interaction between MVFF and CBS, whereby MVFF can't return - * segments to the arena when CBS can't allocate control blocks. - * - * This problem is believed to occur in release.epcore.anchovy.1. - * - * - * Strategy: - * - Set low commit limit. - * - Allocate large objects in MVFF until we run out of memory. - * - Free one large object. - * - Allocate small objects in MVFF until we run out of memory. - * - Free every other small object. - * At this point, the CBS should have run out of control blocks. - * - Free every other large object. - * - Allocate in another pool. - */ - -#include "testlib.h" -#include "mpscmvff.h" -#include "mpscmv.h" -#include "mpsavm.h" - - -#define MAXSMALLOBJECTS (100000ul) -#define MAXLARGEOBJECTS (100000ul) - - -void *stackpointer; -mps_arena_t arena; - -static mps_addr_t - largeObjects[MAXLARGEOBJECTS], - smallObjects[MAXSMALLOBJECTS]; - - -static void do_test(size_t extendBy, size_t avgSize, size_t align, - int slotHigh, int arenaHigh, int firstFit) -{ - mps_pool_t pool, pool2; - mps_res_t res = MPS_RES_OK; /* suppress warning */ - mps_addr_t p; - unsigned int i; - unsigned long nLargeObjects = 0, nSmallObjects = 0; - unsigned long largeObjectSize, smallObjectSize; - - largeObjectSize = extendBy; - smallObjectSize = align; - - die(mps_pool_create(&pool, arena, mps_class_mvff(), - extendBy, avgSize, align, slotHigh, arenaHigh, firstFit), - "create MVFF pool"); - - die(mps_pool_create(&pool2, arena, mps_class_mv(), - extendBy, avgSize, /* maxSize */ extendBy), - "create MV pool"); - - /* First we allocate large objects until we run out of memory. */ - for(i = 0; i < MAXLARGEOBJECTS; i++) { - res = mps_alloc(&p, pool, largeObjectSize); - if (res != MPS_RES_OK) - break; - largeObjects[nLargeObjects] = p; - ++nLargeObjects; - } - asserts(res != MPS_RES_OK, - "Unexpectedly managed to create %lu objects of size %lu", - MAXLARGEOBJECTS, largeObjectSize); - asserts(nLargeObjects > 0, "Couldn't create even one object of size %lu", - largeObjectSize); - - /* Then we free one to make sure we can allocate some small objects */ - mps_free(pool, largeObjects[nLargeObjects - 1], largeObjectSize); - --nLargeObjects; - - comment("Allocated %lu objects of size %lu", - nLargeObjects, largeObjectSize); - - /* Then we allocate lots of small objects. */ - for(i = 0; i < MAXSMALLOBJECTS; i++) { - res = mps_alloc(&p, pool, smallObjectSize); - if (res != MPS_RES_OK) - break; - smallObjects[nSmallObjects] = p; - ++nSmallObjects; - } - asserts(res != MPS_RES_OK, - "Unexpectedly managed to create %lu objects of size %lu", - MAXSMALLOBJECTS, smallObjectSize); - - comment("Allocated %lu objects of size %lu", - nSmallObjects, smallObjectSize); - - /* Then we free every other small object */ - for(i = 0; i < nSmallObjects; i += 2) { - mps_free(pool, smallObjects[i], smallObjectSize); - smallObjects[i] = (mps_addr_t)0; - } - - /* The CBS should be in emergency mode now. */ - - /* Then we free every other large object */ - for(i = 0; i < nLargeObjects; i += 2) { - mps_free(pool, largeObjects[i], largeObjectSize); - largeObjects[i] = (mps_addr_t)0; - } - - /* Then we allocate in another pool. */ - res = mps_alloc(&p, pool2, largeObjectSize); - asserts(res == MPS_RES_OK, - "Couldn't allocate one object of size %lu in second pool", - (unsigned long)largeObjectSize); - - mps_pool_destroy(pool); - mps_pool_destroy(pool2); -} - - -static void test(void) -{ - mps_thr_t thread; - int symm; - size_t comlimit; - mps_bool_t slotHigh, arenaHigh, firstFit; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t) (1024*1024*50)), - "create arena"); - cdie(mps_thread_reg(&thread, arena), "register thread"); - - for (comlimit = 512 *1024; comlimit >= 64 * 1024; comlimit -= 4*1024) { - mps_arena_commit_limit_set(arena, comlimit); - report("limit", "%x", comlimit); - symm = ranint(8); - slotHigh = (symm >> 2) & 1; - arenaHigh = (symm >> 1) & 1; - firstFit = (symm & 1); - - do_test(4096, 8, 8, slotHigh, arenaHigh, firstFit); - } - - mps_thread_dereg(thread); - mps_arena_destroy(arena); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/137.c b/mps/qa/function/137.c deleted file mode 100644 index 8f4da785637..00000000000 --- a/mps/qa/function/137.c +++ /dev/null @@ -1,106 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = MVFF emergency list test - language = c - link = testlib.o -END_HEADER -*/ - -/* MVFF will put free blocks on emergency lists if it cannot allocate - in the CBS. There is a bug in anchovy.1 in which having more than one - block on the emergency lists that's bigger than a segment will cause - an assertion to fire when the emergency lists are flushed. - - - set commit limit - - allocate (a) lots of small objects - (b) lots of big objects (until can do no more) - - free a goodly number of non-adjacent small objects, so that - we start to use emergency lists - - free lots of non-adjacent big objects - - raise commit limit - - free or alloc to make CBS flush lists -*/ - -#include "testlib.h" -#include "mpscmvff.h" -#include "mpsavm.h" - -#define COMLIMIT1 (10*1024*1024) -#define COMLIMIT2 (12*1024*1024) -#define SMALLSIZE (8) -#define NSMALL (4*1024) -#define BIGSIZE (8*1024) -#define EXTENDBY (8*1024) -#define MAXLARGE (10*1024) - -void *stackpointer; -mps_arena_t arena; - -static mps_addr_t - largeObjects[MAXLARGE], - smallObjects[NSMALL]; - -static void test(void) { - mps_thr_t thread; - mps_pool_t pool; - unsigned int i; - unsigned long nLarge; - - cdie(mps_arena_create(&arena, mps_arena_class_vmnz(), - (size_t) (1024*1024*50)), "create arena"); - cdie(mps_thread_reg(&thread, arena), "register thread"); - - mps_arena_commit_limit_set(arena, COMLIMIT1); - - die( - mps_pool_create(&pool, arena, mps_class_mvff(), - EXTENDBY, 8, 8, 0, 0, 1), - "create MVFF pool"); - - for (i = 0; i < NSMALL; i++) { - die(mps_alloc(&smallObjects[i], pool, SMALLSIZE), "small alloc failed"); - } - - nLarge = 0; - while (mps_alloc(&largeObjects[nLarge], pool, BIGSIZE) == MPS_RES_OK) { - nLarge ++; - } - - report("nLarge", "%lu", nLarge); - - for (i = 0; i < NSMALL; i += 2) { - mps_free(pool, smallObjects[i], SMALLSIZE); - } - - comment("Freed every other small object."); - - /* The CBS should be in emergency mode now. */ - - for (i = 0; i < nLarge; i += 2) { - mps_free(pool, largeObjects[i], BIGSIZE); - } - - comment("Freed every other large object."); - - /* Now there should be lots of big blocks on the CBS. */ - - mps_arena_commit_limit_set(arena, COMLIMIT2); - - comment("Raised the commit limit. Will attempt free and alloc."); - mps_free(pool, largeObjects[1], BIGSIZE); - die(mps_alloc(&largeObjects[0], pool, BIGSIZE), "alloc failed"); - - mps_pool_destroy(pool); - mps_thread_dereg(thread); - mps_arena_destroy(arena); -} - -int main(void) { - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/138.c b/mps/qa/function/138.c deleted file mode 100644 index e25cf927eef..00000000000 --- a/mps/qa/function/138.c +++ /dev/null @@ -1,85 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!138.c(trunk.3) $ - summary = test running out of memory while scanning roots - language = c - link = testlib.o rankfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "mpsavm.h" -#include "rankfmt.h" - - -#define MEG (1024uL*1024uL) -#define THIRTY_MEG (30uL*MEG) - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - - -static void test(void) -{ - int j; - mps_ap_t ap; - mps_arena_t arena; - mps_fmt_t format; - mps_chain_t chain; - mps_pool_t pool; - mps_root_t root1; - mps_thr_t thread; - - /* create an arena that can't grow beyond 30 MB */ - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t)THIRTY_MEG), - "create arena"); - cdie(mps_arena_commit_limit_set(arena, (size_t)THIRTY_MEG), - "commit limit set"); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie(mps_root_create_table(&root1, arena, MPS_RANK_EXACT, 0, - (mps_addr_t*)&exfmt_root, 1), - "create table root"); - - cdie(mps_fmt_create_A(&format, arena, &fmtA), - "create format"); - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - die(mmqa_pool_create_chain(&pool, arena, mps_class_amc(), format, chain), - "create pool"); - - cdie(mps_ap_create(&ap, pool, MPS_RANK_EXACT), - "create ap"); - - /* allocate a 16 MB live object */ - - allocdumb(ap, 16*MEG, MPS_RANK_EXACT); - - comment("collect world..."); - - for (j=0; j<1000; j++) { - mps_arena_collect(arena); - } - - mps_ap_destroy(ap); - mps_pool_destroy(pool); - mps_chain_destroy(chain); - mps_fmt_destroy(format); - mps_root_destroy(root1); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/139.c b/mps/qa/function/139.c deleted file mode 100644 index b7ccb041e77..00000000000 --- a/mps/qa/function/139.c +++ /dev/null @@ -1,85 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = MVFF alloc from emergency list test - language = c - link = testlib.o -END_HEADER -*/ - -/* MVFF will put free blocks on emergency lists if it cannot allocate - in the CBS. There is a bug in anchovy.1 in which the emergency lists - are not checked when allocating, so some allocs will fail needlessly. -*/ - -#include "testlib.h" -#include "mpscmvff.h" -#include "mpsavm.h" - -#define COMLIMIT1 (10*1024*1024) -#define COMLIMIT2 (12*1024*1024) -#define SMALLSIZE (8) -#define NSMALL (4*1024) -#define BIGSIZE (64) -#define EXTENDBY (8*1024) -#define MAXLARGE (1000*1024) - -void *stackpointer; -mps_arena_t arena; - -static mps_addr_t - largeObjects[MAXLARGE], - smallObjects[NSMALL]; - -static void test(void) { - mps_thr_t thread; - mps_pool_t pool; - unsigned int i; - unsigned long nLarge; - - cdie(mps_arena_create(&arena, mps_arena_class_vmnz(), - (size_t) (1024*1024*50)), "create arena"); - cdie(mps_thread_reg(&thread, arena), "register thread"); - - mps_arena_commit_limit_set(arena, COMLIMIT1); - - die( - mps_pool_create(&pool, arena, mps_class_mvff(), - EXTENDBY, 8, 8, 0, 0, 1), - "create MVFF pool"); - - for (i = 0; i < NSMALL; i++) { - die(mps_alloc(&smallObjects[i], pool, SMALLSIZE), "small alloc failed"); - } - - nLarge = 0; - while (mps_alloc(&largeObjects[nLarge], pool, BIGSIZE) == MPS_RES_OK) { - nLarge ++; - } - - report("nLarge", "%lu", nLarge); - - for (i = 0; i < NSMALL; i += 2) { - mps_free(pool, smallObjects[i], SMALLSIZE); - } - - comment("Freed every other small object."); - - /* The CBS should be in emergency mode now. */ - - mps_free(pool, largeObjects[3], BIGSIZE); - die(mps_alloc(&largeObjects[3], pool, BIGSIZE), "free and alloc failed"); - - mps_pool_destroy(pool); - mps_thread_dereg(thread); - mps_arena_destroy(arena); -} - -int main(void) { - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/14.c b/mps/qa/function/14.c deleted file mode 100644 index 2b6b3831e6f..00000000000 --- a/mps/qa/function/14.c +++ /dev/null @@ -1,122 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!14.c(trunk.5) $ - summary = regression test for bug when commit fails - language = c - link = testlib.o newfmt.o -END_HEADER -*/ - -/* - This is a regression test for a bug found by test f12. - Get a segment with an ambiguous reference to it, and get - an object X with only exact references to it. Reserve an object Y - and init it to point to the object X. Then cause collections - until X gets moved. Reference in Y is out-of-date. Commit Y - (should fail) and then cause collection, hoping to trick MM - into scanning Y. -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "mpsavm.h" -#include "newfmt.h" - - -void *stackpointer; - - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - - -static void test(void) -{ - mps_arena_t arena; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_ap_t apA, apB; - mps_fmt_t format; - mps_chain_t chain; - - mycell *ambigref; - - size_t bytes; - size_t alignment; - mps_addr_t q; - - int i; - - formatcomments = 1; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), mmqaArenaSIZE), - "create arena"); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie(mps_root_create_reg(&root, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie(mps_fmt_create_A(&format, arena, &fmtA), "create format"); - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - cdie(mmqa_pool_create_chain(&pool, arena, mps_class_amc(), format, chain), - "create pool"); - - die(mps_ap_create(&apA, pool, MPS_RANK_EXACT), "create apA"); - die(mps_ap_create(&apB, pool, MPS_RANK_EXACT), "create apB"); - - bytes = offsetof(struct data, ref) + sizeof(struct refitem); - alignment = MPS_PF_ALIGN; - bytes = (bytes+alignment-1)&~(alignment-1); - die(mps_reserve(&q, apB, bytes), "reserve: "); - - comment("Reserve"); - ambigref = q; - ambigref->data.tag = MCdata; - ambigref->data.id = MCerrorid; - ambigref->data.numrefs = 0; - ambigref->data.size = bytes; - - comment("Midallocation"); - for(i = 0; i < 40; i++) { - allocdumb(apA, 1024*256); - } - - comment("Commit"); - asserts(mps_commit(apB, q, bytes) == 0, "Commit succeeded!"); - - comment("Postallocation"); - for(i = 0; i < 40; i++) { - allocdumb(apA, 1024*256); - } - - comment("Finished"); - - mps_ap_destroy(apA); - mps_ap_destroy(apB); - - mps_pool_destroy(pool); - mps_chain_destroy(chain); - mps_fmt_destroy(format); - mps_root_destroy(root); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/140.c b/mps/qa/function/140.c deleted file mode 100644 index 0c4b39159a3..00000000000 --- a/mps/qa/function/140.c +++ /dev/null @@ -1,190 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = MVFF low-memory test - language = c - link = testlib.o -END_HEADER -*/ - -#include -#include "testlib.h" -#include "mpscmvff.h" -#include "mpsavm.h" - -#define MAXNUMBER 1000000 - -void *stackpointer; -mps_space_t space; - -mps_bool_t slotHigh, arenaHigh, firstFit; -int comments = 0; - -static struct {mps_addr_t addr; size_t size;} queue[MAXNUMBER]; - -static mps_pool_debug_option_s debugOpts = {(void *) "fefifofu", 8}; - -enum {SEQ=0, RAN=1, SEQGAP=2, RANGAP=3, DUMMY=4}; -static char *tdesc[] = {"sequential", "random", - "sequential gap", "random gap", "dummy"}; - -static void setobj(mps_addr_t a, size_t size, unsigned char val) -{ - unsigned char *b; - b = a; - - commentif(comments, "Set %x, size %x = %i", b, size, (int) val); - while (size>0) - { - *b=val; - b++; - size--; - } -} - -static int chkobj(mps_addr_t a, size_t size, unsigned char val) -{ - unsigned char *b; - b = a; - - while (size>0) - { - /* comment("%p == %i", b, (int) val); - */ - if (*b != val) return 0; - b++; - size--; - } - return 1; -} - -static void dt(int kind, - size_t extendBy, size_t avgSize, size_t align, - size_t mins, size_t maxs, int number, int iter) -{ - mps_pool_t pool; - int i, hd; - clock_t time0, time1; - size_t size; - int secs; - - asserts(number <= MAXNUMBER, "number too big"); - - time0 = clock(); - asserts(time0 != -1, "processor time not available"); - - die( - mps_pool_create(&pool, space, mps_class_mvff_debug(), - &debugOpts, - extendBy, avgSize, align, slotHigh, arenaHigh, firstFit), - "create MVFF pool"); - - for(hd=0; hd 0; comlimit -= 4*1024) { - mps_arena_commit_limit_set(space, comlimit); - report("limit", "%x", comlimit); - symm = ranint(8); - slotHigh = (symm >> 2) & 1; - arenaHigh = (symm >> 1) & 1; - firstFit = (symm & 1); - - mins = ranrange(1, 16); - - dt(RANGAP, 64*1024, 32, 8, 4*mins, 4*ranrange(mins, mins*100), 1000, 100000); - } - - mps_thread_dereg(thread); - mps_arena_destroy(space); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/141.c b/mps/qa/function/141.c deleted file mode 100644 index 4c177c5f829..00000000000 --- a/mps/qa/function/141.c +++ /dev/null @@ -1,64 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!141.c(trunk.2) $ - summary = EPDR fenceposting check - language = c - link = testlib.o -OUTPUT_SPEC - assert = true - assertfile P= dbgpool.c -END_HEADER -*/ - -#include "testlib.h" -#include "mpscepdl.h" -#include "mpsavm.h" - -void *stackpointer; -mps_arena_t arena; - -static mps_pool_debug_option_s debugOpts = {(void *)"bibblebo", 8}; - -static void test(void) { - mps_thr_t thread; - mps_pool_t pool; - mps_addr_t a; - char *c; - - cdie(mps_arena_create(&arena, mps_arena_class_vmnz(), - (size_t) (1024*1024*50)), "create arena"); - cdie(mps_thread_reg(&thread, arena), "register thread"); - - die( - mps_pool_create(&pool, arena, mps_class_epdr_debug(), &debugOpts, - 8192, 8, 8), - "create MVFF pool"); - - die(mps_alloc(&a, pool, 64), "alloc a"); - - c = a; - c -= 1; - *c = 0; - - mps_pool_check_fenceposts(pool); - comment("Fencepost check."); - - c += 67; - *c = 0; - - mps_pool_check_fenceposts(pool); - comment("Fencepost check."); - - mps_pool_destroy(pool); - mps_thread_dereg(thread); - mps_arena_destroy(arena); -} - -int main(void) { - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/142.c b/mps/qa/function/142.c deleted file mode 100644 index b15a85676b9..00000000000 --- a/mps/qa/function/142.c +++ /dev/null @@ -1,59 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!142.c(trunk.3) $ - summary = EPDR fenceposting check: subfree - language = c - link = testlib.o -OUTPUT_SPEC - assert = true - assertfile P= dbgpool.c - assertcond = fencepost check on free -END_HEADER -*/ - -#include "testlib.h" -#include "mpscepdl.h" -#include "mpsavm.h" - - -void *stackpointer; -mps_arena_t arena; - - -static mps_pool_debug_option_s debugOpts = {(void *)"bibblebo", 8}; - - -static void test(void) -{ - mps_thr_t thread; - mps_pool_t pool; - mps_addr_t a; - - cdie(mps_arena_create(&arena, mps_arena_class_vmnz(), - (size_t) (1024*1024*50)), "create arena"); - cdie(mps_thread_reg(&thread, arena), "register thread"); - - die( - mps_pool_create(&pool, arena, mps_class_epdr_debug(), &debugOpts, - 8192, 8, 8), - "create MVFF pool"); - - die(mps_alloc(&a, pool, 64), "alloc a"); - - mps_free(pool, a, 32); - - mps_pool_destroy(pool); - mps_thread_dereg(thread); - mps_arena_destroy(arena); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/143.c b/mps/qa/function/143.c deleted file mode 100644 index 57732b2ff3c..00000000000 --- a/mps/qa/function/143.c +++ /dev/null @@ -1,57 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!143.c(trunk.2) $ - summary = EPDR fenceposting check: free - language = c - link = testlib.o -OUTPUT_SPEC - assert = true - assertcond = fencepost check on free -END_HEADER -*/ - -#include "testlib.h" -#include "mpscepdl.h" -#include "mpsavm.h" - -void *stackpointer; -mps_arena_t arena; - -static mps_pool_debug_option_s debugOpts = {(void *)"bibblebo", 8}; - -static void test(void) { - mps_thr_t thread; - mps_pool_t pool; - mps_addr_t a; - char * c; - - cdie(mps_arena_create(&arena, mps_arena_class_vmnz(), - (size_t) (1024*1024*50)), "create arena"); - cdie(mps_thread_reg(&thread, arena), "register thread"); - - die( - mps_pool_create(&pool, arena, mps_class_epdr_debug(), &debugOpts, - 8192, 8, 8), - "create MVFF pool"); - - die(mps_alloc(&a, pool, 63), "alloc a"); - - c = a; - c += 63; - *c = 0; - - mps_free(pool, a, 63); - - mps_pool_destroy(pool); - mps_thread_dereg(thread); - mps_arena_destroy(arena); -} - -int main(void) { - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/144.c b/mps/qa/function/144.c deleted file mode 100644 index f2442157b3c..00000000000 --- a/mps/qa/function/144.c +++ /dev/null @@ -1,65 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!144.c(trunk.1) $ - summary = MVFF fenceposting check - language = c - link = testlib.o -OUTPUT_SPEC - assert = true - assertcond = fencepost check requested by client -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmvff.h" -#include "mpsavm.h" - -void *stackpointer; -mps_arena_t arena; - -static mps_pool_debug_option_s debugOpts = {(void *)"bibblebo", 8}; - -static void test(void) { - mps_thr_t thread; - mps_pool_t pool; - mps_addr_t a, b; - char *c; - - cdie(mps_arena_create(&arena, mps_arena_class_vmnz(), - (size_t) (1024*1024*50)), "create arena"); - cdie(mps_thread_reg(&thread, arena), "register thread"); - - die( - mps_pool_create(&pool, arena, mps_class_mvff_debug(), &debugOpts, - 8192, 8, 8, 0, 0, 1), - "create MVFF pool"); - - die(mps_alloc(&a, pool, 64), "alloc a"); - die(mps_alloc(&b, pool, 64), "alloc b"); - - c = a; - c -= 1; - *c = 0; - - mps_pool_check_fenceposts(pool); - comment("Fencepost check."); - - c += 67; - *c = 0; - - mps_pool_check_fenceposts(pool); - comment("Fencepost check."); - - mps_pool_destroy(pool); - mps_thread_dereg(thread); - mps_arena_destroy(arena); -} - -int main(void) { - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/145.c b/mps/qa/function/145.c deleted file mode 100644 index eace92d79e6..00000000000 --- a/mps/qa/function/145.c +++ /dev/null @@ -1,100 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = EPVM low-memory test - language = c - link = testlib.o epvmfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmv.h" -#include "mpscepvm.h" -#include "mpsavm.h" -#include "epvmfmt.h" - -#define MAX_SAVE 10 -#define INIT_SAVE 0 -#define OBJ_SIZE 8 - -void *stackpointer; - -static mps_pool_t pooli[1024]; - -static void tryout(size_t comlimit, int pools) { - mps_arena_t arena; - mps_thr_t thread; - mps_fmt_t format; - mps_pool_t pool; - mps_ap_t ap; - psobj *a; - int i, p; - - comment("Limit: %lu, pools: %d", (unsigned long) comlimit, pools); - if (mps_arena_create(&arena, mps_arena_class_vm(), (size_t) (1024*1024*128))) - goto no_arena; - - mps_arena_commit_limit_set(arena, comlimit); - - if (mps_thread_reg(&thread, arena)) goto no_thread; - - if (mps_fmt_create_A(&format, arena, &fmtepvm)) goto no_fmt; - - for (p = 0; p < pools; p ++) { - if (mps_pool_create(&pooli[p], arena, mps_class_mv(), 4096, 32, 4096)) { - break; - }; - } - - if (mps_pool_create(&pool, arena, mps_class_epvm(), format, 10, 0)) - goto no_pool; - - if (mps_ap_create(&ap, pool, 0)) goto no_ap; - - allocrepvm(&a, ap, OBJ_SIZE); - mps_epvm_save(pool); - allocrepvm(&a, ap, OBJ_SIZE); - mps_epvm_save(pool); - for (i=0; i<100; i++) { - allocrepvm(&a, ap, OBJ_SIZE); - } - mps_epvm_restore(pool, 0); - - mps_ap_destroy(ap); -no_ap: - mps_pool_destroy(pool); -no_pool: - for (; p >= 0; p--) { - if (pooli[p]) { - mps_pool_destroy(pooli[p]); - } - } - mps_fmt_destroy(format); -no_fmt: - mps_thread_dereg(thread); -no_thread: - mps_arena_destroy(arena); -no_arena: - a = NULL; -} - -static void test(void) -{ - int i; - - for (i = 0; i <1024; i ++) { - tryout(1024*64, i); - } -} - -int main(void) { - void *m; - stackpointer=&m; - - easy_tramp(test); - pass(); - return 0; -} - - - diff --git a/mps/qa/function/146.c b/mps/qa/function/146.c deleted file mode 100644 index e21b5af2223..00000000000 --- a/mps/qa/function/146.c +++ /dev/null @@ -1,106 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = EPVM low-memory test - language = c - link = testlib.o epvmfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscepvm.h" -#include "mpsavm.h" -#include "epvmfmt.h" - -#define MAX_SAVE 10 -#define INIT_SAVE 0 -#define OBJ_SIZE 8 - -#define MAXAPS 4096 - -void *stackpointer; - -static mps_ap_t api[MAXAPS]; - -static void tryout(size_t comlimit, int aps) { - mps_arena_t arena; - mps_thr_t thread; - mps_fmt_t format; - mps_pool_t pool, pool1; - mps_ap_t ap; - psobj *a; - int i, p; - - comment("Limit: %lu, aps: %d", (unsigned long) comlimit, aps); - if (mps_arena_create(&arena, mps_arena_class_vm(), (size_t) (1024*1024*128))) - goto no_arena; - - mps_arena_commit_limit_set(arena, comlimit); - - if (mps_thread_reg(&thread, arena)) goto no_thread; - - if (mps_fmt_create_A(&format, arena, &fmtepvm)) goto no_fmt; - - if (mps_pool_create(&pool1, arena, mps_class_epvm(), format, 10, 0)) - goto no_pool; - - for (p = 0; p < aps; p ++) { - if (mps_ap_create(&api[p], pool1, 0)) { - break; - }; - } - - if (mps_pool_create(&pool, arena, mps_class_epvm(), format, 10, 0)) - goto no_pool2; - - if (mps_ap_create(&ap, pool, 0)) goto no_ap; - - allocrepvm(&a, ap, OBJ_SIZE); - mps_epvm_save(pool); - allocrepvm(&a, ap, OBJ_SIZE); - mps_epvm_save(pool); - for (i=0; i<100; i++) { - allocrepvm(&a, ap, OBJ_SIZE); - } - mps_epvm_restore(pool, 0); - - mps_ap_destroy(ap); -no_ap: - mps_pool_destroy(pool); -no_pool2: - for (; p >= 0; p--) { - if (api[p]) { - mps_ap_destroy(api[p]); - } - } - mps_pool_destroy(pool1); -no_pool: - mps_fmt_destroy(format); -no_fmt: - mps_thread_dereg(thread); -no_thread: - mps_arena_destroy(arena); -no_arena: - a = NULL; -} - -static void test(void) -{ - int i; - - for (i = 0; i < MAXAPS; i ++) { - tryout(1024*64, i); - } -} - -int main(void) { - void *m; - stackpointer=&m; - - easy_tramp(test); - pass(); - return 0; -} - - - diff --git a/mps/qa/function/147.c b/mps/qa/function/147.c deleted file mode 100644 index 722e1129b99..00000000000 --- a/mps/qa/function/147.c +++ /dev/null @@ -1,104 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = SNC simple test - language = c - link = testlib.o rankfmt.o - parameters = MAXFRAMES=100 MAXLEVOBJS=20 ITERATIONS=10000 -END_HEADER -*/ - -#include "testlib.h" -#include "mpscsnc.h" -#include "mpsavm.h" -#include "rankfmt.h" - -#define THIRTY_MEG (30uL*1024ul*1024ul) - -static void test(void) -{ - int i = 0, f = 0; - mps_ap_t sap; - mps_arena_t arena; - mps_fmt_t format; - mps_pool_t spool; - mps_thr_t thread; - mps_frame_t frames[MAXFRAMES]; - int nobj[MAXFRAMES+1]; - mycell *p; - -/* create an arena that can't grow beyond 30 M */ - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t)THIRTY_MEG), - "create arena"); - cdie(mps_arena_commit_limit_set(arena, (size_t)THIRTY_MEG), - "commit limit set"); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie( - mps_fmt_create_A(&format, arena, &fmtA), - "create format"); - - cdie( - mps_pool_create(&spool, arena, mps_class_snc(), format), - "create SNC pool"); - - cdie( - mps_ap_create(&sap, spool, MPS_RANK_EXACT), - "create ap"); - -/* repeatedly push and pop stack frames, and allocate objects in them - at random. Parameters ensure that max allocation can't get too high. -*/ - - for (i=0; i < ITERATIONS; i++) { - switch (ranint(12)) { - case 1: case 2: case 3: case 4: case 5: - if (f < MAXFRAMES) { - die(mps_ap_frame_push(&frames[f], sap), "push"); - comment("push %i", f); - f++; - nobj[f] = 0; - } - break; - case 6: case 7: case 8: case 9: case 10: - if (nobj[f] < MAXLEVOBJS) { - p = allocone(sap, 16, MPS_RANK_EXACT); - setref(p, 0, NULL); - nobj[f]++; - } - break; - case 11: - if (f>0) { - f -= 1+ranint(1+ranint(f)); /* new f is in [0, old f) */ - die(mps_ap_frame_pop(sap, frames[f]), "pop"); - comment("pop %i", f); - } - break; - } - } - - mps_ap_destroy(sap); - comment("Destroyed ap."); - - mps_pool_destroy(spool); - comment("Destroyed pool."); - - mps_fmt_destroy(format); - comment("Destroyed format."); - - mps_thread_dereg(thread); - comment("Deregistered thread."); - - mps_arena_destroy(arena); - comment("Destroyed arena."); - -} - -int main(void) -{ - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/148.c b/mps/qa/function/148.c deleted file mode 100644 index 3173236b716..00000000000 --- a/mps/qa/function/148.c +++ /dev/null @@ -1,144 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!148.c(trunk.3) $ - summary = SNC scanning test - language = c - link = testlib.o rankfmt.o - harness = 2.1 -OUTPUT_SPEC - inc1 = 1 - inc2 = 0 - inc3 = 1 - inc4 = 1 -END_HEADER -*/ - -/* This test uses an AMC pool and an SNC pool, with objects in the SNC - pool keeping objects in the ANC pool alive. No ambiguous roots, so we - can tell exactly what's been scanned and check that the SNC pool is - working properly. -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "mpscsnc.h" -#include "mpsavm.h" -#include "rankfmt.h" - - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - -#define ARENA_SIZE (100ul*1024ul*1024ul) -#define BIGSIZE (10ul*1024*1024) -#define SMALLSIZE (4096) - - -static void test(void) -{ - int i; - mps_ap_t ap, sap; - mps_arena_t arena; - mps_fmt_t format; - mps_chain_t chain; - mps_pool_t pool, spool; - mps_thr_t thread; - mps_frame_t frame1; - mycell *p, *q; - size_t com, com1, com2; - - formatcomments=1; - alloccomments=1; - fixcomments=1; - - /* create an arena (no particular size limit) */ - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t)ARENA_SIZE), - "create arena"); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - - /* because we know objects in the stack pool don't move, */ - /* we can do without roots. Hooray! */ - - cdie(mps_fmt_create_A(&format, arena, &fmtA), "create format"); - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - die(mmqa_pool_create_chain(&pool, arena, mps_class_amc(), format, chain), - "create pool(amc)"); - cdie(mps_ap_create(&ap, pool, MPS_RANK_EXACT), "create ap(amc)"); - - cdie(mps_pool_create(&spool, arena, mps_class_snc(), format), - "create SNC pool"); - cdie(mps_ap_create(&sap, spool, MPS_RANK_EXACT), "create ap"); - - /* push, alloc, check object is scanned */ - - com = arena_committed_and_used(arena); - report("com", "%ld", com); - cdie(mps_ap_frame_push(&frame1, sap), "push"); - p = allocone(sap, 2, MPS_RANK_EXACT); - q = allocdumb(ap, BIGSIZE, MPS_RANK_EXACT); - setref(p, 0, q); - q = allocdumb(ap, SMALLSIZE, MPS_RANK_EXACT); - report("com", "%ld", arena_committed_and_used(arena)); - comment("collect..."); - mps_arena_collect(arena); - com1 = arena_committed_and_used(arena); - mps_arena_release(arena); - report("com", "%ld", com1); - report("inc1", "%d", (com1-com)/BIGSIZE); - - /* pop, check object isn't scanned */ - - cdie(mps_ap_frame_pop(sap, frame1), "pop"); - comment("collect..."); - mps_arena_collect(arena); - com1 = arena_committed_and_used(arena); - mps_arena_release(arena); - report("com", "%ld", com1); - report("inc2", "%ld", (com1-com)/BIGSIZE); - - /* check initial frame is scanned */ - - p = allocone(sap, 2, MPS_RANK_EXACT); - q = allocdumb(ap, BIGSIZE, MPS_RANK_EXACT); - setref(p, 1, q); - q = allocdumb(ap, SMALLSIZE, MPS_RANK_EXACT); - mps_arena_collect(arena); - com2 = arena_committed_and_used(arena); - mps_arena_release(arena); - report("inc3", "%ld", (com2-com1)/BIGSIZE); - - /* even in ordinary collection */ - - for (i=0; i < 500; i++) { - q = allocdumb(ap, BIGSIZE, MPS_RANK_EXACT); - } - q = allocdumb(ap, SMALLSIZE, MPS_RANK_EXACT); - mps_arena_collect(arena); - com2 = arena_committed_and_used(arena); - mps_arena_release(arena); - report("inc4", "%ld", (com2-com1)/BIGSIZE); - - - mps_ap_destroy(ap); - mps_ap_destroy(sap); - mps_pool_destroy(pool); - mps_pool_destroy(spool); - mps_chain_destroy(chain); - mps_fmt_destroy(format); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/149.c b/mps/qa/function/149.c deleted file mode 100644 index 8746136c712..00000000000 --- a/mps/qa/function/149.c +++ /dev/null @@ -1,198 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!149.c(trunk.2) $ - summary = SNC low-memory reservoir tests with commit limit - language = c - harness = 2.1 - link = testlib.o rankfmt.o -OUTPUT_SPEC - lim0 = 0 - avail0 = 0 - lim1 > 5000000 - lim1 < 6000000 - defecit1 = 0 - lim2 > 1045 - lim2 < 32768 - defecit2 = 0 - defecit3 > 8000000 - spill3 <= 0 - spill4 <= 0 - grow4 > 500000 - allocfail < 20 - failres = COMMIT_LIMIT - spill5 <= 0 - grow5 = 0 - avail5 > 1500000 - allocfail2 > 10000 - failres2 = MEMORY - shrink6 > 1000000 - spill6 <= 0 - completed = yes -END_HEADER -*/ - -#include "testlib.h" -#include "mpscsnc.h" -#include "mpsavm.h" -#include "rankfmt.h" - -#define ARENA_SIZE ((size_t) 1024*1024*30) - -void *stackpointer; - -mps_space_t arena; -mps_pool_t poolsnc; -mps_pool_t poolmv; -mps_thr_t thread; -mps_root_t root; - -mps_fmt_t format; -mps_ap_t apsnc; - -mps_root_t root; - -static void test(void) { - - mycell *p, *q; - int i; - mps_res_t res; - size_t lim0, avail0, lim1, avail1, commit1, lim2, avail2, commit2; - size_t lim3, avail3, commit3, lim4, avail4, commit4; - size_t lim5, avail5, commit5, lim6, avail6, commit6; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), ARENA_SIZE), - "create space"); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie(mps_root_create_reg(&root, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), "create stack root"); - - cdie( - mps_fmt_create_A(&format, arena, &fmtA), - "create format"); - - cdie( - mps_pool_create(&poolsnc, arena, mps_class_snc(), format), - "create pool"); - - cdie( - mps_ap_create(&apsnc, poolsnc, MPS_RANK_EXACT), - "create ap"); - - report("lim0", "%d", lim0 = mps_reservoir_limit(arena)); - report("avail0", "%d", avail0 = mps_reservoir_available(arena)); - mps_reservoir_limit_set(arena, (size_t) 0); - - mps_reservoir_limit_set(arena, (size_t) (5ul*1024*1024)); - report("lim1", "%d", lim1 = mps_reservoir_limit(arena)); - report("avail1", "%d", avail1 = mps_reservoir_available(arena)); - report("commit1", "%d", commit1 = arena_committed_and_used(arena)); - report("defecit1", "%d", lim1-avail1); - - mps_reservoir_limit_set(arena, (size_t) (1045)); - report("lim2", "%d", lim2 = mps_reservoir_limit(arena)); - report("avail2", "%d", avail2 = mps_reservoir_available(arena)); - report("commit2", "%d", commit2 = arena_committed_and_used(arena)); - report("defecit2", "%d", lim2-avail2); - -/* set commit limit to whatever is currently committed plus 1 MB -*/ - - die(mps_arena_commit_limit_set(arena, arena_committed_and_used(arena)+1024*1024), "commit limit set"); - mps_reservoir_limit_set(arena, (size_t) (10ul*1024*1024)); - report("lim3", "%d", lim3 = mps_reservoir_limit(arena)); - report("avail3", "%d", avail3 = mps_reservoir_available(arena)); - report("commit3", "%d", commit3 = arena_committed_and_used(arena)); - report("defecit3", "%d", lim3-avail3); - report("spill3", "%d", commit3-mps_arena_commit_limit(arena)); - -/* now raise it by 1/2 MB -- reservoir should grow -*/ - - die(mps_arena_commit_limit_set(arena, arena_committed_and_used(arena)+512*1024), "commit limit set"); - report("lim4", "%d", lim4 = mps_reservoir_limit(arena)); - report("avail4", "%d", avail4 = mps_reservoir_available(arena)); - report("commit4", "%d", commit4 = arena_committed_and_used(arena)); - report("grow4", "%d", avail4-avail3); - report("spill4", "%d", commit4-mps_arena_commit_limit(arena)); - -/* try some allocation -- more than a small amount should fail -*/ - - i = -1; - p = NULL; - res = MPS_RES_OK; - while (res == MPS_RES_OK) { - res = allocrone(&q, apsnc, 10, MPS_RANK_EXACT); - if (res == MPS_RES_OK) { - setref(q, 0, p); - p = q; - } - i++; - } - report("allocfail", "%d", i); - report_res("failres", res); - -/* available shouldn't have changed since before allocation -*/ - - report("lim5", "%d", lim5 = mps_reservoir_limit(arena)); - report("avail5", "%d", avail5 = mps_reservoir_available(arena)); - report("commit5", "%d", commit5 = arena_committed_and_used(arena)); - report("grow5", "%d", avail5-avail4); - report("spill5", "%d", commit5-mps_arena_commit_limit(arena)); - -/* try some allocation from reservoir -- not much should fail -*/ - - i = -1; - res = MPS_RES_OK; - while (res == MPS_RES_OK) { - res = reservoir_allocrone(&q, apsnc, 10, MPS_RANK_EXACT); - if (res == MPS_RES_OK) { - setref(q, 0, p); - p = q; - } - i++; - } - report("allocfail2", "%d", i); - report_res("failres2", res); - -/* available should have changed now -*/ - - report("lim6", "%d", lim6 = mps_reservoir_limit(arena)); - report("avail6", "%d", avail6 = mps_reservoir_available(arena)); - report("commit6", "%d", commit6 = arena_committed_and_used(arena)); - report("spill6", "%d", commit6-mps_arena_commit_limit(arena)); - report("shrink6", "%d", avail5-avail6); - - mps_root_destroy(root); - comment("Destroyed root."); - - mps_ap_destroy(apsnc); - comment("Destroyed ap."); - - mps_pool_destroy(poolsnc); - comment("Destroyed pool."); - - mps_fmt_destroy(format); - comment("Destroyed format."); - - mps_thread_dereg(thread); - comment("Deregistered thread."); - - mps_arena_destroy(arena); - comment("Destroyed space."); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - report("completed", "yes"); - return 0; -} diff --git a/mps/qa/function/15.c b/mps/qa/function/15.c deleted file mode 100644 index c04ffc6f225..00000000000 --- a/mps/qa/function/15.c +++ /dev/null @@ -1,78 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!15.c(trunk.5) $ - summary = destroy AMC pool in mid-collection - language = c - link = testlib.o newfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "mpsavm.h" -#include "newfmt.h" - - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - - -void *stackpointer; - - -static void test(void) -{ - mps_arena_t arena; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_ap_t ap; - mps_fmt_t format; - mps_chain_t chain; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), mmqaArenaSIZE), - "create arena"); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie(mps_root_create_reg(&root, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie(mps_fmt_create_A(&format, arena, &fmtA), "create format"); - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - cdie(mmqa_pool_create_chain(&pool, arena, mps_class_amc(), format, chain), - "create pool"); - - die(mps_ap_create(&ap, pool, MPS_RANK_EXACT), "create ap"); - - while (mps_collections(arena) == 0) { - allocdumb(ap, 1024*256); - } - - mps_ap_destroy(ap); - - mps_pool_destroy(pool); - comment("Destroyed pool."); - - mps_chain_destroy(chain); - mps_fmt_destroy(format); - mps_root_destroy(root); - mps_thread_dereg(thread); - mps_arena_destroy(arena); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/150.c b/mps/qa/function/150.c deleted file mode 100644 index 28ec59e260a..00000000000 --- a/mps/qa/function/150.c +++ /dev/null @@ -1,326 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!150.c(trunk.6) $ - summary = finalization and collection stats - language = c - link = testlib.o rankfmt.o -OUTPUT_SPEC - count1 < 50 - count2 < 50 - collect = true - collect_not_condemned = 0 - result = pass -END_HEADER -*/ - -#include "testlib.h" -#include "mpscawl.h" -#include "mpscamc.h" -#include "mpsavm.h" -#include "rankfmt.h" - - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - - -void *stackpointer; - -mps_arena_t arena; - -int final_count = 0; - - -enum { - FINAL_DISCARD, - FINAL_REREGISTER, - FINAL_STORE, - FINAL_QUEUE -}; - - -mps_message_t mqueue[10000]; - -int qhd = 0; -int qtl = 0; - - -static void nq(mps_message_t mess) -{ - mqueue[qhd] = mess; - qhd = (qhd+1) % 10000; - asserts(qhd != qtl, "No space in message queue."); -} - - -static int qmt(void) -{ - if (qhd == qtl) { - return 1; - } else { - return 0; - } -} - - -static int dq(mps_message_t *mess) -{ - if (qhd == qtl) { - return 0; - } else { - *mess = mqueue[qtl]; - qtl = (qtl+1) % 10000; - return 1; - } -} - - -static void process_mess(mps_message_t message, int faction, mps_addr_t *ref) -{ - mps_addr_t ffref; - - switch (faction) { - case FINAL_DISCARD: - mps_message_discard(arena, message); - break; - case FINAL_REREGISTER: - mps_message_finalization_ref(&ffref, arena, message); - mps_finalize(arena, &ffref); - final_count +=1; - mps_message_discard(arena, message); - break; - case FINAL_STORE: - mps_message_finalization_ref(ref, arena, message); - mps_message_discard(arena, message); - break; - case FINAL_QUEUE: - nq(message); - break; - default: - asserts(0, "Unknown finalization action."); - } -} - - -static void qpoll(mycell **ref, int faction) -{ - mps_message_t message; - - if (dq(&message)) { - process_mess(message, faction, (mps_addr_t*)ref); - } -} - - -static void process_stats(mps_message_t message) -{ - report("collect", "true"); - report("collect_live", "%ld", - mps_message_gc_live_size(arena, message)); - report("collect_condemned", "%ld", - mps_message_gc_condemned_size(arena, message)); - report("collect_not_condemned", "%ld", - mps_message_gc_not_condemned_size(arena, message)); - mps_message_discard(arena, message); -} - - -static void messagepoll(mycell **ref, int faction) -{ - mps_message_t message; - - if (mps_message_get(&message, arena, mps_message_type_finalization())) { - final_count -=1; - process_mess(message, faction, (mps_addr_t*)ref); - } - if (mps_message_get(&message, arena, mps_message_type_gc())) { - process_stats(message); - } -} - - -#define clear(type, var) (*((volatile type*)&(var)) = NULL) - - -static void test(void) -{ - mps_pool_t poolamc, poolawl, poollo; - mps_thr_t thread; - mps_root_t root0, root1; - - mps_chain_t chain; - mps_fmt_t format; - mps_ap_t apamc, apawl, aplo; - - mycell *a, *b, *c, *d, *z; - - long int j; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t)(1024*1024*40)), - "create arena"); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - cdie(mps_root_create_reg(&root0, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie(mps_root_create_table(&root1, arena, MPS_RANK_AMBIG, 0, - (mps_addr_t *)&exfmt_root, 1), - "create table root"); - - cdie(mps_fmt_create_A(&format, arena, &fmtA), - "create format"); - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - die(mmqa_pool_create_chain(&poolamc, arena, mps_class_amc(), format, chain), - "create pool(amc)"); - - die(mmqa_pool_create_chain(&poollo, arena, mps_class_amcz(), format, chain), - "create pool(amcz)"); - - cdie(mps_pool_create(&poolawl, arena, mps_class_awl(), format), - "create pool(awl)"); - - cdie(mps_ap_create(&apawl, poolawl, MPS_RANK_WEAK), - "create ap(awl)"); - - cdie(mps_ap_create(&apamc, poolamc, MPS_RANK_EXACT), - "create ap(amc)"); - - cdie(mps_ap_create(&aplo, poollo, MPS_RANK_EXACT), - "create ap(amcz)"); - - mps_message_type_enable(arena, mps_message_type_finalization()); - mps_message_type_enable(arena, mps_message_type_gc()); - - /* register loads of objects for finalization (1000*4) */ - - a = allocone(apamc, 2, 1); - b = a; - - for (j=0; j<1000; j++) { - a = allocone(apamc, 2, MPS_RANK_EXACT); - c = allocone(apawl, 2, MPS_RANK_WEAK); - d = allocone(aplo, 2, MPS_RANK_EXACT); /* rank irrelevant here! */ - mps_finalize(arena, (mps_addr_t*)&a); - mps_finalize(arena, (mps_addr_t*)&c); - mps_finalize(arena, (mps_addr_t*)&d); - mps_finalize(arena, (mps_addr_t*)&d); - final_count += 4; - setref(a, 0, b); - setref(a, 1, c); - setref(c, 1, d); - b = a; - } - - /* throw them all away and collect everything */ - - clear(mycell*, a); - clear(mycell*, b); - clear(mycell*, c); - clear(mycell*, d); - clear(mycell*, exfmt_root); - - for (j=0; j<5; j++) { - mps_arena_collect(arena); - - while (mps_message_poll(arena)) { - messagepoll(&z, FINAL_DISCARD); - } - } - - /* how many are left? (n.b. ideally this would be 0 but - there's no guarantee) - */ - report("count1", "%i", final_count); - - /* now to test leaving messages open for a long time! */ - - for (j=0; j<10; j++) { - comment("%d of 10", j); - a = allocone(apamc, 10000, MPS_RANK_EXACT); - mps_finalize(arena, (mps_addr_t*)&a); - final_count +=1; - comment("finalize"); - messagepoll(&z, FINAL_QUEUE); - } - - comment("reregister"); - - for (j=0; j<10; j++) { - comment("%d of 10", j); - qpoll(&z, FINAL_REREGISTER); - } - - b = a; - z = a; - - for (j=0; j<10; j++) { - comment("%d of 10", j); - messagepoll(&z, FINAL_QUEUE); - qpoll(&z, FINAL_STORE); - a = allocone(apamc, 2, MPS_RANK_EXACT); - setref(z, 0, b); - setref(a, 1, z); - b = a; - } - - - for (j=0; j<10; j++) { - a = allocone(apamc, 2, MPS_RANK_EXACT); - qpoll(&z, FINAL_DISCARD); - messagepoll(&z, FINAL_DISCARD); - setref(a, 0, b); - b = a; - } - - /* Force old objects to be killed */ - - while (qmt() == 0) { - qpoll(&z, FINAL_DISCARD); - } - - while (mps_message_poll(arena)) { - messagepoll(&z, FINAL_DISCARD); - } - - mps_root_destroy(root0); - mps_root_destroy(root1); - comment("Destroyed roots."); - - mps_ap_destroy(apawl); - mps_ap_destroy(apamc); - mps_ap_destroy(aplo); - comment("Destroyed aps."); - - mps_arena_collect(arena); - comment("Collected arena."); - - while (mps_message_poll(arena)) { - messagepoll(&z, FINAL_DISCARD); - } - - report("count2", "%d", final_count); - - mps_pool_destroy(poolamc); - mps_pool_destroy(poolawl); - mps_pool_destroy(poollo); - mps_chain_destroy(chain); - mps_fmt_destroy(format); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/151.c b/mps/qa/function/151.c deleted file mode 100644 index f3b8c6e611e..00000000000 --- a/mps/qa/function/151.c +++ /dev/null @@ -1,84 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = SNC pop-to-NULL test (request.dylan.170602) - language = c - link = testlib.o rankfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscsnc.h" -#include "mpsavm.h" -#include "rankfmt.h" - -#define THIRTY_MEG (30uL*1024ul*1024ul) -#define OBJSIZE (1024*1024*1) -#define ITERATIONS (100) - -static void test(void) -{ - int i = 0; - mps_ap_t sap; - mps_arena_t arena; - mps_fmt_t format; - mps_pool_t spool; - mps_thr_t thread; - mps_frame_t frame; - mycell *p; - -/* create an arena that can't grow beyond 30 M */ - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t)THIRTY_MEG), - "create arena"); - cdie(mps_arena_commit_limit_set(arena, (size_t)THIRTY_MEG), - "commit limit set"); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie( - mps_fmt_create_A(&format, arena, &fmtA), - "create format"); - - cdie( - mps_pool_create(&spool, arena, mps_class_snc(), format), - "create SNC pool"); - - cdie( - mps_ap_create(&sap, spool, MPS_RANK_EXACT), - "create ap"); - -/* repeatedly push, alloc 1MB object, and pop to first stack frame. - This shouldn't use much more than 1MB of memory. -*/ - - for (i=0; i < ITERATIONS; i++) { - die(mps_ap_frame_push(&frame, sap), "push"); - p = allocdumb(sap, OBJSIZE, MPS_RANK_EXACT); - die(mps_ap_frame_pop(sap, frame), "pop"); - comment("%i of %i", i, ITERATIONS); - } - - mps_ap_destroy(sap); - comment("Destroyed ap."); - - mps_pool_destroy(spool); - comment("Destroyed pool."); - - mps_fmt_destroy(format); - comment("Destroyed format."); - - mps_thread_dereg(thread); - comment("Deregistered thread."); - - mps_arena_destroy(arena); - comment("Destroyed arena."); - -} - -int main(void) -{ - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/152.c b/mps/qa/function/152.c deleted file mode 100644 index f5ea15e04d5..00000000000 --- a/mps/qa/function/152.c +++ /dev/null @@ -1,124 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!152.c(trunk.2) $ - summary = SNC scanning test - language = c - link = testlib.o rankfmt.o -OUTPUT_SPEC - inc1 = 1 - inc2 = 0 - result = pass -END_HEADER -*/ - -/* This test was derived from MMQA_test_function!148.c */ - -/* This test uses an AMC pool and an SNC pool, with objects in the SNC - pool keeping objects in the ANC pool alive. No ambiguous roots, so we - can tell exactly what's been scanned and check that the SNC pool is - working properly. -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "mpscsnc.h" -#include "mpsavm.h" -#include "rankfmt.h" - - -#define ARENA_SIZE (100ul*1024ul*1024ul) -#define BIGSIZE (10ul*1024*1024) -#define SMALLSIZE (4096) - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - - -static void test(void) -{ - mps_ap_t ap, sap; - mps_arena_t arena; - mps_fmt_t format; - mps_chain_t chain; - mps_pool_t pool, spool; - mps_thr_t thread; - mps_frame_t frame1; - mycell *p, *q; - size_t com, com1; - - formatcomments=1; - alloccomments=1; - fixcomments=1; - - /* create an arena (no particular size limit) */ - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t)ARENA_SIZE), - "create arena"); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - - /* because we know objects in the stack pool don't move, - we can do without roots. Hooray! */ - - cdie(mps_fmt_create_A(&format, arena, &fmtA), "create format"); - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - die(mmqa_pool_create_chain(&pool, arena, mps_class_amc(), format, chain), - "create AMC pool"); - cdie(mps_ap_create(&ap, pool, MPS_RANK_EXACT), "create ap"); - cdie(mps_pool_create(&spool, arena, mps_class_snc(), format), - "create SNC pool"); - cdie(mps_ap_create(&sap, spool, MPS_RANK_EXACT), "create ap"); - - /* push, alloc, check object is scanned */ - - com = mps_arena_committed(arena); - report("com", "%ld", com); - cdie(mps_ap_frame_push(&frame1, sap), "push"); - p = allocone(sap, 2, MPS_RANK_EXACT); - q = allocdumb(ap, BIGSIZE, MPS_RANK_EXACT); - setref(p, 0, q); - q = allocdumb(ap, SMALLSIZE, MPS_RANK_EXACT); - report("com", "%ld", mps_arena_committed(arena)); - comment("collect..."); - mps_arena_collect(arena); - com1 = mps_arena_committed(arena); - mps_arena_release(arena); - report("com", "%ld", com1); - report("inc1", "%d", (com1-com)/BIGSIZE); - - /* pop, check object isn't scanned */ - - cdie(mps_ap_frame_pop(sap, frame1), "pop"); - p = allocone(sap, 2, MPS_RANK_EXACT); - comment("collect..."); - mps_arena_collect(arena); - com1 = mps_arena_committed(arena); - mps_arena_release(arena); - report("com", "%ld", com1); - report("inc2", "%ld", (com1-com)/BIGSIZE); - - mps_ap_destroy(ap); - mps_ap_destroy(sap); - comment("Destroyed ap."); - - mps_pool_destroy(pool); - mps_pool_destroy(spool); - comment("Destroyed pool."); - - mps_chain_destroy(chain); - mps_fmt_destroy(format); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/153.c b/mps/qa/function/153.c deleted file mode 100644 index 4d607e21e27..00000000000 --- a/mps/qa/function/153.c +++ /dev/null @@ -1,83 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = SNC pop-to-NULL test parameterised (request.dylan.170602) - language = c - link = testlib.o rankfmt.o - parameters = OBJSIZE=(1024) ITERATIONS=(1000) -END_HEADER -*/ - -#include "testlib.h" -#include "mpscsnc.h" -#include "mpsavm.h" -#include "rankfmt.h" - -#define THIRTY_MEG (30uL*1024ul*1024ul) - -static void test(void) -{ - int i = 0; - mps_ap_t sap; - mps_arena_t arena; - mps_fmt_t format; - mps_pool_t spool; - mps_thr_t thread; - mps_frame_t frame; - mycell *p; - -/* create an arena that can't grow beyond 30 M */ - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t)THIRTY_MEG), - "create arena"); - cdie(mps_arena_commit_limit_set(arena, (size_t)THIRTY_MEG), - "commit limit set"); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie( - mps_fmt_create_A(&format, arena, &fmtA), - "create format"); - - cdie( - mps_pool_create(&spool, arena, mps_class_snc(), format), - "create SNC pool"); - - cdie( - mps_ap_create(&sap, spool, MPS_RANK_EXACT), - "create ap"); - -/* repeatedly push, alloc 1MB object, and pop to first stack frame. - This shouldn't use much more than 1MB of memory. -*/ - - for (i=0; i < ITERATIONS; i++) { - die(mps_ap_frame_push(&frame, sap), "push"); - p = allocdumb(sap, OBJSIZE, MPS_RANK_EXACT); - die(mps_ap_frame_pop(sap, frame), "pop"); - comment("%i of %i", i, ITERATIONS); - } - - mps_ap_destroy(sap); - comment("Destroyed ap."); - - mps_pool_destroy(spool); - comment("Destroyed pool."); - - mps_fmt_destroy(format); - comment("Destroyed format."); - - mps_thread_dereg(thread); - comment("Deregistered thread."); - - mps_arena_destroy(arena); - comment("Destroyed arena."); - -} - -int main(void) -{ - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/154.c b/mps/qa/function/154.c deleted file mode 100644 index 418e42aff43..00000000000 --- a/mps/qa/function/154.c +++ /dev/null @@ -1,73 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!154.c(trunk.1) $ - summary = EPVM allocate and epvm_collect, once only - language = c - link = testlib.o epvmfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscepvm.h" -#include "mpsavm.h" -#include "epvmfmt.h" - -#define MAX_SAVE 1000 -#define INIT_SAVE 12 - -void *stackpointer; - -static void test(void) -{ - mps_arena_t arena; - mps_thr_t thread; - - mps_fmt_t format; - - mps_pool_t pool1; - mps_ap_t ap1s; - - int j; - - psobj *a; - -/* create an arena that can't grow beyond 64M */ - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t) (1024*1024*64)), - "create arena"); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie(mps_fmt_create_A(&format, arena, &fmtepvm), "create format"); - - cdie(mps_pool_create(&pool1, arena, mps_class_epvm(), - format, MAX_SAVE, INIT_SAVE), "create pool1"); - - cdie(mps_ap_create(&ap1s, pool1, 0), "create ap1s"); - - for (j=0; j<3000; j++) { - a = allocepvm(ap1s, (size_t) (8+8*ranint(500))); - } - comment("collecting..."); - mps_epvm_collect(pool1); - - mps_ap_destroy(ap1s); - mps_pool_destroy(pool1); - mps_fmt_destroy(format); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena"); - -} - -int main(void) { - void *m; - stackpointer=&m; - - easy_tramp(test); - pass(); - return 0; -} - - - diff --git a/mps/qa/function/155.c b/mps/qa/function/155.c deleted file mode 100644 index 8cf8bdfac7d..00000000000 --- a/mps/qa/function/155.c +++ /dev/null @@ -1,64 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!155.c(trunk.1) $ - summary = EPDL fenceposting check - language = c - link = testlib.o -OUTPUT_SPEC - assert = true - assertfile P= dbgpool.c -END_HEADER -*/ - -#include "testlib.h" -#include "mpscepdl.h" -#include "mpsavm.h" - -void *stackpointer; -mps_arena_t arena; - -static mps_pool_debug_option_s debugOpts = {(void *)"bibblebo", 8}; - -static void test(void) { - mps_thr_t thread; - mps_pool_t pool; - mps_addr_t a; - char *c; - - cdie(mps_arena_create(&arena, mps_arena_class_vmnz(), - (size_t) (1024*1024*50)), "create arena"); - cdie(mps_thread_reg(&thread, arena), "register thread"); - - die( - mps_pool_create(&pool, arena, mps_class_epdl_debug(), &debugOpts, - 8192, 8, 8), - "create MVFF pool"); - - die(mps_alloc(&a, pool, 64), "alloc a"); - - c = a; - c -= 1; - *c = 0; - - mps_pool_check_fenceposts(pool); - comment("Fencepost check."); - - c += 67; - *c = 0; - - mps_pool_check_fenceposts(pool); - comment("Fencepost check."); - - mps_pool_destroy(pool); - mps_thread_dereg(thread); - mps_arena_destroy(arena); -} - -int main(void) { - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/156.c b/mps/qa/function/156.c deleted file mode 100644 index a5fc544fbfe..00000000000 --- a/mps/qa/function/156.c +++ /dev/null @@ -1,58 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!156.c(trunk.2) $ - summary = EPDL fenceposting check: subfree - language = c - link = testlib.o -OUTPUT_SPEC - assert = true - assertfile P= dbgpool.c - assertcond = fencepost check on free -END_HEADER -*/ - -#include "testlib.h" -#include "mpscepdl.h" -#include "mpsavm.h" - - -void *stackpointer; -mps_arena_t arena; - -static mps_pool_debug_option_s debugOpts = {(void *)"bibblebo", 8}; - - -static void test(void) -{ - mps_thr_t thread; - mps_pool_t pool; - mps_addr_t a; - - cdie(mps_arena_create(&arena, mps_arena_class_vmnz(), - (size_t) (1024*1024*50)), "create arena"); - cdie(mps_thread_reg(&thread, arena), "register thread"); - - die( - mps_pool_create(&pool, arena, mps_class_epdl_debug(), &debugOpts, - 8192, 8, 8), - "create MVFF pool"); - - die(mps_alloc(&a, pool, 64), "alloc a"); - - mps_free(pool, a, 32); - - mps_pool_destroy(pool); - mps_thread_dereg(thread); - mps_arena_destroy(arena); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/157.c b/mps/qa/function/157.c deleted file mode 100644 index 6f16a4be606..00000000000 --- a/mps/qa/function/157.c +++ /dev/null @@ -1,57 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = EPDL fenceposting check: free - language = c - link = testlib.o -OUTPUT_SPEC - assert = true - assertcond = fencepost check on free -END_HEADER -*/ - -#include "testlib.h" -#include "mpscepdl.h" -#include "mpsavm.h" - -void *stackpointer; -mps_arena_t arena; - -static mps_pool_debug_option_s debugOpts = {(void *)"bibblebo", 8}; - -static void test(void) { - mps_thr_t thread; - mps_pool_t pool; - mps_addr_t a; - char * c; - - cdie(mps_arena_create(&arena, mps_arena_class_vmnz(), - (size_t) (1024*1024*50)), "create arena"); - cdie(mps_thread_reg(&thread, arena), "register thread"); - - die( - mps_pool_create(&pool, arena, mps_class_epdl_debug(), &debugOpts, - 8192, 8, 8), - "create MVFF pool"); - - die(mps_alloc(&a, pool, 63), "alloc a"); - - c = a; - c += 63; - *c = 0; - - mps_free(pool, a, 63); - - mps_pool_destroy(pool); - mps_thread_dereg(thread); - mps_arena_destroy(arena); -} - -int main(void) { - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/158.c b/mps/qa/function/158.c deleted file mode 100644 index b945916e053..00000000000 --- a/mps/qa/function/158.c +++ /dev/null @@ -1,53 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!158.c(trunk.2) $ - summary = MVFF fenceposting check: subfree - language = c - link = testlib.o -OUTPUT_SPEC - assert = true - assertfile P= dbgpool.c - assertcond = fencepost check on free -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmvff.h" -#include "mpsavm.h" - -void *stackpointer; -mps_arena_t arena; - -static mps_pool_debug_option_s debugOpts = {(void *)"bibblebo", 8}; - -static void test(void) { - mps_thr_t thread; - mps_pool_t pool; - mps_addr_t a; - - cdie(mps_arena_create(&arena, mps_arena_class_vmnz(), - (size_t) (1024*1024*50)), "create arena"); - cdie(mps_thread_reg(&thread, arena), "register thread"); - - die( - mps_pool_create(&pool, arena, mps_class_mvff_debug(), &debugOpts, - 8192, 8, 8, 1, 0, 0), - "create MVFF pool"); - - die(mps_alloc(&a, pool, 64), "alloc a"); - - mps_free(pool, a, 32); - - mps_pool_destroy(pool); - mps_thread_dereg(thread); - mps_arena_destroy(arena); -} - -int main(void) { - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/159.c b/mps/qa/function/159.c deleted file mode 100644 index 09d0dd98b08..00000000000 --- a/mps/qa/function/159.c +++ /dev/null @@ -1,57 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = MVFF fenceposting check: free - language = c - link = testlib.o -OUTPUT_SPEC - assert = true - assertcond = fencepost check on free -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmvff.h" -#include "mpsavm.h" - -void *stackpointer; -mps_arena_t arena; - -static mps_pool_debug_option_s debugOpts = {(void *)"bibblebo", 8}; - -static void test(void) { - mps_thr_t thread; - mps_pool_t pool; - mps_addr_t a; - char * c; - - cdie(mps_arena_create(&arena, mps_arena_class_vmnz(), - (size_t) (1024*1024*50)), "create arena"); - cdie(mps_thread_reg(&thread, arena), "register thread"); - - die( - mps_pool_create(&pool, arena, mps_class_mvff_debug(), &debugOpts, - 8192, 8, 8, 0, 1, 0), - "create MVFF pool"); - - die(mps_alloc(&a, pool, 63), "alloc a"); - - c = a; - c += 63; - *c = 0; - - mps_free(pool, a, 63); - - mps_pool_destroy(pool); - mps_thread_dereg(thread); - mps_arena_destroy(arena); -} - -int main(void) { - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/16.c b/mps/qa/function/16.c deleted file mode 100644 index 29a394ca533..00000000000 --- a/mps/qa/function/16.c +++ /dev/null @@ -1,112 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!16.c(trunk.5) $ - summary = regression test for scan of invalid obj after I=A - language = c - link = testlib.o newfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "mpsavm.h" -#include "newfmt.h" - - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - - -void *stackpointer; - - -static void test(void) -{ - mps_arena_t arena; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_ap_t apA, apB; - mps_fmt_t format; - mps_chain_t chain; - - mycell *ambigref; - - size_t bytes; - size_t alignment; - mps_addr_t q; - - mps_word_t i; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), mmqaArenaSIZE), - "create arena"); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie(mps_root_create_reg(&root, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie(mps_fmt_create_A(&format, arena, &fmtA), "create format"); - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - cdie(mmqa_pool_create_chain(&pool, arena, mps_class_amc(), format, chain), - "create pool"); - - die(mps_ap_create(&apA, pool, MPS_RANK_EXACT), "create apA"); - die(mps_ap_create(&apB, pool, MPS_RANK_EXACT), "create apB"); - - bytes = offsetof(struct data, ref)+sizeof(struct refitem); - alignment = MPS_PF_ALIGN; - bytes = (bytes+alignment-1)&~(alignment-1); - die(mps_reserve(&q, apB, bytes), "reserve: "); - - comment("Reserve"); - ambigref = q; - ambigref->data.tag = MCdata; - ambigref->data.id = MCerrorid; - ambigref->data.numrefs = 0; - ambigref->data.size = bytes; - - i = mps_collections(arena)+2; - - while ((unsigned) mps_collections(arena) < i) { - allocdumb(apA, 1024*256); - } - - apB->init = apB->alloc; - - while (mps_collections(arena) < i+2) { - allocdumb(apA, 1024*256); - } - - asserts((apB->limit != 0 || mps_ap_trip(apB, q, bytes))==0, - "Commit succeeded!"); - - comment("Finished"); - - mps_ap_destroy(apA); - mps_ap_destroy(apB); - - mps_pool_destroy(pool); - mps_chain_destroy(chain); - mps_fmt_destroy(format); - mps_root_destroy(root); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/160.c b/mps/qa/function/160.c deleted file mode 100644 index a59376a6686..00000000000 --- a/mps/qa/function/160.c +++ /dev/null @@ -1,64 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!160.c(trunk.1) $ - summary = MV fenceposting check - language = c - link = testlib.o -OUTPUT_SPEC - assert = true - assertfile P= dbgpool.c -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmv.h" -#include "mpsavm.h" - -void *stackpointer; -mps_arena_t arena; - -static mps_pool_debug_option_s debugOpts = {(void *)"bibblebo", 8}; - -static void test(void) { - mps_thr_t thread; - mps_pool_t pool; - mps_addr_t a; - char *c; - - cdie(mps_arena_create(&arena, mps_arena_class_vmnz(), - (size_t) (1024*1024*50)), "create arena"); - cdie(mps_thread_reg(&thread, arena), "register thread"); - - die( - mps_pool_create(&pool, arena, mps_class_mv_debug(), &debugOpts, - 8192, 8, 65536), - "create MVFF pool"); - - die(mps_alloc(&a, pool, 64), "alloc a"); - - c = a; - c -= 1; - *c = 0; - - mps_pool_check_fenceposts(pool); - comment("Fencepost check."); - - c += 67; - *c = 0; - - mps_pool_check_fenceposts(pool); - comment("Fencepost check."); - - mps_pool_destroy(pool); - mps_thread_dereg(thread); - mps_arena_destroy(arena); -} - -int main(void) { - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/161.c b/mps/qa/function/161.c deleted file mode 100644 index d0d87ccda3c..00000000000 --- a/mps/qa/function/161.c +++ /dev/null @@ -1,58 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!161.c(trunk.2) $ - summary = MV fenceposting check: subfree - language = c - link = testlib.o -OUTPUT_SPEC - assert = true - assertfile P= dbgpool.c - assertcond = fencepost check on free -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmv.h" -#include "mpsavm.h" - - -void *stackpointer; -mps_arena_t arena; - -static mps_pool_debug_option_s debugOpts = {(void *)"bibblebo", 8}; - - -static void test(void) -{ - mps_thr_t thread; - mps_pool_t pool; - mps_addr_t a; - - cdie(mps_arena_create(&arena, mps_arena_class_vmnz(), - (size_t) (1024*1024*50)), "create arena"); - cdie(mps_thread_reg(&thread, arena), "register thread"); - - die( - mps_pool_create(&pool, arena, mps_class_mv_debug(), &debugOpts, - 8192, 8, 65536), - "create MVFF pool"); - - die(mps_alloc(&a, pool, 64), "alloc a"); - - mps_free(pool, a, 32); - - mps_pool_destroy(pool); - mps_thread_dereg(thread); - mps_arena_destroy(arena); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/162.c b/mps/qa/function/162.c deleted file mode 100644 index 5753fd1aeac..00000000000 --- a/mps/qa/function/162.c +++ /dev/null @@ -1,57 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = MV fenceposting check: free - language = c - link = testlib.o -OUTPUT_SPEC - assert = true - assertcond = fencepost check on free -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmv.h" -#include "mpsavm.h" - -void *stackpointer; -mps_arena_t arena; - -static mps_pool_debug_option_s debugOpts = {(void *)"bibblebo", 8}; - -static void test(void) { - mps_thr_t thread; - mps_pool_t pool; - mps_addr_t a; - char * c; - - cdie(mps_arena_create(&arena, mps_arena_class_vmnz(), - (size_t) (1024*1024*50)), "create arena"); - cdie(mps_thread_reg(&thread, arena), "register thread"); - - die( - mps_pool_create(&pool, arena, mps_class_mv_debug(), &debugOpts, - 8192, 8, 65536), - "create MVFF pool"); - - die(mps_alloc(&a, pool, 63), "alloc a"); - - c = a; - c += 63; - *c = 0; - - mps_free(pool, a, 63); - - mps_pool_destroy(pool); - mps_thread_dereg(thread); - mps_arena_destroy(arena); -} - -int main(void) { - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/163.c b/mps/qa/function/163.c deleted file mode 100644 index 0f79ad23cfd..00000000000 --- a/mps/qa/function/163.c +++ /dev/null @@ -1,106 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!137.c(trunk.2) $ - summary = MVFF emergency list test, using _grain_ list - language = c - link = testlib.o -END_HEADER -*/ - -/* MVFF will put free blocks on emergency lists if it cannot allocate - in the CBS. There is a bug in anchovy.1 in which having more than one - block on the emergency lists that's bigger than a segment will cause - an assertion to fire when the emergency lists are flushed. - - - set commit limit - - allocate (a) lots of small objects - (b) lots of big objects (until can do no more) - - free a goodly number of non-adjacent small objects, so that - we start to use emergency lists - - free lots of non-adjacent big objects - - raise commit limit - - free or alloc to make CBS flush lists -*/ - -#include "testlib.h" -#include "mpscmvff.h" -#include "mpsavm.h" - -#define COMLIMIT1 (10*1024*1024) -#define COMLIMIT2 (12*1024*1024) -#define SMALLSIZE (4) -#define NSMALL (4*1024) -#define BIGSIZE (8*1024) -#define EXTENDBY (8*1024) -#define MAXLARGE (10*1024) - -void *stackpointer; -mps_arena_t arena; - -static mps_addr_t - largeObjects[MAXLARGE], - smallObjects[NSMALL]; - -static void test(void) { - mps_thr_t thread; - mps_pool_t pool; - unsigned int i; - unsigned long nLarge; - - cdie(mps_arena_create(&arena, mps_arena_class_vmnz(), - (size_t) (1024*1024*50)), "create arena"); - cdie(mps_thread_reg(&thread, arena), "register thread"); - - mps_arena_commit_limit_set(arena, COMLIMIT1); - - die( - mps_pool_create(&pool, arena, mps_class_mvff(), - EXTENDBY, 8, 4, 0, 0, 1), - "create MVFF pool"); - - for (i = 0; i < NSMALL; i++) { - die(mps_alloc(&smallObjects[i], pool, SMALLSIZE), "small alloc failed"); - } - - nLarge = 0; - while (mps_alloc(&largeObjects[nLarge], pool, BIGSIZE) == MPS_RES_OK) { - nLarge ++; - } - - report("nLarge", "%lu", nLarge); - - for (i = 0; i < NSMALL; i += 2) { - mps_free(pool, smallObjects[i], SMALLSIZE); - } - - comment("Freed every other small object."); - - /* The CBS should be in emergency mode now. */ - - for (i = 0; i < nLarge; i += 2) { - mps_free(pool, largeObjects[i], BIGSIZE); - } - - comment("Freed every other large object."); - - /* Now there should be lots of big blocks on the CBS. */ - - mps_arena_commit_limit_set(arena, COMLIMIT2); - - comment("Raised the commit limit. Will attempt free and alloc."); - mps_free(pool, largeObjects[1], BIGSIZE); - die(mps_alloc(&largeObjects[0], pool, BIGSIZE), "alloc failed"); - - mps_pool_destroy(pool); - mps_thread_dereg(thread); - mps_arena_destroy(arena); -} - -int main(void) { - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/164.c b/mps/qa/function/164.c deleted file mode 100644 index f9a321b20db..00000000000 --- a/mps/qa/function/164.c +++ /dev/null @@ -1,184 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!207.c(trunk.3) $ - summary = MVFF low-memory test, 4-byte alignment and small objects - language = c - link = testlib.o -END_HEADER -*/ - -#include -#include "testlib.h" -#include "mpscmvff.h" -#include "mpsavm.h" - -#define MAXNUMBER 1000000 - -void *stackpointer; -mps_space_t space; - -mps_bool_t slotHigh, arenaHigh, firstFit; -int comments = 0; - -static struct {mps_addr_t addr; size_t size;} queue[MAXNUMBER]; - -enum {SEQ=0, RAN=1, SEQGAP=2, RANGAP=3, DUMMY=4}; -static char *tdesc[] = {"sequential", "random", - "sequential gap", "random gap", "dummy"}; - -static void setobj(mps_addr_t a, size_t size, unsigned char val) -{ - unsigned char *b; - b = a; - - commentif(comments, "Set %x, size %x = %i", b, size, (int) val); - while (size>0) - { - *b=val; - b++; - size--; - } -} - -static int chkobj(mps_addr_t a, size_t size, unsigned char val) -{ - unsigned char *b; - b = a; - - while (size>0) - { - /* comment("%p == %i", b, (int) val); - */ - if (*b != val) return 0; - b++; - size--; - } - return 1; -} - -static void dt(int kind, - size_t extendBy, size_t avgSize, size_t align, - size_t mins, size_t maxs, int number, int iter) -{ - mps_pool_t pool; - int i, hd; - clock_t time0, time1; - size_t size; - int secs; - - asserts(number <= MAXNUMBER, "number too big"); - - time0 = clock(); - asserts(time0 != -1, "processor time not available"); - - die( - mps_pool_create(&pool, space, mps_class_mvff(), - extendBy, avgSize, align, slotHigh, arenaHigh, firstFit), - "create MVFF pool"); - - for(hd=0; hd 0; comlimit -= 4*1024) { - mps_arena_commit_limit_set(space, comlimit); - report("limit", "%x", comlimit); - symm = ranint(8); - slotHigh = (symm >> 2) & 1; - arenaHigh = (symm >> 1) & 1; - firstFit = (symm & 1); - - mins = ranrange(1, 8); - - dt(RANGAP, 64*1024, 32, 4, mins, ranrange(mins, 1+mins*64), 1000, 100000); - } - - mps_thread_dereg(thread); - mps_arena_destroy(space); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/165.c b/mps/qa/function/165.c deleted file mode 100644 index 51e79034b31..00000000000 --- a/mps/qa/function/165.c +++ /dev/null @@ -1,110 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!165.c(trunk.1) $ - summary = simple spare_commit_limit test - language = c - link = testlib.o rankfmt.o - harness = 2.0 - parameters = EXTEND=65536 AVGSIZE=32 ALIGN=4 BIGSIZE=5000000; -OUTPUT_SPEC - reduce1 > 4000000 - reduce2 <= 0 - reduce3 > 4000000 - completed = yes -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmvff.h" -#include "mpsavm.h" - -#define MVFF_HI_PARMS EXTEND,AVGSIZE,ALIGN,1,1,0 -#define MVFF_LO_PARMS EXTEND,AVGSIZE,ALIGN,0,0,1 - -mps_arena_t arena; - -#define MAXOBJS (10000) - -mps_addr_t objs[MAXOBJS]; -mps_addr_t sizes[MAXOBJS]; - -static void test(void) -{ - mps_pool_t poolhi, poollo; - mps_thr_t thread; - - unsigned long com0, com1, com2; - -/* create a VM arena of 30MB */ - - cdie(mps_arena_create(&arena, mps_arena_class_vmnz(), (size_t) (1024*1024*40)), - "create arena"); - -/* set the commit limit to 100MB, i.e. let the arena do the limiting */ - - mps_arena_commit_limit_set(arena, (size_t) (1024ul*1024ul*100ul)); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie( - mps_pool_create(&poolhi, arena, mps_class_mvff(), MVFF_HI_PARMS), - "create high pool"); - - cdie( - mps_pool_create(&poollo, arena, mps_class_mvff(), MVFF_LO_PARMS), - "create low pool"); - -/* Set the spare commit limit to 0MB */ - - mps_arena_spare_commit_limit_set(arena, (size_t) 0); - die(mps_alloc(&objs[0], poollo, BIGSIZE), "alloc"); - com0 = mps_arena_committed(arena); - mps_free(poollo, objs[0], BIGSIZE); - com1 = mps_arena_committed(arena); - -/* the free should have reduced the total amount committed */ - report("reduce1", "%ld", com0-com1); - -/* Try again but with arena hysteresis */ - -/* nb. size_t unsigned, therefore (size_t)-1 is the maximum limit */ - mps_arena_spare_commit_limit_set(arena, (size_t)-1); - die(mps_alloc(&objs[0], poollo, BIGSIZE), "alloc"); - com0 = mps_arena_committed(arena); - mps_free(poollo, objs[0], BIGSIZE); - com1 = mps_arena_committed(arena); - -/* This time the free shouldn't make any difference */ - report("reduce2", "%ld", com0-com1); - -/* Reducing the spare committed limit should return most of the spare */ - mps_arena_spare_commit_limit_set(arena, (size_t)(1024*1024)); - com2 = mps_arena_committed(arena); - report("reduce3", "%ld", com0-com2); - - - - - - - comment("Finishing off."); - - mps_pool_destroy(poolhi); - mps_pool_destroy(poollo); - comment("Destroyed pool."); - - mps_thread_dereg(thread); - comment("Deregistered thread."); - - mps_arena_destroy(arena); - comment("Destroyed arena."); - -} - -int main(void) -{ - easy_tramp(test); - pass(); - return 0; -} - diff --git a/mps/qa/function/166.c b/mps/qa/function/166.c deleted file mode 100644 index ae5cd04923b..00000000000 --- a/mps/qa/function/166.c +++ /dev/null @@ -1,102 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!166.c(trunk.1) $ - summary = MVFF with AP split allocate from SW log (af_six) - language = c - link = testlib.o - stdin = af_six - harness = 2.0 - parameters = EXTEND=65536 AVGSIZE=32 ALIGN=8 \ - ARENAHIGH=1 SLOTHIGH=1 FIRST=1 SPLIT1=0 SPLIT2=0 -OUTPUT_SPEC - completed = yes -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmvff.h" -#include "mpsavm.h" - -#define MAXOBJS (30000) - -mps_addr_t objs[MAXOBJS]; -size_t sizes[MAXOBJS]; - -void *stackpointer; -mps_arena_t arena; - -static void test(void) -{ - mps_thr_t thread; - mps_ap_t ap1, ap2, ap3, ap; - mps_pool_t pool1, pool2, pool3, pool; - log_event event; - int id; - char *c; - size_t size; - unsigned long maxcom; - mps_res_t res; - - maxcom = 0; - cdie(mps_arena_create(&arena, mps_arena_class_vmnz(), (size_t) (1024*1024*100)), - "create space"); - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie(mps_pool_create(&pool1,arena,mps_class_mvff(), - EXTEND,AVGSIZE,ALIGN,ARENAHIGH,SLOTHIGH,FIRST), - "create pool1"); - cdie(mps_pool_create(&pool2,arena,mps_class_mvff(), - EXTEND,AVGSIZE,ALIGN,ARENAHIGH,SLOTHIGH,FIRST), - "create pool2"); - cdie(mps_pool_create(&pool3,arena,mps_class_mvff(), - EXTEND,AVGSIZE,ALIGN,ARENAHIGH,SLOTHIGH,FIRST), - "create pool3"); - cdie(mps_ap_create(&ap1,pool1), "ap 1"); - cdie(mps_ap_create(&ap2,pool2), "ap 2"); - cdie(mps_ap_create(&ap3,pool3), "ap 3"); - - - while (read_event(&event)) { - if (event.type == EVENT_ALLOC) { - id = event.alloc.id; - asserts(id < MAXOBJS, "MAXOBJS too small"); - size = ((event.alloc.size + ALIGN-1)|(ALIGN-1))^(ALIGN-1); - ap = (size < SPLIT1) ? ap1 : (size < SPLIT2) ? ap2 : ap3; - do { - MPS_RESERVE_BLOCK(res, objs[id], ap, size); - asserts(res == MPS_RES_OK, "alloc failed"); - } while (!mps_commit(ap, objs[id], size)); - sizes[id] = size; - c = objs[id]; - *c = 43; - } else if (event.type == EVENT_FREE) { - id = event.free.id; - size = sizes[id]; - pool = (size < SPLIT1) ? pool1 : (size < SPLIT2) ? pool2 : pool3; - mps_free(pool, objs[id], size); - } - size = mps_arena_committed(arena); - if (size > maxcom) maxcom=size; - } - report("maxcom", "%ld", maxcom); - - mps_ap_destroy(ap1); - mps_ap_destroy(ap2); - mps_ap_destroy(ap3); - mps_pool_destroy(pool1); - mps_pool_destroy(pool2); - mps_pool_destroy(pool3); - - mps_thread_dereg(thread); - mps_arena_destroy(arena); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/167.c b/mps/qa/function/167.c deleted file mode 100644 index 644b0dafc62..00000000000 --- a/mps/qa/function/167.c +++ /dev/null @@ -1,103 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!167.c(trunk.1) $ - summary = simple spare_commit_limit test - language = c - link = testlib.o rankfmt.o - harness = 2.0 - parameters = EXTEND=65536 AVGSIZE=32 ALIGN=4 BIGSIZE=5000000; -OUTPUT_SPEC - reduce1 <= 0 - completed = yes -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmvff.h" -#include "mpsavm.h" - -#define MVFF_HI_PARMS EXTEND,AVGSIZE,ALIGN,1,1,0 -#define MVFF_LO_PARMS EXTEND,AVGSIZE,ALIGN,0,0,1 - -mps_arena_t arena; - -#define MAXOBJS (10000) - -mps_addr_t objs[MAXOBJS]; -mps_addr_t sizes[MAXOBJS]; - -static void test(void) -{ - mps_pool_t poolhi, poollo; - mps_thr_t thread; - - unsigned long com0, com1; - -/* create a VM arena of 30MB */ - - cdie(mps_arena_create(&arena, mps_arena_class_vmnz(), (size_t) (1024*1024*40)), - "create arena"); - - -/* set the commit limit to 100MB, i.e. let the arena do the limiting */ - - mps_arena_commit_limit_set(arena, (size_t) (1024ul*1024ul*100ul)); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie( - mps_pool_create(&poolhi, arena, mps_class_mvff(), MVFF_HI_PARMS), - "create high pool"); - - cdie( - mps_pool_create(&poollo, arena, mps_class_mvff(), MVFF_LO_PARMS), - "create low pool"); - -/* set the spare commit limit to something very big */ - mps_arena_spare_commit_limit_set(arena, (size_t)-1); - -/* allocate a jolly big object, clamp the commit limit down, leaving - 64KB space, then free it */ - - die(mps_alloc(&objs[0], poollo, BIGSIZE), "alloc"); - com0 = mps_arena_committed(arena); - mps_arena_commit_limit_set(arena, com0+(1024*64)); - - mps_free(poollo, objs[0], BIGSIZE); - com1 = mps_arena_committed(arena); - -/* the free shouldn't have reduced the total amount committed */ - report("reduce1", "%ld", com0-com1); - -/* it should be possible to reallocate the object */ - die(mps_alloc(&objs[0], poollo, BIGSIZE), "alloc lo"); - - mps_free(poollo, objs[0], BIGSIZE); - -/* it should equally be possible to allocate an object in a different - segment (poolhi). This ought to flush the spare. */ - die(mps_alloc(&objs[0], poolhi, BIGSIZE), "alloc hi"); - - mps_free(poolhi, objs[0], BIGSIZE); - - comment("Finishing off."); - - mps_pool_destroy(poolhi); - mps_pool_destroy(poollo); - comment("Destroyed pool."); - - mps_thread_dereg(thread); - comment("Deregistered thread."); - - mps_arena_destroy(arena); - comment("Destroyed arena."); - -} - -int main(void) -{ - easy_tramp(test); - pass(); - return 0; -} - diff --git a/mps/qa/function/168.c b/mps/qa/function/168.c deleted file mode 100644 index 87d1f59879f..00000000000 --- a/mps/qa/function/168.c +++ /dev/null @@ -1,96 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!168.c(trunk.2) $ - summary = MVFF split allocate from SW log (af_six), with hysteresis control - language = c - link = testlib.o - stdin = af_six - parameters = EXTEND=65536 AVGSIZE=32 ALIGN=8 \ - ARENAHIGH=1 SLOTHIGH=1 FIRST=1 SPLIT1=0 SPLIT2=0 \ - COMMIT=30000000 SPARE=0 -OUTPUT_SPEC - result = pass -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmvff.h" -#include "mpsavm.h" - -#define MAXOBJS (30000) - -mps_addr_t objs[MAXOBJS]; -size_t sizes[MAXOBJS]; - -void *stackpointer; -mps_arena_t arena; - -static void test(void) -{ - mps_thr_t thread; - mps_pool_t pool1, pool2, pool3, pool; - log_event event; - int id; - char *c; - size_t size; - unsigned long maxcom; - - maxcom = 0; - cdie(mps_arena_create(&arena, mps_arena_class_vmnz(), (size_t) (1024*1024*100)), - "create space"); - cdie(mps_thread_reg(&thread, arena), "register thread"); - - mps_arena_commit_limit_set(arena, COMMIT); - mps_arena_spare_commit_limit_set(arena, SPARE); - - cdie(mps_pool_create(&pool1,arena,mps_class_mvff(), - EXTEND,AVGSIZE,ALIGN,ARENAHIGH,SLOTHIGH,FIRST), - "create pool1"); - cdie(mps_pool_create(&pool2,arena,mps_class_mvff(), - EXTEND,AVGSIZE,ALIGN,ARENAHIGH,SLOTHIGH,FIRST), - "create pool2"); - cdie(mps_pool_create(&pool3,arena,mps_class_mvff(), - EXTEND,AVGSIZE,ALIGN,ARENAHIGH,SLOTHIGH,FIRST), - "create pool3"); - - while (read_event(&event)) { - if (event.type == EVENT_ALLOC) { - id = event.alloc.id; - asserts(id < MAXOBJS, "MAXOBJS too small"); - size = event.alloc.size; - pool = (size < SPLIT1) ? pool1 : (size < SPLIT2) ? pool2 : pool3; - die(mps_alloc(&objs[id], pool, size), "alloc"); -/* - comment("%d %ld %p", id, size, objs[id]); -*/ - sizes[id] = size; - c = objs[id]; - *c = 43; - } else if (event.type == EVENT_FREE) { - id = event.free.id; - size = sizes[id]; - pool = (size < SPLIT1) ? pool1 : (size < SPLIT2) ? pool2 : pool3; - mps_free(pool, objs[id], size); - } - size = mps_arena_committed(arena); - if (size > maxcom) maxcom=size; - } - report("maxcom", "%ld", maxcom); - - mps_pool_destroy(pool1); - mps_pool_destroy(pool2); - mps_pool_destroy(pool3); - - mps_thread_dereg(thread); - mps_arena_destroy(arena); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/169.c b/mps/qa/function/169.c deleted file mode 100644 index e0141f53830..00000000000 --- a/mps/qa/function/169.c +++ /dev/null @@ -1,92 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!154.c(trunk.1) $ - summary = EPVM allocate smaller segment when big one doesn't fit - language = c - link = testlib.o epvmfmt.o - harness = 2.0 - parameters = RAISE=16384 -END_HEADER -*/ - -#include "testlib.h" -#include "mpscepvm.h" -#include "mpsavm.h" -#include "epvmfmt.h" - -#define MAX_SAVE 1000 -#define INIT_SAVE 12 - -void *stackpointer; - -static void test(void) -{ - mps_arena_t arena; - mps_thr_t thread; - - mps_fmt_t format; - - mps_pool_t pool1; - mps_ap_t ap1s; - - int j; - - psobj *a; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t) (1024*1024*64)), - "create arena"); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie(mps_fmt_create_A(&format, arena, &fmtepvm), "create format"); - - cdie(mps_pool_create(&pool1, arena, mps_class_epvm(), - format, MAX_SAVE, INIT_SAVE), "create pool1"); - - cdie(mps_ap_create(&ap1s, pool1, 0), "create ap1s"); - - /* allocate a bit to get us off the initial segment */ - - for (j=0; j<1024; j++) { - a = allocepvm(ap1s, 32); - } - - comment("initial allocation"); - - /* set commit limit to allow no more */ - - cdie(mps_arena_commit_limit_set(arena, mps_arena_committed(arena)), - "commit limit set"); - - /* and allocate 4KB objects until full */ - while(allocrepvm(&a, ap1s, 4096/8) == MPS_RES_OK) {}; - - /* raise commit limit by RAISE (default is 16KB) */ - - cdie(mps_arena_commit_limit_set(arena, mps_arena_committed(arena)+RAISE), - "commit limit raise"); - - /* and try to allocate one more object */ - - a = allocepvm(ap1s, 4096/8); - - mps_ap_destroy(ap1s); - mps_pool_destroy(pool1); - mps_fmt_destroy(format); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena"); - -} - -int main(void) { - void *m; - stackpointer=&m; - - easy_tramp(test); - pass(); - return 0; -} - - - diff --git a/mps/qa/function/17.c b/mps/qa/function/17.c deleted file mode 100644 index 0d7ebef76a8..00000000000 --- a/mps/qa/function/17.c +++ /dev/null @@ -1,63 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!17.c(trunk.6) $ - summary = create and destroy lots of pools (interleaved) - language = c - link = testlib.o newfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "mpsavm.h" -#include "newfmt.h" - - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - - -static void test(void) -{ - mps_arena_t arena; - mps_pool_t pool; - mps_pool_t pool1; - mps_thr_t thread; - mps_fmt_t format; - mps_chain_t chain; - - int p; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), mmqaArenaSIZE), - "create arena"); - die(mps_thread_reg(&thread, arena), "register thread"); - die(mps_fmt_create_A(&format, arena, &fmtA), "create format"); - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - die(mmqa_pool_create_chain(&pool1, arena, mps_class_amc(), format, chain), - "create pool"); - - for (p = 0; p < 10000; p++) { - die(mmqa_pool_create_chain(&pool, arena, mps_class_amc(), format, chain), - "create pool"); - comment("%i", p); - mps_pool_destroy(pool1); - pool1=pool; - } - - mps_pool_destroy(pool); - mps_chain_destroy(chain); - mps_fmt_destroy(format); - mps_thread_dereg(thread); - mps_arena_destroy(arena); -} - - -int main(void) -{ - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/170.c b/mps/qa/function/170.c deleted file mode 100644 index 581594d30da..00000000000 --- a/mps/qa/function/170.c +++ /dev/null @@ -1,230 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!170.c(trunk.2) $ - summary = spare_commit_limit tests - language = c - link = testlib.o rankfmt.o - harness = 2.1 - parameters = EXTEND=65536 AVGSIZE=32 ALIGN=4 \ - BIGSIZE=(5*1024*1024); -OUTPUT_SPEC - completed = yes - failed = no -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmvff.h" -#include "mpsavm.h" - - -#define MVFF_HI_PARMS EXTEND,AVGSIZE,ALIGN,1,1,0 -#define MVFF_LO_PARMS EXTEND,AVGSIZE,ALIGN,0,0,1 - - -enum { - SPARE_EMPTY, - SPARE_LESS, - SPARE_EXACT, - SPARE_MORE -}; - -enum { - COMMIT_EXACT, - COMMIT_NOCHANGE, - COMMIT_LITTLE, - COMMIT_PLENTY -}; - -enum { - OBJ_SMALL, - OBJ_BIG -}; - - -mps_arena_t arena; -mps_pool_t poollo, poolhi; -mps_addr_t objlo, objhi; - - -#define SMALL_SIZE 4096 -#define BIG_SIZE (1024ul*1024ul*10) - -#define DIFF_SIZE 65536 -#define HUGE (size_t)(1024ul*1024ul*100) - -#define SPARE_LIMIT HUGE -#define SPARE_ZERO 0 - - -static void t_alloc(int spare, int spare_total, int commit, int obj_size) { - size_t size, hisize, comsize, comlimit; - size_t spsize = 0, losize = 0; /* stop warnings */ - mps_res_t res, res_expected; - - if (obj_size == OBJ_SMALL) size = SMALL_SIZE; else size = BIG_SIZE; - - switch (spare_total) { - case SPARE_EMPTY: - spsize = 0; - break; - case SPARE_LESS: - if (size > DIFF_SIZE) { - spsize = size-DIFF_SIZE; - } else { - spsize = 0; - } - break; - case SPARE_EXACT: - spsize = size; - break; - case SPARE_MORE: - spsize = size+DIFF_SIZE; - break; - default: - error("Illegal spare.\n"); - break; - } - - switch (spare) { - case SPARE_EMPTY: - losize = 0; - break; - case SPARE_LESS: - if (size > DIFF_SIZE) { - losize = size-DIFF_SIZE; - } else { - losize = 0; - } - break; - case SPARE_EXACT: - losize = size; - break; - case SPARE_MORE: - losize = size+DIFF_SIZE; - break; - } - - if (losize > spsize) { - losize = spsize; - hisize = 0; - } else { - hisize = spsize-losize; - } - - /* turn off commit limit for a moment */ - mps_arena_commit_limit_set(arena, HUGE); - - /* create low and high pools */ - - die( - mps_pool_create(&poolhi, arena, mps_class_mvff(), MVFF_HI_PARMS), - "create high pool"); - - die( - mps_pool_create(&poollo, arena, mps_class_mvff(), MVFF_LO_PARMS), - "create low pool"); - - /* flush hysteresis fund, then set limit */ - - mps_arena_spare_commit_limit_set(arena, SPARE_ZERO); - mps_arena_spare_commit_limit_set(arena, SPARE_LIMIT); - - /* allocate something in each pool (to reduce risk of subsidiary - allocation being neede later */ - - die(mps_alloc(&objlo, poollo, EXTEND), "low alloc"); - die(mps_alloc(&objhi, poolhi, EXTEND), "high alloc"); - - /* set up spare committed the way we want it */ - - if (losize>0) { - die(mps_alloc(&objlo, poollo, losize), "low setup"); - mps_free(poollo, objlo, losize); - } - - if (hisize>0) { - die(mps_alloc(&objhi, poolhi, hisize), "high setup"); - mps_free(poolhi, objhi, hisize); - } - - /* spare is now set up correctly */ - /* now we need to set the commit limit correctly */ - - comsize = arena_committed_and_used(arena); - - /* allow for 1/16th memory overhead in setting commit limit */ - - if (commit == COMMIT_EXACT) { - comlimit = comsize+size+(size/16); - } else if (commit == COMMIT_NOCHANGE) { - comlimit = mps_arena_committed(arena); - } else if (commit == COMMIT_PLENTY) { - comlimit = HUGE; - } else /* commit == COMMIT_LITTLE */ { - if (size > DIFF_SIZE) { - comlimit = comsize+size+(size/16)+DIFF_SIZE; - } else { - comlimit = comsize+size+(size/16); - } - } - - die(mps_arena_commit_limit_set(arena, comlimit), "commit limit set"); - - res = mps_alloc(&objlo, poollo, size); - - asserts(comlimit >= comsize, "comlimit was less than comsize!"); - - if (size <= (comlimit-comsize)) { - res_expected = MPS_RES_OK; - } else { - res_expected = MPS_RES_COMMIT_LIMIT; - } - - if (res != res_expected) { - comment("Spare useful/total %i/%i. Limit %i. Size %i. Expected %s. Got %s", spare, spare_total, commit, obj_size, err_text(res_expected), err_text(res)); - report("failed", "yes"); - } - - mps_pool_destroy(poollo); - mps_pool_destroy(poolhi); -} - -static void test(void) -{ - mps_thr_t thread; - int spare, spare_total, commit, obj; - - /* create a VM arena of 100MB */ - - cdie(mps_arena_create(&arena,mps_arena_class_vmnz(),(size_t)(1024*1024*100)), - "create arena"); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - - report("failed", "no"); - - for (spare = SPARE_EMPTY; spare <= SPARE_MORE; spare++) { - for (spare_total = spare; spare_total <= SPARE_MORE; spare_total++) { - for (commit = COMMIT_EXACT; commit <= COMMIT_PLENTY; commit++) { - for (obj = OBJ_SMALL; obj <= OBJ_BIG; obj++) { - - t_alloc(spare, spare_total, commit, obj); - }}}} - - comment("Finishing off."); - - mps_thread_dereg(thread); - comment("Deregistered thread."); - - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/171.c b/mps/qa/function/171.c deleted file mode 100644 index 3a10f01f16b..00000000000 --- a/mps/qa/function/171.c +++ /dev/null @@ -1,161 +0,0 @@ -/* -TEST_HEADER - id = $HopeName:$ - summary = test of ramp allocation with tiny arena - language = c - link = testlib.o rankfmt.o - parameters = ARENA=1024*60 -OUTPUT_SPEC - result = pass -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "mpsavm.h" -#include "rankfmt.h" - -#define ARENALIMIT (ARENA) - -#define TABSIZE (50000) -#define ENTERRAMP (30000) -#define LEAVERAMP (100000) - -#define BACKSIZE (128) -#define BACKITER (32) -#define RAMPSIZE (128) - -#define ITERATIONS (1000000ul) - -#define RAMP_INTERFACE -/* -#define COLLECT_WORLD -*/ - -void *stackpointer; - -mps_space_t arena; -mps_pool_t poolamc; -mps_thr_t thread; -mps_root_t root, root1; - -mps_fmt_t format; -mps_ap_t apamc; - -static mps_addr_t objtab[TABSIZE]; - -static void alloc_back(void) { - long int i, j; - - for (j = 0; j < BACKITER; j++) { - i = ranint(ranint(ranint(ranint(TABSIZE)+1)+1)+1); - objtab[i] = allocdumb(apamc, BACKSIZE, MPS_RANK_EXACT); - } -} - - -static void test(void) { - long int i; - long int rsize; - - int inramp; - - mycell *r, *s; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), - (size_t) ARENALIMIT), - "create space"); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie( - mps_root_create_reg(&root, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_root_create_table(&root1, arena, MPS_RANK_EXACT, 0, &objtab[0], TABSIZE), - "create root table"); - - cdie( - mps_fmt_create_A(&format, arena, &fmtA), - "create format"); - - cdie( - mps_pool_create(&poolamc, arena, mps_class_amc(), format), - "create pool"); - - cdie( - mps_ap_create(&apamc, poolamc, MPS_RANK_EXACT), - "create ap"); - - inramp = 0; - - for (i = 0; i < ITERATIONS; i++) { - if (i % 10000 == 0) { - comment("%ld of %ld", i, ITERATIONS); - } - alloc_back(); - if (inramp) { - s = allocone(apamc, 3, MPS_RANK_EXACT); - setref(r, 0, s); - setref(s, 1, r); - r = s; - s = allocdumb(apamc, RAMPSIZE, MPS_RANK_EXACT); - setref(r, 2, s); - rsize ++; - if (ranint(LEAVERAMP) == 0) { - r = allocone(apamc, 2, MPS_RANK_EXACT); - s = allocone(apamc, 2, MPS_RANK_EXACT); -#ifdef RAMP_INTERFACE - mps_ap_alloc_pattern_end(apamc, mps_alloc_pattern_ramp()); -#endif -#ifdef COLLECT_WORLD - mps_arena_collect(arena); - mps_arena_release(arena); -#endif - comment("ramp end, %ld objects", rsize); - inramp = 0; - } - } else { - if (ranint(ENTERRAMP) == 0) { -#ifdef RAMP_INTERFACE - mps_ap_alloc_pattern_begin(apamc, mps_alloc_pattern_ramp()); -#endif - comment("ramp begin"); - r = allocone(apamc, 3, MPS_RANK_EXACT); - inramp = 1; - rsize = 0; - } - } - } - - mps_ap_destroy(apamc); - comment("Destroyed ap."); - - mps_pool_destroy(poolamc); - comment("Destroyed pool."); - - mps_fmt_destroy(format); - comment("Destroyed format."); - - mps_root_destroy(root1); - mps_root_destroy(root); - comment("Destroyed roots."); - - mps_thread_dereg(thread); - comment("Deregistered thread."); - - mps_arena_destroy(arena); - comment("Destroyed space."); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - report("result", "pass"); - return 0; -} diff --git a/mps/qa/function/172.c b/mps/qa/function/172.c deleted file mode 100644 index d56a029ce3b..00000000000 --- a/mps/qa/function/172.c +++ /dev/null @@ -1,68 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = Intern and Label telemetry events - language = c - link = testlib.o - stdin = af_six -OUTPUT_SPEC - result = pass -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmv.h" -#include "mpsavm.h" - -void *stackpointer; -mps_arena_t arena; - -static void test(void) -{ - mps_thr_t thread; - mps_pool_t pool; - mps_addr_t a; - int i; - - char str[] = " 0 MMQA interned symbol\t212 œ%)(*œ!)( "; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t) (1024*1024*10)), - "create space"); - - (void) mps_telemetry_control(0x7F, 0x7F); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie(mps_pool_create(&pool,arena,mps_class_mv(), 65536, 32, 65536), - "create pool"); - - mps_telemetry_label(NULL, mps_telemetry_intern("FOO")); - - for (i = 0; i < 20; i++) { - die(mps_alloc(&a, pool, 64), "alloc"); - } - - for (i = 0; i < 10; i++) { - die(mps_alloc(&a, pool, 128), "alloc"); - mps_telemetry_label(a, mps_telemetry_intern(str)); - str[1]++; - } - - for (i = 0; i < 20; i++) { - die(mps_alloc(&a, pool, 64), "alloc"); - } - - mps_pool_destroy(pool); - mps_thread_dereg(thread); - mps_arena_destroy(arena); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/173.c b/mps/qa/function/173.c deleted file mode 100644 index 000fd81dd6a..00000000000 --- a/mps/qa/function/173.c +++ /dev/null @@ -1,79 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - harness = 3.0 - summary = Get the last page in a chunk into the hysteresis fund - language = c - link = testlib.o - parameters = CHUNK_SIZE=(1024*1024) OBJ_FROM=(1024*1024*2) \ - OBJ_TO=(1024*1024*3) -OUTPUT_SPEC - completed = yes -END_HEADER -*/ - -/* This test was written to provoke the assertion in - request.epcore.160256 (Assertion failure while purging the - hysteresis fund.) - - drj suggested that the assertion would be provoked if we - arranged for an arena chunk to have less than one whole - page description on the last page occupied by the page table, - arranged for the page corresponding to this page description - to be in the hysteresis fund, and then purged the fund. - - This test attempts to cause this situation by creating an arena - with a small chunk size, allocating an object that's bigger - than the chunk size (hence causing a new chunk to be created), - freeing it, then destroying the arena again. We repeat with - different object sizes, until (we hope) eventually there is - only a partial page descriptor in the last page occupied by - the page table. - - We use an EPDR pool to increase the chance of the object covering - the last page (but it's a VM arena so we can't be sure what zones - will be used). Of course, the test is sensitive to the algorithm - by which the arena decides how big to make the new chunk. -*/ - -#include "testlib.h" -#include "mpsavm.h" -#include "mpscepdl.h" - -mps_arena_t arena; -mps_thr_t thread; -mps_root_t root; - -static void test(void) -{ - mps_pool_t pool; - mps_addr_t a; - size_t objsize; - - for (objsize = OBJ_FROM; objsize < OBJ_TO; objsize += 4096) { - - report("objsize", "%d", objsize); - - die(mps_arena_create(&arena, mps_arena_class_vm(), (size_t) CHUNK_SIZE), - "create arena with 1MB chunk size"); - die(mps_thread_reg(&thread, arena), "register thread"); - die(mps_pool_create(&pool, arena, mps_class_epdr(), 65536, 32, 8), - "create EPDR pool"); - - mps_arena_spare_commit_limit_set(arena, (size_t) OBJ_TO); - - die(mps_alloc(&a, pool, objsize), "alloc"); - mps_free(pool, a, objsize); - - mps_pool_destroy(pool); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - } -} - -int main(void) -{ - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/174.c b/mps/qa/function/174.c deleted file mode 100644 index c4dce0728b7..00000000000 --- a/mps/qa/function/174.c +++ /dev/null @@ -1,89 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = MV SAC allocate from SW log (af_six) - language = c - link = testlib.o - stdin = af_six - parameters = EXTEND=65536 AVGSIZE=32 MAXSIZE=256*1024 \ - SPLIT1=128 COUNT1=64 FREQ1=1 SPLIT2=1024 COUNT2=64 FREQ2=2 -OUTPUT_SPEC - result = pass -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmv.h" -#include "mpsavm.h" - -#define MAXOBJS (30000) - -mps_addr_t objs[MAXOBJS]; -size_t sizes[MAXOBJS]; - -void *stackpointer; -mps_arena_t arena; - -static void test(void) -{ - mps_thr_t thread; - mps_pool_t pool; - mps_sac_t sac; - log_event event; - int id; - char *c; - size_t size; - unsigned long maxcom; - mps_res_t res; - - struct mps_sac_classes_s sac_classes[] = { - { SPLIT1, COUNT1, FREQ1 }, - { SPLIT2, COUNT2, FREQ2 } - }; - - maxcom = 0; - cdie(mps_arena_create(&arena, mps_arena_class_vmnz(), (size_t) (1024*1024*100)), - "create space"); - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie(mps_pool_create(&pool,arena,mps_class_mv(),EXTEND,AVGSIZE,MAXSIZE), - "create pool"); - - cdie(mps_sac_create(&sac, pool, 2, sac_classes), "sac create"); - - while (read_event(&event)) { - if (event.type == EVENT_ALLOC) { - id = event.alloc.id; - asserts(id < MAXOBJS, "MAXOBJS too small"); - size = event.alloc.size; - MPS_SAC_ALLOC(res, objs[id], sac, size, 0); - asserts(res == MPS_RES_OK, "alloc"); - sizes[id] = size; - c = objs[id]; - *c = 43; - } else if (event.type == EVENT_FREE) { - id = event.free.id; - size = sizes[id]; - MPS_SAC_FREE(sac, objs[id], size); - } - size = mps_arena_committed(arena); - if (size > maxcom) maxcom=size; - } - report("maxcom", "%ld", maxcom); - - mps_sac_destroy(sac); - mps_pool_destroy(pool); - - mps_thread_dereg(thread); - mps_arena_destroy(arena); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/175.c b/mps/qa/function/175.c deleted file mode 100644 index 4ba64427fac..00000000000 --- a/mps/qa/function/175.c +++ /dev/null @@ -1,65 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - harness = 2.2 - summary = MV SAC create alloc free destroy - language = c - link = testlib.o - stdin = af_six - parameters = ITERATIONS=30000 OBJSIZE=1024*1024 EXTEND=65536 AVGSIZE=32 MAXSIZE=65536 -OUTPUT_SPEC - completed = yes -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmv.h" -#include "mpsavm.h" - -void *stackpointer; -mps_arena_t arena; - -static void test(void) -{ - mps_thr_t thread; - mps_pool_t pool; - mps_sac_t sac; - mps_res_t res; - void *p; - int i; - - struct mps_sac_classes_s sac_classes[] = { - { OBJSIZE, 30, 10 }, - }; - - cdie(mps_arena_create(&arena, mps_arena_class_vmnz(), (size_t) (1024*1024*100)), - "create space"); - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie(mps_pool_create(&pool,arena,mps_class_mv(),EXTEND,AVGSIZE,MAXSIZE), - "create pool"); - - for (i = 0; i < ITERATIONS; i++) { - if (i % 1000 == 0) comment("%d", i); - die(mps_sac_create(&sac, pool, 1, sac_classes), "sac create"); - MPS_SAC_ALLOC(res, p, sac, OBJSIZE, 0); - asserts(res == MPS_RES_OK, "alloc failed"); - MPS_SAC_FREE(sac, p, OBJSIZE); - mps_sac_destroy(sac); - } - - mps_pool_destroy(pool); - - mps_thread_dereg(thread); - mps_arena_destroy(arena); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/18.c b/mps/qa/function/18.c deleted file mode 100644 index 494281b0416..00000000000 --- a/mps/qa/function/18.c +++ /dev/null @@ -1,78 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!18.c(trunk.6) $ - summary = create lots of pools at once (and cause to run out of memory) - language = c - link = testlib.o newfmt.o -OUTPUT_SPEC - errtext = create pool: MEMORY -END_HEADER -*/ - -#include "testlib.h" -#include "mpsavm.h" -#include "mpscamc.h" -#include "mpscmv.h" -#include "newfmt.h" - - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - - -void *stackpointer; - - -static void test(void) -{ - mps_arena_t arena; - mps_pool_t pool; - mps_thr_t thread; - mps_fmt_t format; - mps_chain_t chain; - mps_root_t root; - mps_addr_t q; - mps_res_t res; - int p; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), mmqaArenaSIZE), - "create arena"); - die(mps_thread_reg(&thread, arena), "register thread"); - die(mps_root_create_reg(&root, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - die(mps_fmt_create_A(&format, arena, &fmtA), "create format"); - die(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - die(mps_pool_create(&pool, arena, mps_class_mv(), - 1024*32, 1024*16, 1024*256), - "pool"); - - do { - res = mps_alloc(&q, pool, 64*1024); - } while (res==MPS_RES_OK); - - p = 0; - - while (1) { - p++; - die(mmqa_pool_create_chain(&pool, arena, mps_class_amc(), format, chain), - "create pool"); - report("pool", "%i", p); - } - - asserts(1, "Unreachable!"); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/19.c b/mps/qa/function/19.c deleted file mode 100644 index 314836967f2..00000000000 --- a/mps/qa/function/19.c +++ /dev/null @@ -1,78 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!19.c(trunk.5) $ - summary = create lots of aps at once (and cause to run out of memory) - language = c - link = testlib.o newfmt.o -OUTPUT_SPEC - errtext = create ap: MEMORY -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "mpscmv.h" -#include "mpsavm.h" -#include "newfmt.h" - - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - - -void *stackpointer; - - -static void test(void) -{ - mps_arena_t arena; - mps_pool_t pool; - mps_thr_t thread; - mps_fmt_t format; - mps_chain_t chain; - mps_root_t root; - mps_ap_t ap; - mps_addr_t q; - - int p; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), mmqaArenaSIZE), - "create arena"); - die(mps_thread_reg(&thread, arena), "register thread"); - die(mps_root_create_reg(&root, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - die(mps_fmt_create_A(&format, arena, &fmtA), "create format"); - die(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - die(mps_pool_create(&pool, arena, mps_class_mv(), - 1024*32, 1024*16, 1024*256), - "pool"); - - while (mps_alloc(&q, pool, 64*1024)==MPS_RES_OK); - p = 0; - - cdie(mmqa_pool_create_chain(&pool, arena, mps_class_amc(), format, chain), - "create pool"); - - while (1) { - p++; - die(mps_ap_create(&ap, pool, MPS_RANK_EXACT), "create ap"); - report("ap", "%i", p); - } - - asserts(1, "Unreachable!"); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/2.c b/mps/qa/function/2.c deleted file mode 100644 index ca2df0d0dfe..00000000000 --- a/mps/qa/function/2.c +++ /dev/null @@ -1,102 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = test my format for format_a - language = c - link = myfmt.o testlib.o - manual = true -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "myfmt.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_ap_t ap; - - mycell *a,*b,*c; - size_t inpsize; - - int i; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - cdie( - mps_pool_create(&pool, space, mps_class_amc(), format), - "create pool"); - - cdie( - mps_ap_create(&ap, pool, MPS_RANK_EXACT), - "create ap"); - - scanf("%lx", &inpsize); - - a = allocone(ap, 0, NULL, NULL, inpsize); - comment("%x\n", (int) a); - b = a; - - for (i=1; i<100; i++) - { - c = allocone(ap, i, NULL, NULL, inpsize); - b->ref[0] = c; - b = c; - comment("%d: %lx\n", i, (mps_word_t) b); -/* getchar(); -*/ - } - - b = a; - while (b != c) - { - comment("%ld: %x\n", b->data, (int) b); - b = b->ref[0]; - } - - mps_ap_destroy(ap); - comment("Destroyed ap."); - - mps_pool_destroy(pool); - comment("Destroyed pool."); - - mps_fmt_destroy(format); - comment("Destroyed format."); - - mps_root_destroy(root); - comment("Destroyed root."); - - mps_thread_dereg(thread); - comment("Deregistered thread."); - - mps_space_destroy(space); - comment("Destroyed space."); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); -} diff --git a/mps/qa/function/20.c b/mps/qa/function/20.c deleted file mode 100644 index 0afd033aa27..00000000000 --- a/mps/qa/function/20.c +++ /dev/null @@ -1,57 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = create lots of formats at once (and cause to run out of memory) - language = c - link = testlib.o newfmt.o -OUTPUT_SPEC - errtext = create format: MEMORY -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "mpscmv.h" -#include "newfmt.h" - -void *stackpointer; - -static void test(void) { - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - mps_fmt_t format; - mps_root_t root; - mps_addr_t q; - - int p; - - die(mps_space_create(&space), "create"); - die(mps_thread_reg(&thread, space), "register thread"); - die(mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), "create root"); - - die(mps_pool_create(&pool, space, mps_class_mv(), - 1024*32, 1024*16, 1024*256), "pool"); - - while (mps_alloc(&q, pool, 64*1024)==MPS_RES_OK); - p=0; - - while (1) { - p++; - die(mps_fmt_create_A(&format, space, &fmtA), "create format"); - report("format", "%i", p); - } - - asserts(1, "Unreachable!"); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/200.c b/mps/qa/function/200.c deleted file mode 100644 index 29b51a6307a..00000000000 --- a/mps/qa/function/200.c +++ /dev/null @@ -1,176 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = new MV allocation test - language = c - link = testlib.o -END_HEADER -*/ - -#include -#include "testlib.h" -#include "mpscmv.h" -#include "mpsavm.h" - -#define MAXNUMBER 1000000 - -void *stackpointer; -mps_space_t space; - -static struct {mps_addr_t addr; size_t size;} queue[MAXNUMBER]; - -enum {SEQ=0, RAN=1, SEQGAP=2, RANGAP=3, DUMMY=4}; -static char *tdesc[] = {"sequential", "random", - "sequential gap", "random gap", "dummy"}; - -static void setobj(mps_addr_t a, size_t size, unsigned char val) -{ - unsigned char *b; - b = a; - - while (size>0) - { - *b=val; - /* comment("%p = %i", b, (int) val); - */ - b++; - size--; - } -} - -static int chkobj(mps_addr_t a, size_t size, unsigned char val) -{ - unsigned char *b; - b = a; - - while (size>0) - { - /* comment("%p == %i", b, (int) val); - */ - if (*b != val) return 0; - b++; - size--; - } - return 1; -} - -static void dt(int kind, - size_t extendBy, size_t avgSize, size_t maxSize, - size_t mins, size_t maxs, int number, int iter) -{ - mps_pool_t pool; - int i, hd; - clock_t time0, time1; - size_t size; - int secs; - - asserts(number <= MAXNUMBER, "number too big"); - - time0 = clock(); - asserts(time0 != -1, "processor time not available"); - - die( - mps_pool_create(&pool, space, mps_class_mv(), - extendBy, avgSize, maxSize), - "create MV pool"); - - for(hd=0; hd -#include "testlib.h" -#include "mpscepdl.h" -#include "mpsavm.h" - -#define MAXNUMBER 1000000 - -void *stackpointer; -mps_space_t space; - -static struct {mps_addr_t addr; size_t size;} queue[MAXNUMBER]; - -enum {SEQ=0, RAN=1, SEQGAP=2, RANGAP=3, DUMMY=4}; -static char *tdesc[] = {"sequential", "random", - "sequential gap", "random gap", "dummy"}; - -static void setobj(mps_addr_t a, size_t size, unsigned char val) -{ - unsigned char *b; - b = a; - - while (size>0) - { - *b=val; - /* comment("%p = %i", b, (int) val); - */ - b++; - size--; - } -} - -static int chkobj(mps_addr_t a, size_t size, unsigned char val) -{ - unsigned char *b; - b = a; - - while (size>0) - { - /* comment("%p == %i", b, (int) val); - */ - if (*b != val) return 0; - b++; - size--; - } - return 1; -} - -static void dt(int kind, - size_t extendBy, size_t avgSize, size_t align, - size_t mins, size_t maxs, int number, int iter) -{ - mps_pool_t pool; - int i, hd; - clock_t time0, time1; - size_t size; - int secs; - - asserts(number <= MAXNUMBER, "number too big"); - - time0 = clock(); - asserts(time0 != -1, "processor time not available"); - - die( - mps_pool_create(&pool, space, mps_class_epdl(), - extendBy, avgSize, align), - "create EPDL pool"); - - for(hd=0; hd -#include "testlib.h" -#include "mpscepdl.h" -#include "mpsavm.h" - -#define MAXNUMBER 1000000 - -void *stackpointer; -mps_space_t space; - -static struct {mps_addr_t addr; size_t size;} queue[MAXNUMBER]; - -enum {SEQ=0, RAN=1, SEQGAP=2, RANGAP=3, DUMMY=4}; -static char *tdesc[] = {"sequential", "random", - "sequential gap", "random gap", "dummy"}; - -static void setobj(mps_addr_t a, size_t size, unsigned char val) -{ - unsigned char *b; - b = a; - - while (size>0) - { - *b=val; - /* comment("%p = %i", b, (int) val); - */ - b++; - size--; - } -} - -static int chkobj(mps_addr_t a, size_t size, unsigned char val) -{ - unsigned char *b; - b = a; - - while (size>0) - { - /* comment("%p == %i", b, (int) val); - */ - if (*b != val) return 0; - b++; - size--; - } - return 1; -} - -static void dt(int kind, - size_t extendBy, size_t avgSize, size_t align, - size_t mins, size_t maxs, int number, int iter) -{ - mps_pool_t pool; - int i, hd; - clock_t time0, time1; - size_t size; - int secs; - - asserts(number <= MAXNUMBER, "number too big"); - - time0 = clock(); - asserts(time0 != -1, "processor time not available"); - - die( - mps_pool_create(&pool, space, mps_class_epdr(), - extendBy, avgSize, align), - "create EPDR pool"); - - for(hd=0; hd -#include "testlib.h" -#include "mpscmv2.h" -#include "mpsavm.h" - -#define MAXNUMBER 1000000 - -/* this shouldn't be necessary, but it's not provided anywhere */ - -typedef MPS_T_WORD mps_count_t; - -void *stackpointer; -mps_space_t space; - -static struct {mps_addr_t addr; size_t size;} queue[MAXNUMBER]; - -enum {SEQ=0, RAN=1, SEQGAP=2, RANGAP=3, DUMMY=4}; -static char *tdesc[] = {"sequential", "random", - "sequential gap", "random gap", "dummy"}; - -static void setobj(mps_addr_t a, size_t size, unsigned char val) -{ - unsigned char *b; - b = a; - - while (size>0) - { - *b=val; - /* comment("%p = %i", b, (int) val); - */ - b++; - size--; - } -} - -static mps_res_t mv2_alloc(mps_addr_t *ref, mps_ap_t ap, size_t size) { - mps_res_t res; - - size = ((size+7)/8)*8; - - do { - MPS_RESERVE_BLOCK(res, *ref, ap, size); - if (res != MPS_RES_OK) return res; - } while (!mps_commit(ap, *ref, size)); - - return MPS_RES_OK; -} - -static int chkobj(mps_addr_t a, size_t size, unsigned char val) -{ - unsigned char *b; - b = a; - - while (size>0) - { - /* comment("%p == %i", b, (int) val); - */ - if (*b != val) return 0; - b++; - size--; - } - return 1; -} - -static void dt(int kind, - size_t minSize, size_t avgSize, size_t maxSize, - mps_count_t depth, mps_count_t fragLimit, - size_t mins, size_t maxs, int number, int iter) -{ - mps_pool_t pool; - mps_ap_t ap; - int i, hd; - clock_t time0, time1; - size_t size; - int secs; - - asserts(number <= MAXNUMBER, "number too big"); - - time0 = clock(); - asserts(time0 != -1, "processor time not available"); - - die( - mps_pool_create(&pool, space, mps_class_mv2(), - minSize, avgSize, maxSize, depth, fragLimit), - "create MV2 pool"); - - die(mps_ap_create(&ap, pool, MPS_RANK_AMBIG), "create ap"); - - for(hd=0; hd= 5; frag = (frag >> 1)) { - - comment("Frag: %i", frag); - - dt(SEQ, 8, 8, 9, dep, frag, 8, 9, 5, 1000); - dt(RANGAP, 64, 64, 64, dep, frag, 8, 128, 100, 100000); - - dt(DUMMY, 8, 32, 64, dep, frag, 8, 64, 1000, 1000000); - dt(SEQ, 8, 32, 64, dep, frag, 8, 64, 1000, 1000000); - dt(RAN, 8, 32, 64, dep, frag, 8, 64, 1000, 1000000); - dt(SEQGAP, 8, 32, 64, dep, frag, 8, 64, 1000, 1000000); - dt(RANGAP, 8, 32, 64, dep, frag, 8, 64, 1000, 1000000); - - dt(DUMMY, 100, 116, 132, dep, frag, 100, 132, 1000, 1000000); - dt(SEQ, 100, 116, 132, dep, frag, 100, 132, 1000, 1000000); - dt(RAN, 100, 116, 132, dep, frag, 100, 132, 1000, 1000000); - dt(SEQGAP, 100, 116, 132, dep, frag, 100, 132, 1000, 1000000); - dt(RANGAP, 100, 116, 132, dep, frag, 100, 132, 1000, 1000000); - - dt(DUMMY, mins, 60*1024, 120*1024, dep, frag, mins, 128*1024, 100, 10000); - dt(SEQ, mins, 60*1024, 120*1024, dep, frag, mins, 128*1024, 100, 10000); - dt(RAN, mins, 60*1024, 120*1024, dep, frag, mins, 128*1024, 100, 10000); - dt(SEQGAP, mins, 60*1024, 120*1024, dep, frag, mins, 128*1024, 100, 10000); - dt(RANGAP, mins, 60*1024, 120*1024, dep, frag, mins, 128*1024, 100, 10000); - -/* try again using exceptional obj for anything over 16K */ - - dt(DUMMY, mins, 8*1024, 16*1024, dep, frag, mins, 128*1024, 100, 10000); - dt(SEQ, mins, 8*1024, 16*1024, dep, frag, mins, 128*1024, 100, 10000); - dt(RAN, mins, 8*1024, 16*1024, dep, frag, mins, 128*1024, 100, 10000); - dt(SEQGAP, mins, 8*1024, 16*1024, dep, frag, mins, 128*1024, 100, 10000); - dt(RANGAP, mins, 8*1024, 16*1024, dep, frag, mins, 128*1024, 100, 10000); - - } - - mps_thread_dereg(thread); - mps_arena_destroy(space); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/204.c b/mps/qa/function/204.c deleted file mode 100644 index 4bc991e3af8..00000000000 --- a/mps/qa/function/204.c +++ /dev/null @@ -1,216 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = new MV2 allocation test, extra shallow - language = c - link = testlib.o -END_HEADER -*/ - -#include -#include "testlib.h" -#include "mpscmv2.h" -#include "mpsavm.h" - -#define MAXNUMBER 1000000 - -/* this shouldn't be necessary, but it's not provided anywhere */ - -typedef MPS_T_WORD mps_count_t; - -void *stackpointer; -mps_space_t space; - -static struct {mps_addr_t addr; size_t size;} queue[MAXNUMBER]; - -enum {SEQ=0, RAN=1, SEQGAP=2, RANGAP=3, DUMMY=4}; -static char *tdesc[] = {"sequential", "random", - "sequential gap", "random gap", "dummy"}; - -static void setobj(mps_addr_t a, size_t size, unsigned char val) -{ - unsigned char *b; - b = a; - - while (size>0) - { - *b=val; - /* comment("%p = %i", b, (int) val); - */ - b++; - size--; - } -} - -static mps_res_t mv2_alloc(mps_addr_t *ref, mps_ap_t ap, size_t size) { - mps_res_t res; - - size = ((size+7)/8)*8; - - do { - MPS_RESERVE_BLOCK(res, *ref, ap, size); - if (res != MPS_RES_OK) return res; - } while (!mps_commit(ap, *ref, size)); - - return MPS_RES_OK; -} - -static int chkobj(mps_addr_t a, size_t size, unsigned char val) -{ - unsigned char *b; - b = a; - - while (size>0) - { - /* comment("%p == %i", b, (int) val); - */ - if (*b != val) return 0; - b++; - size--; - } - return 1; -} - -static void dt(int kind, - size_t minSize, size_t avgSize, size_t maxSize, - mps_count_t depth, mps_count_t fragLimit, - size_t mins, size_t maxs, int number, int iter) -{ - mps_pool_t pool; - mps_ap_t ap; - int i, hd; - clock_t time0, time1; - size_t size; - int secs; - - asserts(number <= MAXNUMBER, "number too big"); - - time0 = clock(); - asserts(time0 != -1, "processor time not available"); - - die( - mps_pool_create(&pool, space, mps_class_mv2(), - minSize, avgSize, maxSize, depth, fragLimit), - "create MV2 pool"); - - die(mps_ap_create(&ap, pool, MPS_RANK_AMBIG), "create ap"); - - for(hd=0; hd= 5; frag = (frag >> 1)) { - - comment("Frag: %i", frag); - - dt(SEQ, 8, 8, 9, dep, frag, 8, 9, 5, 1000); - dt(RANGAP, 64, 64, 64, dep, frag, 8, 128, 100, 100000); - - dt(DUMMY, 8, 32, 64, dep, frag, 8, 64, 1000, 1000000); - dt(SEQ, 8, 32, 64, dep, frag, 8, 64, 1000, 1000000); - dt(RAN, 8, 32, 64, dep, frag, 8, 64, 1000, 1000000); - dt(SEQGAP, 8, 32, 64, dep, frag, 8, 64, 1000, 1000000); - dt(RANGAP, 8, 32, 64, dep, frag, 8, 64, 1000, 1000000); - - dt(DUMMY, 100, 116, 132, dep, frag, 100, 132, 1000, 1000000); - dt(SEQ, 100, 116, 132, dep, frag, 100, 132, 1000, 1000000); - dt(RAN, 100, 116, 132, dep, frag, 100, 132, 1000, 1000000); - dt(SEQGAP, 100, 116, 132, dep, frag, 100, 132, 1000, 1000000); - dt(RANGAP, 100, 116, 132, dep, frag, 100, 132, 1000, 1000000); - - dt(DUMMY, mins, 60*1024, 120*1024, dep, frag, mins, 128*1024, 100, 10000); - dt(SEQ, mins, 60*1024, 120*1024, dep, frag, mins, 128*1024, 100, 10000); - dt(RAN, mins, 60*1024, 120*1024, dep, frag, mins, 128*1024, 100, 10000); - dt(SEQGAP, mins, 60*1024, 120*1024, dep, frag, mins, 128*1024, 100, 10000); - dt(RANGAP, mins, 60*1024, 120*1024, dep, frag, mins, 128*1024, 100, 10000); - -/* try again using exceptional obj for anything over 16K */ - - dt(DUMMY, mins, 8*1024, 16*1024, dep, frag, mins, 128*1024, 100, 10000); - dt(SEQ, mins, 8*1024, 16*1024, dep, frag, mins, 128*1024, 100, 10000); - dt(RAN, mins, 8*1024, 16*1024, dep, frag, mins, 128*1024, 100, 10000); - dt(SEQGAP, mins, 8*1024, 16*1024, dep, frag, mins, 128*1024, 100, 10000); - dt(RANGAP, mins, 8*1024, 16*1024, dep, frag, mins, 128*1024, 100, 10000); - - } - - mps_thread_dereg(thread); - mps_arena_destroy(space); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/205.c b/mps/qa/function/205.c deleted file mode 100644 index fdc909dbf34..00000000000 --- a/mps/qa/function/205.c +++ /dev/null @@ -1,216 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = new MV2 allocation test, extra deep - language = c - link = testlib.o -END_HEADER -*/ - -#include -#include "testlib.h" -#include "mpscmv2.h" -#include "mpsavm.h" - -#define MAXNUMBER 1000000 - -/* this shouldn't be necessary, but it's not provided anywhere */ - -typedef MPS_T_WORD mps_count_t; - -void *stackpointer; -mps_space_t space; - -static struct {mps_addr_t addr; size_t size;} queue[MAXNUMBER]; - -enum {SEQ=0, RAN=1, SEQGAP=2, RANGAP=3, DUMMY=4}; -static char *tdesc[] = {"sequential", "random", - "sequential gap", "random gap", "dummy"}; - -static void setobj(mps_addr_t a, size_t size, unsigned char val) -{ - unsigned char *b; - b = a; - - while (size>0) - { - *b=val; - /* comment("%p = %i", b, (int) val); - */ - b++; - size--; - } -} - -static mps_res_t mv2_alloc(mps_addr_t *ref, mps_ap_t ap, size_t size) { - mps_res_t res; - - size = ((size+7)/8)*8; - - do { - MPS_RESERVE_BLOCK(res, *ref, ap, size); - if (res != MPS_RES_OK) return res; - } while (!mps_commit(ap, *ref, size)); - - return MPS_RES_OK; -} - -static int chkobj(mps_addr_t a, size_t size, unsigned char val) -{ - unsigned char *b; - b = a; - - while (size>0) - { - /* comment("%p == %i", b, (int) val); - */ - if (*b != val) return 0; - b++; - size--; - } - return 1; -} - -static void dt(int kind, - size_t minSize, size_t avgSize, size_t maxSize, - mps_count_t depth, mps_count_t fragLimit, - size_t mins, size_t maxs, int number, int iter) -{ - mps_pool_t pool; - mps_ap_t ap; - int i, hd; - clock_t time0, time1; - size_t size; - int secs; - - asserts(number <= MAXNUMBER, "number too big"); - - time0 = clock(); - asserts(time0 != -1, "processor time not available"); - - die( - mps_pool_create(&pool, space, mps_class_mv2(), - minSize, avgSize, maxSize, depth, fragLimit), - "create MV2 pool"); - - die(mps_ap_create(&ap, pool, MPS_RANK_AMBIG), "create ap"); - - for(hd=0; hd= 5; frag = (frag >> 1)) { - - comment("Frag: %i", frag); - - dt(SEQ, 8, 8, 9, dep, frag, 8, 9, 5, 1000); - dt(RANGAP, 64, 64, 64, dep, frag, 8, 128, 100, 100000); - - dt(DUMMY, 8, 32, 64, dep, frag, 8, 64, 1000, 1000000); - dt(SEQ, 8, 32, 64, dep, frag, 8, 64, 1000, 1000000); - dt(RAN, 8, 32, 64, dep, frag, 8, 64, 1000, 1000000); - dt(SEQGAP, 8, 32, 64, dep, frag, 8, 64, 1000, 1000000); - dt(RANGAP, 8, 32, 64, dep, frag, 8, 64, 1000, 1000000); - - dt(DUMMY, 100, 116, 132, dep, frag, 100, 132, 1000, 1000000); - dt(SEQ, 100, 116, 132, dep, frag, 100, 132, 1000, 1000000); - dt(RAN, 100, 116, 132, dep, frag, 100, 132, 1000, 1000000); - dt(SEQGAP, 100, 116, 132, dep, frag, 100, 132, 1000, 1000000); - dt(RANGAP, 100, 116, 132, dep, frag, 100, 132, 1000, 1000000); - - dt(DUMMY, mins, 60*1024, 120*1024, dep, frag, mins, 128*1024, 100, 10000); - dt(SEQ, mins, 60*1024, 120*1024, dep, frag, mins, 128*1024, 100, 10000); - dt(RAN, mins, 60*1024, 120*1024, dep, frag, mins, 128*1024, 100, 10000); - dt(SEQGAP, mins, 60*1024, 120*1024, dep, frag, mins, 128*1024, 100, 10000); - dt(RANGAP, mins, 60*1024, 120*1024, dep, frag, mins, 128*1024, 100, 10000); - -/* try again using exceptional obj for anything over 16K */ - - dt(DUMMY, mins, 8*1024, 16*1024, dep, frag, mins, 128*1024, 100, 10000); - dt(SEQ, mins, 8*1024, 16*1024, dep, frag, mins, 128*1024, 100, 10000); - dt(RAN, mins, 8*1024, 16*1024, dep, frag, mins, 128*1024, 100, 10000); - dt(SEQGAP, mins, 8*1024, 16*1024, dep, frag, mins, 128*1024, 100, 10000); - dt(RANGAP, mins, 8*1024, 16*1024, dep, frag, mins, 128*1024, 100, 10000); - - } - - mps_thread_dereg(thread); - mps_arena_destroy(space); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/206.c b/mps/qa/function/206.c deleted file mode 100644 index 4bcb75c1494..00000000000 --- a/mps/qa/function/206.c +++ /dev/null @@ -1,189 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = new MVFF allocation test - language = c - link = testlib.o -END_HEADER -*/ - -#include -#include "testlib.h" -#include "mpscmvff.h" -#include "mpsavm.h" - -#define MAXNUMBER 1000000 - -void *stackpointer; -mps_space_t space; - -mps_bool_t slotHigh, arenaHigh, firstFit; - -static struct {mps_addr_t addr; size_t size;} queue[MAXNUMBER]; - -enum {SEQ=0, RAN=1, SEQGAP=2, RANGAP=3, DUMMY=4}; -static char *tdesc[] = {"sequential", "random", - "sequential gap", "random gap", "dummy"}; - -static void setobj(mps_addr_t a, size_t size, unsigned char val) -{ - unsigned char *b; - b = a; - - while (size>0) - { - *b=val; - /* comment("%p = %i", b, (int) val); - */ - b++; - size--; - } -} - -static int chkobj(mps_addr_t a, size_t size, unsigned char val) -{ - unsigned char *b; - b = a; - - while (size>0) - { - /* comment("%p == %i", b, (int) val); - */ - if (*b != val) return 0; - b++; - size--; - } - return 1; -} - -static void dt(int kind, - size_t extendBy, size_t avgSize, size_t align, - size_t mins, size_t maxs, int number, int iter) -{ - mps_pool_t pool; - int i, hd; - clock_t time0, time1; - size_t size; - int secs; - - asserts(number <= MAXNUMBER, "number too big"); - - time0 = clock(); - asserts(time0 != -1, "processor time not available"); - - die( - mps_pool_create(&pool, space, mps_class_mvff(), - extendBy, avgSize, align, slotHigh, arenaHigh, firstFit), - "create EPDR pool"); - - for(hd=0; hd> 2) & 1; - arenaHigh = (symm >> 1) & 1; - firstFit = (symm & 1); - - dt(SEQ, 4096, 32, 8, 8, 9, 5, 1000); - dt(RANGAP, 64, 64, 8, 8, 128, 100, 100000); - - dt(DUMMY, 4096, 32, 8, 8, 64, 1000, 1000000); - dt(SEQ, 4096, 32, 8, 8, 64, 1000, 1000000); - dt(RAN, 4096, 32, 8, 8, 64, 1000, 1000000); - dt(SEQGAP, 4096, 32, 8, 8, 64, 1000, 1000000); - dt(RANGAP, 4096, 32, 8, 8, 64, 1000, 1000000); - - dt(DUMMY, 4096, 1024, 8, 100, 132, 1000, 1000000); - dt(SEQ, 4096, 1024, 8, 100, 132, 1000, 1000000); - dt(RAN, 4096, 1024, 8, 100, 132, 1000, 1000000); - dt(SEQGAP, 4096, 1024, 8, 100, 132, 1000, 1000000); - dt(RANGAP, 4096, 1024, 8, 100, 132, 1000, 1000000); - - dt(DUMMY, 128*1024, 64*1024, 8, mins, 128*1024, 100, 10000); - dt(SEQ, 128*1024, 64*1024, 8, mins, 128*1024, 100, 10000); - dt(RAN, 128*1024, 64*1024, 8, mins, 128*1024, 100, 10000); - dt(SEQGAP, 128*1024, 64*1024, 8, mins, 128*1024, 100, 10000); - dt(RANGAP, 128*1024, 64*1024, 8, mins, 128*1024, 100, 10000); - - } - - mps_thread_dereg(thread); - mps_arena_destroy(space); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/207.c b/mps/qa/function/207.c deleted file mode 100644 index 363990453d0..00000000000 --- a/mps/qa/function/207.c +++ /dev/null @@ -1,184 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = MVFF low-memory test - language = c - link = testlib.o -END_HEADER -*/ - -#include -#include "testlib.h" -#include "mpscmvff.h" -#include "mpsavm.h" - -#define MAXNUMBER 1000000 - -void *stackpointer; -mps_space_t space; - -mps_bool_t slotHigh, arenaHigh, firstFit; -int comments = 0; - -static struct {mps_addr_t addr; size_t size;} queue[MAXNUMBER]; - -enum {SEQ=0, RAN=1, SEQGAP=2, RANGAP=3, DUMMY=4}; -static char *tdesc[] = {"sequential", "random", - "sequential gap", "random gap", "dummy"}; - -static void setobj(mps_addr_t a, size_t size, unsigned char val) -{ - unsigned char *b; - b = a; - - commentif(comments, "Set %x, size %x = %i", b, size, (int) val); - while (size>0) - { - *b=val; - b++; - size--; - } -} - -static int chkobj(mps_addr_t a, size_t size, unsigned char val) -{ - unsigned char *b; - b = a; - - while (size>0) - { - /* comment("%p == %i", b, (int) val); - */ - if (*b != val) return 0; - b++; - size--; - } - return 1; -} - -static void dt(int kind, - size_t extendBy, size_t avgSize, size_t align, - size_t mins, size_t maxs, int number, int iter) -{ - mps_pool_t pool; - int i, hd; - clock_t time0, time1; - size_t size; - int secs; - - asserts(number <= MAXNUMBER, "number too big"); - - time0 = clock(); - asserts(time0 != -1, "processor time not available"); - - die( - mps_pool_create(&pool, space, mps_class_mvff(), - extendBy, avgSize, align, slotHigh, arenaHigh, firstFit), - "create MVFF pool"); - - for(hd=0; hd 0; comlimit -= 4*1024) { - mps_arena_commit_limit_set(space, comlimit); - report("limit", "%x", comlimit); - symm = ranint(8); - slotHigh = (symm >> 2) & 1; - arenaHigh = (symm >> 1) & 1; - firstFit = (symm & 1); - - mins = ranrange(1, 16); - - dt(RANGAP, 64*1024, 32, 8, 4*mins, 4*ranrange(mins, mins*100), 1000, 100000); - } - - mps_thread_dereg(thread); - mps_arena_destroy(space); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/208.c b/mps/qa/function/208.c deleted file mode 100644 index a1db8cbfaaf..00000000000 --- a/mps/qa/function/208.c +++ /dev/null @@ -1,71 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = EPDR pool-destroy speed test - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscepdl.h" -#include "mpsavm.h" - -#define EXTENDBY 8192 -#define AVGSIZE 8192 -#define ALIGN 8 -#define SIZE 8192 - -#define ITER 5000 -#define NALLOC 8192 -#define SALLOC 1 - -void *stackpointer; -mps_arena_t arena; - -static void alloclots(mps_pool_t pool, int n) { - int i; - mps_addr_t a; - for (i = 0; i < n; i++) { - die(mps_alloc(&a, pool, SIZE), "alloc failed"); - } -} - -static void test(void) -{ - mps_thr_t thread; - mps_pool_t pool1, pool2; - int i; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t) (1024*1024*100)), - "create space"); - cdie(mps_thread_reg(&thread, arena), "register thread"); - - die( - mps_pool_create(&pool1, arena, mps_class_epdr(), - EXTENDBY, AVGSIZE, ALIGN), - "create EPDR pool"); - alloclots(pool1, NALLOC); - - for (i = 0; i < ITER; i++) { - die(mps_pool_create(&pool2, arena, mps_class_epdr(), - EXTENDBY, AVGSIZE, ALIGN), "pool create"); - alloclots(pool2, SALLOC); - mps_pool_destroy(pool2); - } - - mps_pool_destroy(pool1); - - mps_thread_dereg(thread); - mps_arena_destroy(arena); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/209.c b/mps/qa/function/209.c deleted file mode 100644 index 164a1118f96..00000000000 --- a/mps/qa/function/209.c +++ /dev/null @@ -1,68 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = EPDR allocate far too much test - language = c - link = testlib.o -OUTPUT_SPEC - res = MEMORY - result = pass -END_HEADER -*/ - -#include "testlib.h" -#include "mpscepdl.h" -#include "mpsavm.h" - -#define EXTENDBY 8192 -#define AVGSIZE 8192 -#define ALIGN 8 -#define SIZE 4096 - -void *stackpointer; -mps_arena_t arena; - -static void test(void) -{ - mps_thr_t thread; - mps_pool_t pool; - mps_res_t res; - mps_addr_t a; - int *b; - int i; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t) (1024*1024*300)), - "create space"); - cdie(mps_thread_reg(&thread, arena), "register thread"); - - die( - mps_pool_create(&pool, arena, mps_class_epdr(), - EXTENDBY, AVGSIZE, ALIGN), - "create EPDR pool"); - - i = 0; - - while (MPS_RES_OK == (res = mps_alloc(&a, pool, SIZE))) { - b = a; - *b = 152; - i++; - } - - report("total", "%d", i); - report_res("res", res); - - mps_pool_destroy(pool); - - mps_thread_dereg(thread); - mps_arena_destroy(arena); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/21.c b/mps/qa/function/21.c deleted file mode 100644 index 12d78dfff46..00000000000 --- a/mps/qa/function/21.c +++ /dev/null @@ -1,36 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = allocate large promise, make it small, repeat - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmv.h" - -static void test(void) { - mps_space_t space; - mps_pool_t pool; - mps_addr_t q; - int p; - - die(mps_space_create(&space), "create"); - - die(mps_pool_create(&pool, space, mps_class_mv(), - 1024*32, 1024*16, 1024*256), "pool"); - - for (p=0; p<2000; p++) { - die(mps_alloc(&q, pool, 1024*1024), "alloc"); - q = (mps_addr_t) ((char *) q + 8); - mps_free(pool, q, 256*1024-8); - report("promise", "%i", p); - } -} - -int main(void) { - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/210.c b/mps/qa/function/210.c deleted file mode 100644 index c5067938ca3..00000000000 --- a/mps/qa/function/210.c +++ /dev/null @@ -1,78 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = EPDR allocate from SW log (af_six) - language = c - link = testlib.o - stdin = af_six -OUTPUT_SPEC - result = pass -END_HEADER -*/ - -#include "testlib.h" -#include "mpscepdl.h" -#include "mpsavm.h" - -#define MAXOBJS (30000) - -mps_addr_t objs[MAXOBJS]; -size_t sizes[MAXOBJS]; - -void *stackpointer; -mps_arena_t arena; - -static void test(void) -{ - mps_thr_t thread; - mps_pool_t pool; - log_event event; - int id; - char *c; - size_t size; - unsigned long maxcom; - - maxcom = 0; - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t) (1024*1024*100)), - "create space"); - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie( - mps_pool_create(&pool, arena, mps_class_epdr(), - 8192, 32, 4), - "create EPDR pool"); - - while (read_event(&event)) { - if (event.type == EVENT_ALLOC) { - id = event.alloc.id; - asserts(id < MAXOBJS, "MAXOBJS too small"); - size = event.alloc.size; - die(mps_alloc(&objs[id], pool, size), "alloc"); - sizes[id] = size; - c = objs[id]; - *c = 43; - } else if (event.type == EVENT_FREE) { - id = event.free.id; - mps_free(pool, objs[id], sizes[id]); - } - size = mps_arena_committed(arena); - if (size > maxcom) maxcom = size; - } - - report("maxcom", "%ld", maxcom); - - mps_pool_destroy(pool); - - mps_thread_dereg(thread); - mps_arena_destroy(arena); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/211.c b/mps/qa/function/211.c deleted file mode 100644 index e8945a06c56..00000000000 --- a/mps/qa/function/211.c +++ /dev/null @@ -1,77 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = MVFF allocate from SW log (af_six) - language = c - link = testlib.o - stdin = af_six -OUTPUT_SPEC - result = pass -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmvff.h" -#include "mpsavm.h" - -#define MAXOBJS (30000) - -mps_addr_t objs[MAXOBJS]; -size_t sizes[MAXOBJS]; - -void *stackpointer; -mps_arena_t arena; - -static void test(void) -{ - mps_thr_t thread; - mps_pool_t pool; - log_event event; - int id; - char *c; - size_t size; - unsigned long maxcom; - - maxcom = 0; - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t) (1024*1024*100)), - "create space"); - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie( - mps_pool_create(&pool, arena, mps_class_mvff(), - 8192, 32, 8, 1, 1, 0), - "create EPDR pool"); - - while (read_event(&event)) { - if (event.type == EVENT_ALLOC) { - id = event.alloc.id; - asserts(id < MAXOBJS, "MAXOBJS too small"); - size = event.alloc.size; - die(mps_alloc(&objs[id], pool, size), "alloc"); - sizes[id] = size; - c = objs[id]; - *c = 43; - } else if (event.type == EVENT_FREE) { - id = event.free.id; - mps_free(pool, objs[id], sizes[id]); - } - size = mps_arena_committed(arena); - if (size > maxcom) maxcom=size; - } - report("maxcom", "%ld", maxcom); - - mps_pool_destroy(pool); - - mps_thread_dereg(thread); - mps_arena_destroy(arena); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/212.c b/mps/qa/function/212.c deleted file mode 100644 index a1345fb0e79..00000000000 --- a/mps/qa/function/212.c +++ /dev/null @@ -1,92 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = MV2 allocate from SW log (af_six) - language = c - link = testlib.o - stdin = af_six -OUTPUT_SPEC - result = pass -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmv2.h" -#include "mpsavm.h" - -#define MAXOBJS (30000) - -#define MINSIZE 8 -#define AVGSIZE 128 -#define MAXSIZE 8192 -#define DEPTH 10 -#define FRAGLIMIT 100 - -mps_addr_t objs[MAXOBJS]; -size_t sizes[MAXOBJS]; - -void *stackpointer; -mps_arena_t arena; - -static void test(void) -{ - mps_thr_t thread; - mps_pool_t pool; - mps_ap_t ap; - log_event event; - int id; - char *c; - size_t size; - unsigned long maxcom; - mps_res_t res; - - maxcom = 0; - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t) (1024*1024*100)), - "create space"); - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie( - mps_pool_create(&pool, arena, mps_class_mv2(), - MINSIZE, AVGSIZE, MAXSIZE, DEPTH, FRAGLIMIT), - "create MV2 pool"); - - cdie(mps_ap_create(&ap, pool, MPS_RANK_AMBIG), "create ap"); - - while (read_event(&event)) { - if (event.type == EVENT_ALLOC) { - id = event.alloc.id; - asserts(id < MAXOBJS, "MAXOBJS too small"); - size = event.alloc.size; - sizes[id] = size; - size = ((size+7)/8)*8; - do { - MPS_RESERVE_BLOCK(res, objs[id], ap, size); - asserts(res == MPS_RES_OK, "alloc failed"); - } while (!mps_commit(ap, objs[id], size)); - - c = objs[id]; - *c = 43; - } else if (event.type == EVENT_FREE) { - id = event.free.id; - mps_free(pool, objs[id], sizes[id]); - } - size = mps_arena_committed(arena); - if (size > maxcom) maxcom=size; - } - report("maxcom", "%ld", maxcom); - - mps_pool_destroy(pool); - - mps_thread_dereg(thread); - mps_arena_destroy(arena); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/213.c b/mps/qa/function/213.c deleted file mode 100644 index 4d118465a79..00000000000 --- a/mps/qa/function/213.c +++ /dev/null @@ -1,87 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = MV2 allocate from SW log (af_six) - language = c - link = testlib.o - stdin = af_six - parameters = MINSIZE AVGSIZE MAXSIZE DEPTH FRAGLIMIT -OUTPUT_SPEC - result = pass -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmv2.h" -#include "mpsavm.h" - -#define MAXOBJS (30000) - -mps_addr_t objs[MAXOBJS]; -size_t sizes[MAXOBJS]; - -void *stackpointer; -mps_arena_t arena; - -static void test(void) -{ - mps_thr_t thread; - mps_pool_t pool; - mps_ap_t ap; - log_event event; - int id; - char *c; - size_t size; - unsigned long maxcom; - mps_res_t res; - - maxcom = 0; - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t) (1024*1024*100)), - "create space"); - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie( - mps_pool_create(&pool, arena, mps_class_mv2(), - MINSIZE, AVGSIZE, MAXSIZE, DEPTH, FRAGLIMIT), - "create MV2 pool"); - - cdie(mps_ap_create(&ap, pool, MPS_RANK_AMBIG), "create ap"); - - while (read_event(&event)) { - if (event.type == EVENT_ALLOC) { - id = event.alloc.id; - asserts(id < MAXOBJS, "MAXOBJS too small"); - size = event.alloc.size; - sizes[id] = size; - size = ((size+7)/8)*8; - do { - MPS_RESERVE_BLOCK(res, objs[id], ap, size); - asserts(res == MPS_RES_OK, "alloc failed"); - } while (!mps_commit(ap, objs[id], size)); - - c = objs[id]; - *c = 43; - } else if (event.type == EVENT_FREE) { - id = event.free.id; - mps_free(pool, objs[id], sizes[id]); - } - size = mps_arena_committed(arena); - if (size > maxcom) maxcom=size; - } - report("maxcom", "%ld", maxcom); - - mps_pool_destroy(pool); - - mps_thread_dereg(thread); - mps_arena_destroy(arena); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/214.c b/mps/qa/function/214.c deleted file mode 100644 index 6c45e18c143..00000000000 --- a/mps/qa/function/214.c +++ /dev/null @@ -1,77 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = MV2 greed test - language = c - link = testlib.o - parameters = OBJECTS=1000 OBJSIZE=8192 DEPTH=2 FRAGLIMIT=50 -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmv2.h" -#include "mpsavm.h" - -/* this shouldn't be necessary, but it's not provided anywhere */ - -typedef MPS_T_WORD mps_count_t; - -void *stackpointer; -mps_arena_t arena; - -static mps_addr_t objs[OBJECTS]; - -static mps_res_t mv2_alloc(mps_addr_t *ref, mps_ap_t ap, size_t size) { - mps_res_t res; - - size = ((size+7)/8)*8; - - do { - MPS_RESERVE_BLOCK(res, *ref, ap, size); - if (res != MPS_RES_OK) return res; - } while (!mps_commit(ap, *ref, size)); - - return MPS_RES_OK; -} - -static void test (void) { - mps_thr_t thread; - mps_pool_t pool; - mps_ap_t ap; - int i; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t) (1024*1024*100)), "create arena"); - cdie(mps_thread_reg(&thread, arena), "register thread"); - die( - mps_pool_create(&pool, arena, mps_class_mv2(), - OBJSIZE, OBJSIZE, OBJSIZE, DEPTH, FRAGLIMIT), - "create MV2 pool"); - - die(mps_ap_create(&ap, pool, MPS_RANK_AMBIG), "create ap"); - - for (i = 0; i < OBJECTS; i++) { - die(mv2_alloc(&objs[i], ap, OBJSIZE), "alloc"); - } - report("size1", "%ld", mps_arena_committed(arena)); - - for (i = 0; i < OBJECTS; i+=2) { - mps_free(pool, objs[i], OBJSIZE); - die(mv2_alloc(&objs[i], ap, OBJSIZE), "alloc"); - } - report("size2", "%ld", mps_arena_committed(arena)); - - mps_ap_destroy(ap); - mps_pool_destroy(pool); - mps_thread_dereg(thread); - mps_arena_destroy(arena); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/215.c b/mps/qa/function/215.c deleted file mode 100644 index 3f81bf58ef3..00000000000 --- a/mps/qa/function/215.c +++ /dev/null @@ -1,173 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!215.c(trunk.2) $ - summary = test of ramp allocation - language = c - link = testlib.o rankfmt.o -OUTPUT_SPEC - result = pass -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "mpsavm.h" -#include "rankfmt.h" - -#define ARENALIMIT (200) - -#define TABSIZE (50000) -#define ENTERRAMP (30000) -#define LEAVERAMP (100000) - -#define BACKSIZE (128) -#define BACKITER (32) -#define RAMPSIZE (128) - -#define ITERATIONS (1000000ul) - -#define RAMP_INTERFACE -/* -#define COLLECT_WORLD -*/ - -void *stackpointer; - -mps_space_t arena; -mps_pool_t poolamc; -mps_thr_t thread; -mps_root_t root, root1; - -mps_fmt_t format; -mps_ap_t apamc; - -static mps_addr_t objtab[TABSIZE]; - -static void alloc_back(void) { - long int i, j; - - for (j = 0; j < BACKITER; j++) { - i = ranint(ranint(ranint(ranint(TABSIZE)+1)+1)+1); - objtab[i] = allocdumb(apamc, BACKSIZE, MPS_RANK_EXACT); - } -} - - -static void test(void) { - long int i; - long int rsize; - mps_message_t message; - - int inramp; - - mycell *r, *s; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), - (size_t) 1024*1024*ARENALIMIT), - "create space"); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie( - mps_root_create_reg(&root, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_root_create_table(&root1, arena, MPS_RANK_EXACT, 0, &objtab[0], TABSIZE), - "create root table"); - - cdie( - mps_fmt_create_A(&format, arena, &fmtA), - "create format"); - - cdie( - mps_pool_create(&poolamc, arena, mps_class_amc(), format), - "create pool"); - - cdie( - mps_ap_create(&apamc, poolamc, MPS_RANK_EXACT), - "create ap"); - - mps_message_type_enable(arena, mps_message_type_gc()); - - inramp = 0; - - for (i = 0; i < ITERATIONS; i++) { - if (i % 10000 == 0) { - comment("%ld of %ld", i, ITERATIONS); - } - alloc_back(); - if (inramp) { - s = allocone(apamc, 3, MPS_RANK_EXACT); - setref(r, 0, s); - setref(s, 1, r); - r = s; - s = allocdumb(apamc, RAMPSIZE, MPS_RANK_EXACT); - setref(r, 2, s); - rsize ++; - if (ranint(LEAVERAMP) == 0) { - r = allocone(apamc, 2, MPS_RANK_EXACT); - s = allocone(apamc, 2, MPS_RANK_EXACT); -#ifdef RAMP_INTERFACE - mps_ap_alloc_pattern_end(apamc, mps_alloc_pattern_ramp()); -#endif -#ifdef COLLECT_WORLD - mps_arena_collect(arena); - mps_arena_release(arena); -#endif - comment("ramp end, %ld objects", rsize); - inramp = 0; - } - } else { - if (ranint(ENTERRAMP) == 0) { -#ifdef RAMP_INTERFACE - mps_ap_alloc_pattern_begin(apamc, mps_alloc_pattern_ramp()); -#endif - comment("ramp begin"); - r = allocone(apamc, 3, MPS_RANK_EXACT); - inramp = 1; - rsize = 0; - } - } - if(mps_message_get(&message, arena, mps_message_type_gc())) { - unsigned long live, condemned, notCondemned; - live = mps_message_gc_live_size(arena, message); - condemned = mps_message_gc_condemned_size(arena, message); - notCondemned = - mps_message_gc_not_condemned_size(arena, message); - comment("Collection: live=%ld, condemned=%ld, not condemned = %ld", - live, condemned, notCondemned); - mps_message_discard(arena, message); - } - } - - mps_ap_destroy(apamc); - comment("Destroyed ap."); - - mps_pool_destroy(poolamc); - comment("Destroyed pool."); - - mps_fmt_destroy(format); - comment("Destroyed format."); - - mps_root_destroy(root1); - mps_root_destroy(root); - comment("Destroyed roots."); - - mps_thread_dereg(thread); - comment("Deregistered thread."); - - mps_arena_destroy(arena); - comment("Destroyed space."); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - report("result", "pass"); - return 0; -} diff --git a/mps/qa/function/216.c b/mps/qa/function/216.c deleted file mode 100644 index 8d116567788..00000000000 --- a/mps/qa/function/216.c +++ /dev/null @@ -1,112 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = MV2 from af_six measuring fragmentation - language = c - link = testlib.o - stdin = af_six - parameters = MINSIZE=8 AVGSIZE=128 MAXSIZE=65536 DEPTH FRAGLIMIT -OUTPUT_SPEC - result = pass -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmv2.h" -#include "mpsavm.h" - -#define MAXOBJS (30000) - -mps_addr_t objs[MAXOBJS]; -size_t sizes[MAXOBJS]; -size_t total_size; -size_t committed; -int fragmentation; - -double fragacc; -double commacc; -double sizeacc; -double count; - -void *stackpointer; -mps_arena_t arena; - -static void test(void) -{ - mps_thr_t thread; - mps_pool_t pool; - mps_ap_t ap; - log_event event; - int id; - char *c; - size_t size; - unsigned long maxcom; - mps_res_t res; - - maxcom = 0; - fragacc = 0; - commacc = 0; - sizeacc = 0; - count = 0; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t) (1024*1024*100)), - "create space"); - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie( - mps_pool_create(&pool, arena, mps_class_mv2(), - MINSIZE, AVGSIZE, MAXSIZE, DEPTH, FRAGLIMIT), - "create MV2 pool"); - - cdie(mps_ap_create(&ap, pool, MPS_RANK_AMBIG), "create ap"); - - committed = mps_arena_committed(arena); - - while (read_event(&event)) { - if (event.type == EVENT_ALLOC) { - id = event.alloc.id; - asserts(id < MAXOBJS, "MAXOBJS too small"); - size = event.alloc.size; - sizes[id] = size; - size = ((size+7)/8)*8; - do { - MPS_RESERVE_BLOCK(res, objs[id], ap, size); - asserts(res == MPS_RES_OK, "alloc failed"); - } while (!mps_commit(ap, objs[id], size)); - total_size+=sizes[id]; - c = objs[id]; - *c = 43; - } else if (event.type == EVENT_FREE) { - id = event.free.id; - mps_free(pool, objs[id], sizes[id]); - total_size-=sizes[id]; - } - committed = mps_arena_committed(arena); - if (committed > maxcom) maxcom=committed; - fragacc += ((double) (committed-total_size))/((double) committed); - commacc += (double) committed; - sizeacc += (double) total_size; - count += 1; - } - report("maxcom", "%ld", maxcom); - report("fragavg", "%f", fragacc/count); - report("fragweighted", "%f", (commacc-sizeacc)/commacc); - report("commavg", "%f", commacc/count); - report("sizeavg", "%f", sizeacc/count); - - mps_ap_destroy(ap); - mps_pool_destroy(pool); - - mps_thread_dereg(thread); - mps_arena_destroy(arena); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/217.c b/mps/qa/function/217.c deleted file mode 100644 index 01c3ec50b3f..00000000000 --- a/mps/qa/function/217.c +++ /dev/null @@ -1,95 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = MVFF allocate from SW log (af_six) - language = c - link = testlib.o - stdin = af_six - parameters = EXTENDBY=65536 AVGSIZE=128 ALIGN=8 ARENAHIGH=1 SLOTHIGH=1 FIRST=1 -OUTPUT_SPEC - result = pass -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmvff.h" -#include "mpsavm.h" - -#define MAXOBJS (30000) - -mps_addr_t objs[MAXOBJS]; -size_t sizes[MAXOBJS]; -size_t total_size; -size_t committed; -int fragmentation; -int lastfrag=0; - -void *stackpointer; -mps_arena_t arena; - -static void test(void) -{ - mps_thr_t thread; - mps_pool_t pool; - log_event event; - int id; - char *c; - size_t size; - unsigned long maxcom; - - maxcom = 0; - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t) (1024*1024*100)), - "create space"); - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie( - mps_pool_create(&pool, arena, mps_class_mvff(), - EXTENDBY, AVGSIZE, ALIGN, ARENAHIGH, SLOTHIGH, FIRST), - "create MVFF pool"); - - committed = mps_arena_committed(arena); - - while (read_event(&event)) { - if (event.type == EVENT_ALLOC) { - id = event.alloc.id; - asserts(id < MAXOBJS, "MAXOBJS too small"); - size = event.alloc.size; - sizes[id] = size; - size = ((size+7)/8)*8; - die(mps_alloc(&objs[id], pool, size), "alloc"); - - if (mps_arena_committed(arena) > committed) { - fragmentation = (100*(committed-total_size)/committed); - if (fragmentation != lastfrag) { - lastfrag = fragmentation; - report("fragmentation", "%d", fragmentation); - } - } - total_size+=sizes[id]; - c = objs[id]; - *c = 43; - } else if (event.type == EVENT_FREE) { - id = event.free.id; - mps_free(pool, objs[id], sizes[id]); - total_size-=sizes[id]; - } - committed = mps_arena_committed(arena); - if (committed > maxcom) maxcom=committed; - } - report("maxcom", "%ld", maxcom); - - mps_pool_destroy(pool); - - mps_thread_dereg(thread); - mps_arena_destroy(arena); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/218.c b/mps/qa/function/218.c deleted file mode 100644 index 40a9948bbfa..00000000000 --- a/mps/qa/function/218.c +++ /dev/null @@ -1,103 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = EPDR from af_six measuring fragmentation - language = c - link = testlib.o - stdin = af_six - parameters = ALIGN=8 AVGSIZE=128 EXTENDBY=65536 -OUTPUT_SPEC - result = pass -END_HEADER -*/ - -#include "testlib.h" -#include "mpscepdl.h" -#include "mpsavm.h" - -#define MAXOBJS (30000) - -mps_addr_t objs[MAXOBJS]; -size_t sizes[MAXOBJS]; -size_t total_size; -size_t committed; -int fragmentation; - -double fragacc; -double commacc; -double sizeacc; -double count; - -void *stackpointer; -mps_arena_t arena; - -static void test(void) -{ - mps_thr_t thread; - mps_pool_t pool; - log_event event; - int id; - char *c; - size_t size; - unsigned long maxcom; - - maxcom = 0; - fragacc = 0; - commacc = 0; - sizeacc = 0; - count = 0; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t) (1024*1024*100)), - "create space"); - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie( - mps_pool_create(&pool, arena, mps_class_epdr(), - EXTENDBY, AVGSIZE, ALIGN), - "create EPDR pool"); - - committed = mps_arena_committed(arena); - - while (read_event(&event)) { - if (event.type == EVENT_ALLOC) { - id = event.alloc.id; - asserts(id < MAXOBJS, "MAXOBJS too small"); - size = event.alloc.size; - sizes[id] = size; - mps_alloc(&objs[id], pool, size); - total_size+=sizes[id]; - c = objs[id]; - *c = 43; - } else if (event.type == EVENT_FREE) { - id = event.free.id; - mps_free(pool, objs[id], sizes[id]); - total_size-=sizes[id]; - } - committed = mps_arena_committed(arena); - if (committed > maxcom) maxcom=committed; - fragacc += ((double) (committed-total_size))/((double) committed); - commacc += (double) committed; - sizeacc += (double) total_size; - count += 1; - } - report("maxcom", "%ld", maxcom); - report("fragavg", "%f", fragacc/count); - report("fragweighted", "%f", (commacc-sizeacc)/commacc); - report("commavg", "%f", commacc/count); - report("sizeavg", "%f", sizeacc/count); - - mps_pool_destroy(pool); - - mps_thread_dereg(thread); - mps_arena_destroy(arena); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/219.c b/mps/qa/function/219.c deleted file mode 100644 index 60655814cd7..00000000000 --- a/mps/qa/function/219.c +++ /dev/null @@ -1,118 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = MV2 from af_six measuring fragmentation - language = c - link = testlib.o - stdin = af_six - parameters = COMLIMIT=(1024*1024*100) MINSIZE=8 AVGSIZE=1024 MAXSIZE=65536 LIMIT FRAGLIMIT -OUTPUT_SPEC - result = pass -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmv2.h" -#include "mpsavm.h" - -#define MAXOBJS (30000) - -mps_addr_t objs[MAXOBJS]; -size_t sizes[MAXOBJS]; -size_t total_size; -size_t committed; -int fragmentation; - -double fragacc; -double commacc; -double sizeacc; -double count; - -void *stackpointer; -mps_arena_t arena; - -static void test(void) -{ - mps_thr_t thread; - mps_pool_t pool; - mps_ap_t ap; - log_event event; - int id; - char *c; - size_t size; - unsigned long maxcom; - unsigned long depth; - mps_res_t res; - - maxcom = 0; - fragacc = 0; - commacc = 0; - sizeacc = 0; - count = 0; - depth = LIMIT*2*(MAXSIZE/AVGSIZE)*(100/FRAGLIMIT); - report("depth", "%ld", depth); - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t) (1024*1024*100)), - "create space"); - cdie(mps_arena_commit_limit_set(arena, COMLIMIT), "commit limit"); - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie( - mps_pool_create(&pool, arena, mps_class_mv2(), - MINSIZE, AVGSIZE, MAXSIZE, - depth, - FRAGLIMIT), - "create MV2 pool"); - - cdie(mps_ap_create(&ap, pool, MPS_RANK_AMBIG), "create ap"); - - committed = mps_arena_committed(arena); - - while (read_event(&event)) { - if (event.type == EVENT_ALLOC) { - id = event.alloc.id; - asserts(id < MAXOBJS, "MAXOBJS too small"); - size = event.alloc.size; - sizes[id] = size; - size = ((size+7)/8)*8; - do { - MPS_RESERVE_BLOCK(res, objs[id], ap, size); - asserts(res == MPS_RES_OK, "alloc failed"); - } while (!mps_commit(ap, objs[id], size)); - total_size+=sizes[id]; - c = objs[id]; - *c = 43; - } else if (event.type == EVENT_FREE) { - id = event.free.id; - mps_free(pool, objs[id], sizes[id]); - total_size-=sizes[id]; - } - committed = mps_arena_committed(arena); - if (committed > maxcom) maxcom=committed; - fragacc += ((double) (committed-total_size))/((double) committed); - commacc += (double) committed; - sizeacc += (double) total_size; - count += 1; - } - report("maxcom", "%ld", maxcom); - report("fragavg", "%f", fragacc/count); - report("fragweighted", "%f", (commacc-sizeacc)/commacc); - report("commavg", "%f", commacc/count); - report("sizeavg", "%f", sizeacc/count); - - mps_ap_destroy(ap); - mps_pool_destroy(pool); - - mps_thread_dereg(thread); - mps_arena_destroy(arena); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/22.c b/mps/qa/function/22.c deleted file mode 100644 index a889a652e0c..00000000000 --- a/mps/qa/function/22.c +++ /dev/null @@ -1,38 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = allocate large promise, make it small, repeat interleaved - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmv.h" - -static void test(void) { - mps_space_t space; - mps_pool_t pool; - mps_addr_t q, r; - int p; - - die(mps_space_create(&space), "create"); - - die(mps_pool_create(&pool, space, mps_class_mv(), - 1024*32, 1024*16, 1024*256), "pool"); - - die(mps_alloc(&q, pool, 1024*1024), "alloc"); - - for (p=0; p<2000; p++) { - report("promise", "%i", p); - die(mps_alloc(&r, pool, 1024*1024), "alloc"); - mps_free(pool, q, 256*1024-8); - q = (mps_addr_t) ((char *) r + 8); - } -} - -int main(void) { - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/220.c b/mps/qa/function/220.c deleted file mode 100644 index 814e9e0244a..00000000000 --- a/mps/qa/function/220.c +++ /dev/null @@ -1,103 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = MVFF from af_six measuring fragmentation - language = c - link = testlib.o - stdin = af_six - parameters = ALIGN=8 AVGSIZE=128 EXTENDBY=65536 ARENAHIGH SLOTHIGH FIRSTFIT -OUTPUT_SPEC - result = pass -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmvff.h" -#include "mpsavm.h" - -#define MAXOBJS (30000) - -mps_addr_t objs[MAXOBJS]; -size_t sizes[MAXOBJS]; -size_t total_size; -size_t committed; -int fragmentation; - -double fragacc; -double commacc; -double sizeacc; -double count; - -void *stackpointer; -mps_arena_t arena; - -static void test(void) -{ - mps_thr_t thread; - mps_pool_t pool; - log_event event; - int id; - char *c; - size_t size; - unsigned long maxcom; - - maxcom = 0; - fragacc = 0; - commacc = 0; - sizeacc = 0; - count = 0; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t) (1024*1024*100)), - "create space"); - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie( - mps_pool_create(&pool, arena, mps_class_mvff(), - EXTENDBY, AVGSIZE, ALIGN, ARENAHIGH, SLOTHIGH, FIRSTFIT), - "create MVFF pool"); - - committed = mps_arena_committed(arena); - - while (read_event(&event)) { - if (event.type == EVENT_ALLOC) { - id = event.alloc.id; - asserts(id < MAXOBJS, "MAXOBJS too small"); - size = event.alloc.size; - sizes[id] = size; - mps_alloc(&objs[id], pool, size); - total_size+=sizes[id]; - c = objs[id]; - *c = 43; - } else if (event.type == EVENT_FREE) { - id = event.free.id; - mps_free(pool, objs[id], sizes[id]); - total_size-=sizes[id]; - } - committed = mps_arena_committed(arena); - if (committed > maxcom) maxcom=committed; - fragacc += ((double) (committed-total_size))/((double) committed); - commacc += (double) committed; - sizeacc += (double) total_size; - count += 1; - } - report("maxcom", "%ld", maxcom); - report("fragavg", "%f", fragacc/count); - report("fragweighted", "%f", (commacc-sizeacc)/commacc); - report("commavg", "%f", commacc/count); - report("sizeavg", "%f", sizeacc/count); - - mps_pool_destroy(pool); - - mps_thread_dereg(thread); - mps_arena_destroy(arena); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/221.c b/mps/qa/function/221.c deleted file mode 100644 index 8a5679e7d7e..00000000000 --- a/mps/qa/function/221.c +++ /dev/null @@ -1,162 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = MV2*3 from af_six measuring fragmentation - language = c - link = testlib.o - stdin = af_six - parameters = COMLIMIT=(1024*1024*100) MIN1=8 MIN2=256 MIN3=4096 MAX3=32768 LIMIT FRAGLIMIT -OUTPUT_SPEC - result = pass -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmv2.h" -#include "mpsavm.h" - -#define MAXOBJS (30000) - -mps_addr_t objs[MAXOBJS]; -size_t sizes[MAXOBJS]; -mps_pool_t pools[MAXOBJS]; -size_t total_size; -size_t committed; -int fragmentation; - -double fragacc; -double commacc; -double sizeacc; -double count; - -void *stackpointer; -mps_arena_t arena; - -static void test(void) -{ - mps_thr_t thread; - mps_pool_t pool1, pool2, pool3; - mps_ap_t ap1, ap2, ap3, ap; - log_event event; - int id; - char *c; - size_t size; - unsigned long maxcom; - unsigned long depth1, depth2, depth3; - size_t avg1, avg2, avg3; - mps_res_t res; - - maxcom = 0; - fragacc = 0; - commacc = 0; - sizeacc = 0; - count = 0; - - avg1 = MIN1; - avg2 = MIN2; - avg3 = MIN3; - - depth1 = LIMIT*2*(MIN2/avg1)*(100/FRAGLIMIT); - depth2 = LIMIT*2*(MIN3/avg2)*(100/FRAGLIMIT); - depth3 = LIMIT*2*(MAX3/avg3)*(100/FRAGLIMIT); - - report("avg1", "%ld", avg1); - report("depth1", "%ld", depth1); - report("avg2", "%ld", avg2); - report("depth2", "%ld", depth2); - report("avg3", "%ld", avg3); - report("depth3", "%ld", depth3); - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t) (1024*1024*100)), - "create space"); - cdie(mps_arena_commit_limit_set(arena, COMLIMIT), "commit limit"); - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie( - mps_pool_create(&pool1, arena, mps_class_mv2(), - MIN1, avg1, MIN2, - depth1, - FRAGLIMIT), - "create MV2 pool (small)"); - cdie(mps_ap_create(&ap1, pool1, MPS_RANK_AMBIG), "create ap (small)"); - - cdie( - mps_pool_create(&pool2, arena, mps_class_mv2(), - MIN2, avg2, MIN3, - depth2, - FRAGLIMIT), - "create MV2 pool (medium)"); - cdie(mps_ap_create(&ap2, pool2, MPS_RANK_AMBIG), "create ap (medium)"); - - cdie( - mps_pool_create(&pool3, arena, mps_class_mv2(), - MIN3, avg3, MAX3, - depth3, - FRAGLIMIT), - "create MV2 pool (big)"); - cdie(mps_ap_create(&ap3, pool3, MPS_RANK_AMBIG), "create ap (big)"); - - committed = mps_arena_committed(arena); - - while (read_event(&event)) { - if (event.type == EVENT_ALLOC) { - id = event.alloc.id; - asserts(id < MAXOBJS, "MAXOBJS too small"); - size = event.alloc.size; - sizes[id] = size; - size = ((size+7)/8)*8; - if (size < MIN2) { - ap = ap1; - pools[id] = pool1; - } else if (size < MIN3) { - ap = ap2; - pools[id] = pool2; - } else { - ap = ap3; - pools[id] = pool3; - } - do { - MPS_RESERVE_BLOCK(res, objs[id], ap, size); - asserts(res == MPS_RES_OK, "alloc failed"); - } while (!mps_commit(ap, objs[id], size)); - total_size+=sizes[id]; - c = objs[id]; - *c = 43; - } else if (event.type == EVENT_FREE) { - id = event.free.id; - mps_free(pools[id], objs[id], sizes[id]); - total_size-=sizes[id]; - } - committed = mps_arena_committed(arena); - if (committed > maxcom) maxcom=committed; - fragacc += ((double) (committed-total_size))/((double) committed); - commacc += (double) committed; - sizeacc += (double) total_size; - count += 1; - } - report("maxcom", "%ld", maxcom); - report("fragavg", "%f", fragacc/count); - report("fragweighted", "%f", (commacc-sizeacc)/commacc); - report("commavg", "%f", commacc/count); - report("sizeavg", "%f", sizeacc/count); - - mps_ap_destroy(ap1); - mps_ap_destroy(ap2); - mps_ap_destroy(ap3); - mps_pool_destroy(pool1); - mps_pool_destroy(pool2); - mps_pool_destroy(pool3); - - mps_thread_dereg(thread); - mps_arena_destroy(arena); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/222.c b/mps/qa/function/222.c deleted file mode 100644 index f59b99744eb..00000000000 --- a/mps/qa/function/222.c +++ /dev/null @@ -1,134 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = EPDR*3 from af_six measuring fragmentation - language = c - link = testlib.o - stdin = af_six - parameters = COMLIMIT=(1024*1024*100) MIN1=8 MIN2=256 MIN3=4096 EXTENDBY=65536 -OUTPUT_SPEC - result = pass -END_HEADER -*/ - -#include "testlib.h" -#include "mpscepdl.h" -#include "mpsavm.h" - -#define MAXOBJS (30000) -#define ALIGN 8 - -mps_addr_t objs[MAXOBJS]; -size_t sizes[MAXOBJS]; -mps_pool_t pools[MAXOBJS]; -size_t total_size; -size_t committed; -int fragmentation; - -double fragacc; -double commacc; -double sizeacc; -double count; - -void *stackpointer; -mps_arena_t arena; - -static void test(void) -{ - mps_thr_t thread; - mps_pool_t pool1, pool2, pool3; - log_event event; - int id; - char *c; - size_t size; - unsigned long maxcom; - size_t avg1, avg2, avg3; - - maxcom = 0; - fragacc = 0; - commacc = 0; - sizeacc = 0; - count = 0; - - avg1 = 4*MIN1; - avg2 = 4*MIN2; - avg3 = 4*MIN3; - - report("avg1", "%ld", avg1); - report("avg2", "%ld", avg2); - report("avg3", "%ld", avg3); - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t) (1024*1024*100)), - "create space"); - cdie(mps_arena_commit_limit_set(arena, COMLIMIT), "commit limit"); - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie( - mps_pool_create(&pool1, arena, mps_class_epdr(), - EXTENDBY, avg1, ALIGN), - "create EPDR pool (small)"); - - cdie( - mps_pool_create(&pool2, arena, mps_class_epdr(), - EXTENDBY, avg2, ALIGN), - "create EPDR pool (medium)"); - - cdie( - mps_pool_create(&pool3, arena, mps_class_epdr(), - EXTENDBY, avg3, ALIGN), - "create EPDR pool (big)"); - - committed = mps_arena_committed(arena); - - while (read_event(&event)) { - if (event.type == EVENT_ALLOC) { - id = event.alloc.id; - asserts(id < MAXOBJS, "MAXOBJS too small"); - size = event.alloc.size; - sizes[id] = size; - if (size < MIN2) { - pools[id] = pool1; - } else if (size < MIN3) { - pools[id] = pool2; - } else { - pools[id] = pool3; - } - die(mps_alloc(&objs[id], pools[id], size), "alloc"); - total_size+=sizes[id]; - c = objs[id]; - *c = 43; - } else if (event.type == EVENT_FREE) { - id = event.free.id; - mps_free(pools[id], objs[id], sizes[id]); - total_size-=sizes[id]; - } - committed = mps_arena_committed(arena); - if (committed > maxcom) maxcom=committed; - fragacc += ((double) (committed-total_size))/((double) committed); - commacc += (double) committed; - sizeacc += (double) total_size; - count += 1; - } - report("maxcom", "%ld", maxcom); - report("fragavg", "%f", fragacc/count); - report("fragweighted", "%f", (commacc-sizeacc)/commacc); - report("commavg", "%f", commacc/count); - report("sizeavg", "%f", sizeacc/count); - - mps_pool_destroy(pool1); - mps_pool_destroy(pool2); - mps_pool_destroy(pool3); - - mps_thread_dereg(thread); - mps_arena_destroy(arena); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/223.c b/mps/qa/function/223.c deleted file mode 100644 index a27f24dcaca..00000000000 --- a/mps/qa/function/223.c +++ /dev/null @@ -1,173 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = test of ramp allocation - language = c - link = testlib.o rankfmt.o -OUTPUT_SPEC - result = pass -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "mpsavm.h" -#include "rankfmt.h" - -#define ARENALIMIT (200) - -#define TABSIZE (50000) -#define ENTERRAMP (30000) -#define LEAVERAMP (100000) - -#define BACKSIZE (128) -#define BACKITER (32) -#define RAMPSIZE (128) - -#define ITERATIONS (1000000ul) - -#define RAMP_INTERFACE -/* -#define COLLECT_WORLD -*/ - -void *stackpointer; - -mps_space_t arena; -mps_pool_t poolamc; -mps_thr_t thread; -mps_root_t root, root1; - -mps_fmt_t format; -mps_ap_t apamc; - -static mps_addr_t objtab[TABSIZE]; - -static void alloc_back(void) { - long int i, j; - - for (j = 0; j < BACKITER; j++) { - i = ranint(ranint(ranint(ranint(TABSIZE)+1)+1)+1); - objtab[i] = allocdumb(apamc, BACKSIZE, MPS_RANK_EXACT); - } -} - - -static void test(void) { - long int i; - long int rsize; - mps_message_t message; - - int inramp; - - mycell *r, *s; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), - (size_t) 1024*1024*ARENALIMIT), - "create space"); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie( - mps_root_create_reg(&root, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_root_create_table(&root1, arena, MPS_RANK_EXACT, 0, &objtab[0], TABSIZE), - "create root table"); - - cdie( - mps_fmt_create_A(&format, arena, &fmtA), - "create format"); - - cdie( - mps_pool_create(&poolamc, arena, mps_class_amc(), format), - "create pool"); - - cdie( - mps_ap_create(&apamc, poolamc, MPS_RANK_EXACT), - "create ap"); - - mps_message_type_enable(arena, mps_message_type_collection_stats()); - - inramp = 0; - - for (i = 0; i < ITERATIONS; i++) { - if (i % 10000 == 0) { - comment("%ld of %ld", i, ITERATIONS); - } - alloc_back(); - if (inramp) { - s = allocone(apamc, 3, MPS_RANK_EXACT); - setref(r, 0, s); - setref(s, 1, r); - r = s; - s = allocdumb(apamc, RAMPSIZE, MPS_RANK_EXACT); - setref(r, 2, s); - rsize ++; - if (ranint(LEAVERAMP) == 0) { - r = allocone(apamc, 2, MPS_RANK_EXACT); - s = allocone(apamc, 2, MPS_RANK_EXACT); -#ifdef RAMP_INTERFACE - mps_ap_alloc_pattern_end(apamc, mps_alloc_pattern_ramp_collect_all()); -#endif -#ifdef COLLECT_WORLD - mps_arena_collect(arena); - mps_arena_release(arena); -#endif - comment("ramp end, %ld objects", rsize); - inramp = 0; - } - } else { - if (ranint(ENTERRAMP) == 0) { -#ifdef RAMP_INTERFACE - mps_ap_alloc_pattern_begin(apamc, mps_alloc_pattern_ramp_collect_all()); -#endif - comment("ramp begin"); - r = allocone(apamc, 3, MPS_RANK_EXACT); - inramp = 1; - rsize = 0; - } - } - if(mps_message_get(&message, arena, mps_message_type_collection_stats())) { - unsigned long live, condemned, notCondemned; - live = mps_message_collection_stats_live_size(arena, message); - condemned = mps_message_collection_stats_condemned_size(arena, message); - notCondemned = - mps_message_collection_stats_not_condemned_size(arena, message); - comment("Collection: live=%ld, condemned=%ld, not condemned = %ld", - live, condemned, notCondemned); - mps_message_discard(arena, message); - } - } - - mps_ap_destroy(apamc); - comment("Destroyed ap."); - - mps_pool_destroy(poolamc); - comment("Destroyed pool."); - - mps_fmt_destroy(format); - comment("Destroyed format."); - - mps_root_destroy(root1); - mps_root_destroy(root); - comment("Destroyed roots."); - - mps_thread_dereg(thread); - comment("Deregistered thread."); - - mps_arena_destroy(arena); - comment("Destroyed space."); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - report("result", "pass"); - return 0; -} diff --git a/mps/qa/function/224.c b/mps/qa/function/224.c deleted file mode 100644 index 49472501948..00000000000 --- a/mps/qa/function/224.c +++ /dev/null @@ -1,53 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!224.c(trunk.1) $ - summary = MV allocate large promise, make it small, repeat - language = c - link = testlib.o - harness = 2.5 - parameters = EXTENDBY=65536 AVGSIZE=32 PROMISE=64 ITERATE=2000 -END_HEADER - -This one is supposed to fail, telling us that MV is badly fragmented. -*/ - -#include "testlib.h" -#include "mpscmv.h" -#include "mpsavm.h" - - -#define VMNZSIZE ((size_t) 30*1024*1024) - - -static void test(void) -{ - mps_arena_t arena; - mps_pool_t pool; - mps_addr_t q; - int p; - - die(mps_arena_create(&arena, mps_arena_class_vmnz(), VMNZSIZE), "create"); - die(mps_arena_commit_limit_set(arena, VMNZSIZE), "commit limit"); - - die(mps_pool_create(&pool, arena, mps_class_mv(), - EXTENDBY, AVGSIZE, EXTENDBY), - "pool create"); - - for (p=0; p prevstale) { - prevstale = stale; - comment("inc to %d at %d", stale, i); - } - for (j = 0; j < JUNK; j++) { - a = allocdumb(apamc, ranint(1000), MPS_RANK_EXACT); - } - } - } - - mps_ap_destroy(apawl); - mps_ap_destroy(apamc); - comment("Destroyed aps."); - - mps_pool_destroy(poolmv); - mps_pool_destroy(poolamc); - mps_pool_destroy(poolawl); - comment("Destroyed pools."); - - mps_fmt_destroy(format); - comment("Destroyed format."); - - mps_root_destroy(root0); - mps_root_destroy(root1); - mps_root_destroy(root2); - comment("Destroyed roots."); - - mps_thread_dereg(thread); - comment("Deregistered thread."); - - mps_space_destroy(arena); - comment("Destroyed arena."); - -} - -int main(void) { - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/227.c b/mps/qa/function/227.c deleted file mode 100644 index 4c97621d676..00000000000 --- a/mps/qa/function/227.c +++ /dev/null @@ -1,202 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!124.c(trunk.2) $ - summary = allocate in 2 arenas - language = c - link = testlib.o rankfmt.o -OUTPUT_SPEC - result = pass -END_HEADER -*/ - -/* This test is basically MMQA_test_function!124.c modified to - used two arenas -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "mpsavm.h" -#include "rankfmt.h" - -#define ARENALIMIT (100) - -#define TABSIZE (50000) -#define ENTERRAMP (30000) -#define LEAVERAMP (100000) - -#define BACKSIZE (32) -#define BACKITER (32) -#define RAMPSIZE (128) - -#define ITERATIONS (1000000ul) - -#define RAMP_INTERFACE -/* -#define COLLECT_WORLD -*/ - -void *stackpointer; - -mps_space_t arena1, arena2; -mps_pool_t poolamc1, poolamc2; -mps_thr_t thread1, thread2; -mps_root_t root1, root1a, root2, root2a; - -mps_fmt_t format1, format2; -mps_ap_t apamc1, apamc2; - -static mps_addr_t objtab1[TABSIZE], objtab2[TABSIZE]; - -static void alloc_back(void) { - long int i, j; - for (j = 0; j < BACKITER; j++) { - i = ranint(ranint(ranint(ranint(TABSIZE)+1)+1)+1); - objtab1[i] = allocdumb(apamc1, BACKSIZE*2, MPS_RANK_EXACT); - i = ranint(ranint(ranint(ranint(TABSIZE)+1)+1)+1); - objtab2[i] = allocdumb(apamc2, BACKSIZE, MPS_RANK_EXACT); - } -} - -static void test(void) { - long int i; - long int rsize; - - int inramp; - - mycell *r1, *r2, *s1, *s2; - - cdie(mps_arena_create(&arena1, mps_arena_class_vm(), - (size_t) 1024*1024*ARENALIMIT), "create space"); - cdie(mps_arena_create(&arena2, mps_arena_class_vm(), - (size_t) 1024*1024*ARENALIMIT), "create space"); - - cdie(mps_thread_reg(&thread1, arena1), "register thread"); - cdie(mps_thread_reg(&thread2, arena2), "register thread"); - - cdie( - mps_root_create_reg(&root1, arena1, MPS_RANK_AMBIG, 0, thread1, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - cdie( - mps_root_create_reg(&root2, arena2, MPS_RANK_AMBIG, 0, thread2, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_root_create_table(&root1a, arena1, MPS_RANK_EXACT, 0, &objtab1[0], TABSIZE), - "create root table"); - cdie( - mps_root_create_table(&root2a, arena2, MPS_RANK_EXACT, 0, &objtab2[0], TABSIZE), - "create root table"); - - cdie( - mps_fmt_create_A(&format1, arena1, &fmtA), - "create format"); - cdie( - mps_fmt_create_A(&format2, arena2, &fmtA), - "create format"); - - cdie( - mps_pool_create(&poolamc1, arena1, mps_class_amc(), format1), - "create pool"); - cdie( - mps_pool_create(&poolamc2, arena2, mps_class_amc(), format2), - "create pool"); - - cdie( - mps_ap_create(&apamc1, poolamc1, MPS_RANK_EXACT), - "create ap"); - cdie( - mps_ap_create(&apamc2, poolamc2, MPS_RANK_EXACT), - "create ap"); - - inramp = 0; - - for (i = 0; i < ITERATIONS; i++) { - if (i % 10000 == 0) { - comment("%ld of %ld", i, ITERATIONS); - } - alloc_back(); - if (inramp) { - s1 = allocone(apamc1, 3, MPS_RANK_EXACT); - s2 = allocone(apamc2, 3, MPS_RANK_EXACT); - setref(r1, 0, s1); - setref(r2, 0, s2); - setref(s1, 1, r1); - setref(s2, 1, r2); - r1 = s1; - r2 = s2; - s1 = allocdumb(apamc1, RAMPSIZE, MPS_RANK_EXACT); - s2 = allocdumb(apamc2, RAMPSIZE, MPS_RANK_EXACT); - setref(r1, 2, s1); - setref(r2, 2, s2); - rsize ++; - if (ranint(LEAVERAMP) == 0) { - r1 = allocone(apamc1, 2, MPS_RANK_EXACT); - r2 = allocone(apamc2, 2, MPS_RANK_EXACT); - s1 = allocone(apamc1, 2, MPS_RANK_EXACT); - s2 = allocone(apamc2, 2, MPS_RANK_EXACT); -#ifdef RAMP_INTERFACE - mps_ap_alloc_pattern_end(apamc1, mps_alloc_pattern_ramp()); - mps_ap_alloc_pattern_end(apamc2, mps_alloc_pattern_ramp()); -#endif -#ifdef COLLECT_WORLD - mps_arena_collect(arena1); - mps_arena_collect(arena2); - mps_arena_release(arena1); - mps_arena_release(arena2); -#endif - comment("ramp end, %ld objects", rsize); - inramp = 0; - } - } else { - if (ranint(ENTERRAMP) == 0) { -#ifdef RAMP_INTERFACE - mps_ap_alloc_pattern_begin(apamc1, mps_alloc_pattern_ramp()); - mps_ap_alloc_pattern_begin(apamc2, mps_alloc_pattern_ramp()); -#endif - comment("ramp begin"); - r1 = allocone(apamc1, 3, MPS_RANK_EXACT); - r2 = allocone(apamc2, 3, MPS_RANK_EXACT); - inramp = 1; - rsize = 0; - } - } - } - - mps_ap_destroy(apamc1); - mps_ap_destroy(apamc2); - comment("Destroyed ap."); - - mps_pool_destroy(poolamc1); - mps_pool_destroy(poolamc2); - comment("Destroyed pool."); - - mps_fmt_destroy(format1); - mps_fmt_destroy(format2); - comment("Destroyed format."); - - mps_root_destroy(root1); - mps_root_destroy(root1a); - mps_root_destroy(root2); - mps_root_destroy(root2a); - comment("Destroyed roots."); - - mps_thread_dereg(thread1); - mps_thread_dereg(thread2); - comment("Deregistered thread."); - - mps_arena_destroy(arena1); - mps_arena_destroy(arena2); - comment("Destroyed space."); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - report("result", "pass"); - return 0; -} diff --git a/mps/qa/function/23.c b/mps/qa/function/23.c deleted file mode 100644 index aacfd20c991..00000000000 --- a/mps/qa/function/23.c +++ /dev/null @@ -1,129 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!23.c(trunk.5) $ - summary = ensure allocation in MV pool causes collection - language = c - link = newfmt.o testlib.o -OUTPUT_SPEC - diff23 < 5 -END_HEADER -*/ - -/* this is same as test 3.c, with input of 0x4000 - and a limit of 100 not 10000 iterations -*/ - -#include "testlib.h" -#include "mpscmv.h" -#include "mpscamc.h" -#include "mpsavm.h" -#include "newfmt.h" - - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - - -void *stackpointer; - - -static void test(void) -{ - mps_arena_t arena; - mps_pool_t poolMV, poolAMC; - mps_thr_t thread; - - mps_fmt_t format; - mps_chain_t chain; - mps_ap_t ap; - mps_res_t r; - - mycell *a; - mps_addr_t p; - - int i; - int s1, s2, s3; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), mmqaArenaSIZE), - "create arena"); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - - die(mps_fmt_create_A(&format, arena, &fmtA), "create format"); - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - formatcomments = 0; - - die(mmqa_pool_create_chain(&poolAMC, arena, mps_class_amc(), format, chain), - "create pool"); - - cdie( - mps_ap_create(&ap, poolAMC, MPS_RANK_EXACT), - "create ap"); - - comment("Sizes in megabytes:"); - - die(mps_pool_create(&poolMV, arena, mps_class_mv(), - 1024*128, 1024*64, 1024*1024), - "create MV pool"); - i = 0; - while ((r=mps_alloc(&p, poolMV, 1024*1024)) == 0) i++; - report("refuse1", "%s", err_text(r)); - report("size1", "%i", i); - s1 = i; - mps_pool_destroy(poolMV); - - die(mps_pool_create(&poolMV, arena, mps_class_mv(), - 1024*128, 1024*64, 1024*1024), - "create MV pool"); - i = 0; - while ((r=mps_alloc(&p, poolMV, 1024*1024)) == 0) i++; - report("refuse2", "%s", err_text(r)); - report("size2", "%i", i); - s2 = i; - mps_pool_destroy(poolMV); - - a = allocdumb(ap, 1024*1024*30); /* allocate 30 M object */ - - die(mps_pool_create(&poolMV, arena, mps_class_mv(), - 1024*128, 1024*64, 1024*1024), - "create MV pool"); - i=0; - while ((r=mps_alloc(&p, poolMV, 1024*1024)) == 0) i++; - report("refuse3", "%s", err_text(r)); - report("size3", "%i", i); - s3 = i; - - report("diff12", "%i", s1-s2); - report("diff23", "%i", s2-s3); - - for(i = 0; i < 10; i++) { - r = mps_alloc(&p, poolMV, 1024*1024); - report("refuse4", "%s", err_text(r)); - } - mps_pool_destroy(poolMV); - - mps_ap_destroy(ap); - - mps_pool_destroy(poolAMC); - comment("Destroyed pool."); - - mps_chain_destroy(chain); - mps_fmt_destroy(format); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/24.c b/mps/qa/function/24.c deleted file mode 100644 index 365bb946369..00000000000 --- a/mps/qa/function/24.c +++ /dev/null @@ -1,120 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = Allocate but never look at objects - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" - -void *stackpointer; - -static mps_res_t myscan(mps_ss_t ss, mps_addr_t base, mps_addr_t limit) -{ - MPS_SCAN_BEGIN(ss) - comment("Scan: %p", base); - MPS_SCAN_END(ss); - return MPS_RES_OK; -} - -static mps_addr_t myskip(mps_addr_t object) -{ - return (mps_addr_t) ((char *) object + 1); -} - -static void mycopy(mps_addr_t object, mps_addr_t to) -{ -} - -static void mypad(mps_addr_t base, size_t size) -{ -} - -static mps_addr_t myisfwd(mps_addr_t object) -{ - return NULL; -} - -static void myfwd(mps_addr_t object, mps_addr_t to) -{ -} - -struct mps_fmt_A_s fmtA = -{ - 1, - &myscan, - &myskip, - &mycopy, - &myfwd, - &myisfwd, - &mypad -}; - - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_ap_t ap; - - mps_addr_t p; - - int i; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - cdie( - mps_pool_create(&pool, space, mps_class_amc(), format), - "create pool"); - - cdie( - mps_ap_create(&ap, pool, MPS_RANK_EXACT), - "create ap"); - - for(i=1; i<1000; i++) - { - do - { die(mps_reserve(&p, ap, 10*1024*1024), "Reserve: "); - } - while (!mps_commit(ap, p, 10*1024*1024)); - comment("%i at %p", i, p); - comment("%i objects of 10 megabytes each allocated", i); - } - - mps_ap_destroy(ap); - mps_pool_destroy(pool); - mps_fmt_destroy(format); - mps_root_destroy(root); - mps_thread_dereg(thread); - mps_space_destroy(space); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} - diff --git a/mps/qa/function/25.c b/mps/qa/function/25.c deleted file mode 100644 index 65bc08b0230..00000000000 --- a/mps/qa/function/25.c +++ /dev/null @@ -1,125 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!25.c(trunk.6) $ - summary = string twiddling with an LO pool - language = c - link = lofmt.o testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpsclo.h" -#include "lofmt.h" -#include - - -void *stackpointer; -mps_ap_t ap; - -#define MAXLEN 1000000; - - -static locell *string_ch(char* x) { - size_t len; - locell *y; - - len = strlen(x); - - y = alloclo(ap, len+1); - memcpy(y->data.data, x, len+1); - y->data.len = len; - - return y; -} - - -static locell *conc(locell *x, locell *y) { - size_t l, m; - locell *z; - - l = x->data.len; - m = y->data.len; - - z = alloclo(ap, l+m+1); - memcpy(z->data.data, x->data.data, l); - memcpy(&(z->data.data[l]), y->data.data, m); - z->data.data[l+m] = '\0'; - z->data.len = l+m; - - return z; -} - - -static void test(void) { - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - - locell *a,*b,*c; - int i; - - alloclocomments = 0; - allowlocopies = 0; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(&format, space, &fmtLO), - "create format"); - - cdie( - mps_pool_create(&pool, space, mps_class_lo(), format), - "create pool"); - - cdie( - mps_ap_create(&ap, pool, MPS_RANK_EXACT), - "create ap"); - - a = string_ch("Hello there"); - b = string_ch("Wibble wobble foo"); - c = string_ch("Ba "); - - for (i=0; i<10000; i++) { - a = conc(string_ch("B"), a); - c = conc(string_ch("Hello there"), string_ch(" folks!")); - } - - mps_ap_destroy(ap); - comment("Destroyed ap."); - - mps_pool_destroy(pool); - comment("Destroyed pool."); - - mps_fmt_destroy(format); - comment("Destroyed format."); - - mps_root_destroy(root); - comment("Destroyed root."); - - mps_thread_dereg(thread); - comment("Deregistered thread."); - - mps_space_destroy(space); - comment("Destroyed space."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/26.c b/mps/qa/function/26.c deleted file mode 100644 index 70824255e81..00000000000 --- a/mps/qa/function/26.c +++ /dev/null @@ -1,62 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = try to allocate as large an object as will succeed - language = c - link = testlib.o -OUTPUT_SPEC - maxsize > 100000000 -END_HEADER -*/ - -#include "testlib.h" -#include "mpscmv.h" - -mps_space_t space; -mps_pool_t pool; -mps_addr_t q; - -static mps_res_t trysize(size_t try) { - mps_res_t res; - - die(mps_pool_create(&pool, space, mps_class_mv(), - 1024*32, 1024*16, 1024*256), "pool"); - - comment("Trying %x", try); - - res = mps_alloc(&q, pool, try); - mps_pool_destroy(pool); - - comment("%s", err_text(res)); - - return res; -} - -static void test(void) { - size_t inf, sup, try; - - die(mps_space_create(&space), "create"); - - inf = 0; - sup = 1024*1024*1000; /* i.e. 1 gigabyte */ - - while (sup-inf > 1) { - try = inf + (sup-inf)/2; - if (trysize(try) == MPS_RES_OK) { - inf = try; - } else { - sup = try; - } - } - - for (try = inf-4; try < inf+4; try++) - (void) trysize(try); - - report("maxsize", "%lu", (unsigned long) inf); -} - -int main(void) { - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/27.c b/mps/qa/function/27.c deleted file mode 100644 index 62bf41a4166..00000000000 --- a/mps/qa/function/27.c +++ /dev/null @@ -1,93 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!27.c(trunk.4) $ - summary = mutually referring objects should die - language = c - link = testlib.o newfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "mpsavm.h" -#include "newfmt.h" - - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - - -void *stackpointer; - -mps_ap_t ap; -size_t s; -int nrefs; - - -static void test(void) -{ - mps_arena_t arena; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_chain_t chain; - - int h; - mycell *p, *q, *r; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), mmqaArenaSIZE), - "create arena"); - - die(mps_thread_reg(&thread, arena), "register thread"); - die(mps_root_create_reg(&root, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - die(mps_fmt_create_A(&format, arena, &fmtA), "create format"); - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - cdie(mmqa_pool_create_chain(&pool, arena, mps_class_amc(), format, chain), - "create pool"); - - cdie(mps_ap_create(&ap, pool, MPS_RANK_EXACT), "create ap"); - - r = allocone(ap, 1000); - - for (h = 0; h < 10000; h++) { - if (h % 10 == 0) { - report("iter", "%i", h); - } - q = allocone(ap, 1000); - p = allocone(ap, 1000); - setref(p, 1, q); - r = allocone(ap, 1000); - setref(q, 50, r); - setref(r, 1, p); - - } - - mps_ap_destroy(ap); - - mps_pool_destroy(pool); - mps_chain_destroy(chain); - mps_fmt_destroy(format); - mps_root_destroy(root); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/28.c b/mps/qa/function/28.c deleted file mode 100644 index 151a1f71efb..00000000000 --- a/mps/qa/function/28.c +++ /dev/null @@ -1,118 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!28.c(trunk.4) $ - summary = provoke segsummary assertion (request.dylan.170450) - language = c - link = testlib.o awlfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "mpsavm.h" -#include "awlfmt.h" - - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - -void *stackpointer; - - -static void test(void) -{ - mps_arena_t arena; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_chain_t chain; - mps_ap_t ap; - - mycell *a, *b, *c, *d, *e, *f, *g; - - int i; - int j; - - RC; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), mmqaArenaSIZE), - "create arena"); - - die(mps_thread_reg(&thread, arena), "register thread"); - die(mps_root_create_reg(&root, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - die(mps_fmt_create_A(&format, arena, &fmtA), "create format"); - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - die(mmqa_pool_create_chain(&pool, arena, mps_class_amc(), format, chain), - "create pool"); - - cdie( - mps_ap_create(&ap, pool, MPS_RANK_EXACT), - "create ap"); - - for (j=1; j<10; j++) - { - comment("%i of 10.", j); - UC; - a = allocone(ap, 5, 1); - b = a; - c = a; - d = a; - e = a; - f = a; - g = a; - - for (i=1; i<1000; i++) - { - UC; - c = allocone(ap, 1000, 1); - if (ranint(8) == 0) d = c; - if (ranint(8) == 0) e = c; - if (ranint(8) == 0) f = c; - if (ranint(8) == 0) g = c; - UC; - setref(b, 0, c); - UC; - setref(c, 1, d); - UC; - setref(c, 2, e); - UC; - setref(c, 3, f); - UC; - setref(c, 4, g); - UC; - b = c; - } - } - DC; - DMC; - - checkfrom(a); - - mps_ap_destroy(ap); - mps_pool_destroy(pool); - mps_chain_destroy(chain); - mps_fmt_destroy(format); - mps_root_destroy(root); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/29.c b/mps/qa/function/29.c deleted file mode 100644 index ed05d39fb5f..00000000000 --- a/mps/qa/function/29.c +++ /dev/null @@ -1,125 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!29.c(trunk.4) $ - summary = big allocation with an LO pool - language = c - link = lofmt.o testlib.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpsclo.h" -#include "lofmt.h" -#include - -void *stackpointer; -mps_ap_t ap; - -#define MAXLEN 1000000; - - -static locell *string_ch(char* x) { - size_t len; - locell *y; - - len = strlen(x); - - y = alloclo(ap, len+1); - memcpy(y->data.data, x, len+1); - y->data.len = len; - - return y; -} - - -static locell *conc(locell *x, locell *y) { - size_t l, m; - locell *z; - - l = x->data.len; - m = y->data.len; - - z = alloclo(ap, l+m+1); - memcpy(z->data.data, x->data.data, l); - memcpy(&(z->data.data[l]), y->data.data, m); - z->data.data[l+m] = '\0'; - z->data.len = l+m; - - return z; -} - - -static void test(void) { - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - - locell *a,*b,*c,*z; - int i; - - alloclocomments = 0; - allowlocopies = 0; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(&format, space, &fmtLO), - "create format"); - - cdie( - mps_pool_create(&pool, space, mps_class_lo(), format), - "create pool"); - - cdie( - mps_ap_create(&ap, pool, MPS_RANK_EXACT), - "create ap"); - - a = string_ch("Hello there"); - b = string_ch("Wibble wobble foo"); - c = string_ch("Ba "); - - for (i=0; i<10000; i++) { - a = conc(string_ch("B"), a); - c = conc(string_ch("Hello there"), string_ch(" folks!")); - z = alloclo(ap, 0x4000); - } - - mps_ap_destroy(ap); - comment("Destroyed ap."); - - mps_pool_destroy(pool); - comment("Destroyed pool."); - - mps_fmt_destroy(format); - comment("Destroyed format."); - - mps_root_destroy(root); - comment("Destroyed root."); - - mps_thread_dereg(thread); - comment("Deregistered thread."); - - mps_space_destroy(space); - comment("Destroyed space."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/3.c b/mps/qa/function/3.c deleted file mode 100644 index 9204dbdccd8..00000000000 --- a/mps/qa/function/3.c +++ /dev/null @@ -1,102 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = allocate 100 items, throw away and repeat - language = c - link = myfmt.o testlib.o - manual = true -END_HEADER -*/ - -/* you have to type in the size (in hex) of the items allocated */ -/* try with 0x4000 for a bug after 35 iterations */ -/* successful for 10, as a leak test */ - -#include "testlib.h" -#include "mpscamc.h" -#include "myfmt.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_ap_t ap; - - mycell *a,*b,*c; - size_t inpsize; - - int i,j; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - formatcomments = 0; - - cdie( - mps_pool_create(&pool, space, mps_class_amc(), format), - "create pool"); - - cdie( - mps_ap_create(&ap, pool, MPS_RANK_EXACT), - "create ap"); - - scanf("%lx", &inpsize); - - for (j=0; j<10000; j++) - { - a = allocone(ap, 0, NULL, NULL, inpsize); - b = a; - - for (i=1; i<100; i++) - { - c = allocone(ap, i, NULL, NULL, inpsize); - b->ref[0] = c; - b = c; - } - - comment("%d: %x", j, (int) a); - } - - mps_ap_destroy(ap); - comment("Destroyed ap."); - - mps_pool_destroy(pool); - comment("Destroyed pool."); - - mps_fmt_destroy(format); - comment("Destroyed format."); - - mps_root_destroy(root); - comment("Destroyed root."); - - mps_thread_dereg(thread); - comment("Deregistered thread."); - - mps_space_destroy(space); - comment("Destroyed space."); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/function/30.c b/mps/qa/function/30.c deleted file mode 100644 index c27fa081788..00000000000 --- a/mps/qa/function/30.c +++ /dev/null @@ -1,106 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!30.c(trunk.6) $ - summary = test my format for checking the graph - language = c - link = testlib.o awlfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscawl.h" -#include "awlfmt.h" -#include "mpsavm.h" - - -void *stackpointer; - - -static void test(void) -{ - mps_arena_t arena; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_ap_t ap; - - mycell *a, *b, *c, *d, *e, *f, *g; - - int i; - int j; - - RC; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), mmqaArenaSIZE), - "create arena"); - - die(mps_thread_reg(&thread, arena), "register thread"); - die(mps_root_create_reg(&root, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie(mps_fmt_create_A(&format, arena, &fmtA), "create format"); - - die(mps_pool_create(&pool, arena, mps_class_awl(), format), - "create pool"); - - cdie(mps_ap_create(&ap, pool, MPS_RANK_EXACT), "create ap"); - - for (j = 1; j < 100; j++) { - comment("%i of 100.", j); - UC; - a = allocone(ap, 5, 1); - b = a; - c = a; - d = a; - e = a; - f = a; - g = a; - - for (i = 1; i < 100; i++) { - UC; - c = allocone(ap, 1000, 1); - if (ranint(8) == 0) d = c; - if (ranint(8) == 0) e = c; - if (ranint(8) == 0) f = c; - if (ranint(8) == 0) g = c; - UC; - setref(b, 0, c); - UC; - setref(c, 1, d); - UC; - setref(c, 2, e); - UC; - setref(c, 3, f); - UC; - setref(c, 4, g); - UC; - b = c; - } - } - DC; - DMC; - - checkfrom(a); - - mps_ap_destroy(ap); - mps_pool_destroy(pool); - mps_fmt_destroy(format); - mps_root_destroy(root); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/31.c b/mps/qa/function/31.c deleted file mode 100644 index 2e5900e82e6..00000000000 --- a/mps/qa/function/31.c +++ /dev/null @@ -1,111 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!31.c(trunk.5) $ - summary = regression test for request.dylan.170459 (scanning and buffers in AWL) - language = c - link = testlib.o awlfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscawl.h" -#include "mpscamc.h" -#include "awlfmt.h" -#include "mpsavm.h" - - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - - -void *stackpointer; - - -static void test(void) -{ - mps_arena_t arena; - mps_pool_t poolamc, poolawl; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_chain_t chain; - mps_ap_t apamc, apawl; - - mycell *a, *b, *c; - - int i; - - alloccomments = 1; - fixcomments = 1; - deathcomments = 1; - formatcomments = 1; - fixcomments = 1; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), mmqaArenaSIZE), - "create arena"); - - die(mps_thread_reg(&thread, arena), "register thread"); - die(mps_root_create_reg(&root, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - die(mps_fmt_create_A(&format, arena, &fmtA), "create format"); - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - die(mmqa_pool_create_chain(&poolamc, arena, mps_class_amc(), format, chain), - "create pool"); - - cdie( - mps_pool_create(&poolawl, arena, mps_class_awl(), format), - "create pool"); - - cdie( - mps_ap_create(&apawl, poolawl, MPS_RANK_EXACT), - "create ap"); - - cdie( - mps_ap_create(&apamc, poolamc, MPS_RANK_EXACT), - "create ap"); - - a = allocone(apawl, 1, 1); - b = allocone(apawl, 1, 1); - c = allocone(apawl, 1000, 1); - - setref(b, 0, c); - setref(c, 0, b); - - for(i=0; i<1000; i++) { - b = allocdumb(apamc, 0x400*1024, 0); - if (i % 50 == 0) - comment("%d of 1000.", i); - } - - mps_ap_destroy(apawl); - mps_ap_destroy(apamc); - comment("Destroyed aps."); - - mps_pool_destroy(poolamc); - mps_pool_destroy(poolawl); - comment("Destroyed pools."); - - mps_chain_destroy(chain); - mps_fmt_destroy(format); - mps_root_destroy(root); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/32.c b/mps/qa/function/32.c deleted file mode 100644 index be90aff3281..00000000000 --- a/mps/qa/function/32.c +++ /dev/null @@ -1,107 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!32.c(trunk.5) $ - summary = random test of exact references in AWL - language = c - link = testlib.o awlfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscawl.h" -#include "mpscamc.h" -#include "awlfmt.h" -#include "mpsavm.h" - - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - - -void *stackpointer; - - -static void test(void) -{ - mps_arena_t arena; - mps_pool_t poolamc, poolawl; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_chain_t chain; - mps_ap_t apamc, apawl; - - mycell *a[100], *b; - - int i; - int j; - int k,z; - - alloccomments = 1; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), mmqaArenaSIZE), - "create arena"); - - die(mps_thread_reg(&thread, arena), "register thread"); - die(mps_root_create_reg(&root, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - die(mps_fmt_create_A(&format, arena, &fmtA), "create format"); - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - die(mmqa_pool_create_chain(&poolamc, arena, mps_class_amc(), format, chain), - "create pool"); - - cdie( - mps_pool_create(&poolawl, arena, mps_class_awl(), format), - "create pool"); - - cdie( - mps_ap_create(&apawl, poolawl, MPS_RANK_EXACT), - "create ap"); - - cdie( - mps_ap_create(&apamc, poolamc, MPS_RANK_EXACT), - "create ap"); - - for(i=0; i<100; i++) { - a[i] = allocone(apawl, 6, 1); - } - - for(i=0; i<10000; i++) { - j = ranint(100); - comment("New object %i", j); - a[j] = allocone(apawl, 5+ranint(50), 1); - k = ranint(100); - z = ranint(5); - comment("setting %i (%p) %i", k, a[k], z); - setref(a[k], z, a[j]); - b = allocdumb(apamc, 0x400*64, 0); - } - - mps_ap_destroy(apawl); - mps_ap_destroy(apamc); - mps_pool_destroy(poolamc); - mps_pool_destroy(poolawl); - mps_chain_destroy(chain); - mps_fmt_destroy(format); - mps_root_destroy(root); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/33.c b/mps/qa/function/33.c deleted file mode 100644 index 749ed488521..00000000000 --- a/mps/qa/function/33.c +++ /dev/null @@ -1,106 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!33.c(trunk.5) $ - summary = random test of exact references in AWL - language = c - link = testlib.o awlfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscawl.h" -#include "mpscamc.h" -#include "awlfmt.h" -#include "mpsavm.h" - - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - -void *stackpointer; - - -static void test(void) -{ - mps_arena_t arena; - mps_pool_t poolamc, poolawl; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_chain_t chain; - mps_ap_t apamc, apawl; - - mycell *a[100], *b; - - int i; - int j; - int k,z; - - alloccomments = 1; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), mmqaArenaSIZE), - "create arena"); - - die(mps_thread_reg(&thread, arena), "register thread"); - die(mps_root_create_reg(&root, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - die(mps_fmt_create_A(&format, arena, &fmtA), "create format"); - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - die(mmqa_pool_create_chain(&poolamc, arena, mps_class_amc(), format, chain), - "create pool"); - - cdie( - mps_pool_create(&poolawl, arena, mps_class_awl(), format), - "create pool"); - - cdie( - mps_ap_create(&apawl, poolawl, MPS_RANK_EXACT), - "create ap"); - - cdie( - mps_ap_create(&apamc, poolamc, MPS_RANK_EXACT), - "create ap"); - - for(i=0; i<100; i++) { - a[i] = allocone(apawl, 6, 1); - } - - for(i=0; i<10000; i++) { - j = ranint(100); - comment("New object %i", j); - a[j] = allocone(apawl, 5+ranint(50), 1); - k = ranint(50); - z = ranint(5); - comment("setting %i (%p) %i", k, a[k], z); - setref(a[k], z, a[j]); - b = allocdumb(apamc, 0x400*64, 0); - } - - mps_ap_destroy(apawl); - mps_ap_destroy(apamc); - mps_pool_destroy(poolamc); - mps_pool_destroy(poolawl); - mps_chain_destroy(chain); - mps_fmt_destroy(format); - mps_root_destroy(root); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/34.c b/mps/qa/function/34.c deleted file mode 100644 index f3e6cad7213..00000000000 --- a/mps/qa/function/34.c +++ /dev/null @@ -1,109 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!34.c(trunk.5) $ - summary = random test of exact references in AWL - language = c - link = testlib.o awlfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscawl.h" -#include "mpscamc.h" -#include "awlfmt.h" -#include "mpsavm.h" - - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - - -void *stackpointer; - - -static void test(void) -{ - mps_arena_t arena; - mps_pool_t poolamc, poolawl; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_chain_t chain; - mps_ap_t apamc, apawl; - - mycell *a[100], *b; - - int i; - int j; - int k,z; - - alloccomments = 1; - formatcomments = 1; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), mmqaArenaSIZE), - "create arena"); - - die(mps_thread_reg(&thread, arena), "register thread"); - die(mps_root_create_reg(&root, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - die(mps_fmt_create_A(&format, arena, &fmtA), "create format"); - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - die(mmqa_pool_create_chain(&poolamc, arena, mps_class_amc(), format, chain), - "create pool"); - - cdie( - mps_pool_create(&poolawl, arena, mps_class_awl(), format), - "create pool"); - - cdie( - mps_ap_create(&apawl, poolawl, MPS_RANK_EXACT), - "create ap"); - - cdie( - mps_ap_create(&apamc, poolamc, MPS_RANK_EXACT), - "create ap"); - - for(i=0; i<100; i++) { - a[i] = allocone(apawl, 6, 1); - } - - for(i=0; i<10000; i++) { - j = ranint(100); - k = 5 + ranint(50); - comment("New object %i, %i", j, k); - a[j] = allocone(apawl, k, 1); - k = ranint(100); - z = ranint(2); - comment("setting %i (%p) %i", k, a[k], z); - setref(a[k], z, a[j]); - b = allocdumb(apamc, 0x400*64, 0); - } - - mps_ap_destroy(apawl); - mps_ap_destroy(apamc); - mps_pool_destroy(poolamc); - mps_pool_destroy(poolawl); - mps_chain_destroy(chain); - mps_fmt_destroy(format); - mps_root_destroy(root); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/35.c b/mps/qa/function/35.c deleted file mode 100644 index 7b3e03e78b5..00000000000 --- a/mps/qa/function/35.c +++ /dev/null @@ -1,129 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!35.c(trunk.5) $ - summary = provoke segsummary assertion (request.dylan.170450) - language = c - link = testlib.o awlfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "mpsavm.h" -#include "awlfmt.h" - - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - - -void *stackpointer; - - -static void test(void) -{ - mps_arena_t arena; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_chain_t chain; - mps_ap_t ap; - - mycell *z[10]; - - mycell **a = &z[0]; - mycell **b = &z[1]; - mycell **c = &z[2]; - mycell **d = &z[3]; - mycell **e = &z[4]; - mycell **f = &z[5]; - mycell **g = &z[6]; - - int i; - int j; - - RC; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), mmqaArenaSIZE), - "create arena"); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie( - mps_root_create_table(&root, arena, MPS_RANK_EXACT, 0, (mps_addr_t*)&z[0], 10), - "create table root"); - - die(mps_fmt_create_A(&format, arena, &fmtA), "create format"); - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - cdie(mmqa_pool_create_chain(&pool, arena, mps_class_amc(), format, chain), - "create pool"); - - cdie( - mps_ap_create(&ap, pool, MPS_RANK_EXACT), - "create ap"); - - for (j=1; j<100; j++) - { - comment("%i of 100.", j); - UC; - *a = allocone(ap, 5, 1); - *b = *a; - *c = *a; - *d = *a; - *e = *a; - *f = *a; - *g = *a; - - for (i=1; i<1000; i++) - { - UC; - *c = allocone(ap, 1000, 1); - if (ranint(8) == 0) *d = *c; - if (ranint(8) == 0) *e = *c; - if (ranint(8) == 0) *f = *c; - if (ranint(8) == 0) *g = *c; - UC; - setref(*b, 0, *c); - UC; - setref(*c, 1, *d); - UC; - setref(*c, 2, *e); - UC; - setref(*c, 3, *f); - UC; - setref(*c, 4, *g); - UC; - *b = *c; - } - checkfrom(*a); - } - DC; - DMC; - - checkfrom(*a); - - mps_ap_destroy(ap); - mps_pool_destroy(pool); - mps_chain_destroy(chain); - mps_fmt_destroy(format); - mps_root_destroy(root); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/36.c b/mps/qa/function/36.c deleted file mode 100644 index ee6903308a0..00000000000 --- a/mps/qa/function/36.c +++ /dev/null @@ -1,114 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!36.c(trunk.5) $ - summary = random test of exact references in AWL - language = c - link = testlib.o awlfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscawl.h" -#include "mpscamc.h" -#include "awlfmt.h" -#include "mpsavm.h" - - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - - -void *stackpointer; - - -static void test(void) -{ - mps_arena_t arena; - mps_pool_t poolamc, poolawl; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_chain_t chain; - mps_ap_t apamc, apawl, apran; - - mycell *a[100], *c; - - int i; - int j; - int k,z; - - alloccomments = 1; - skipcomments = 1; - formatcomments = 1; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), mmqaArenaSIZE), - "create arena"); - - die(mps_thread_reg(&thread, arena), "register thread"); - die(mps_root_create_reg(&root, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - die(mps_fmt_create_A(&format, arena, &fmtA), "create format"); - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - die(mmqa_pool_create_chain(&poolamc, arena, mps_class_amc(), format, chain), - "create pool"); - - cdie( - mps_pool_create(&poolawl, arena, mps_class_awl(), format), - "create pool"); - - cdie( - mps_ap_create(&apawl, poolawl, MPS_RANK_EXACT), - "create ap"); - - cdie( - mps_ap_create(&apamc, poolamc, MPS_RANK_EXACT), - "create ap"); - - for(i=0; i<100; i++) { - a[i] = allocone(apamc, 6, 1); - } - - for(i=0; i<10000; i++) { - j = ranint(100); - k = 5 + ranint(500); - if (ranint(2)==1) { - apran = apawl; - } else { - apran = apamc; - } - c = a[j]; - a[j] = allocone(apran, k, 1); - k = ranint(100); - z = ranint(2); - setref(a[k], 0, c); - setref(a[j], z, a[k]); - } - - mps_ap_destroy(apawl); - mps_ap_destroy(apamc); - mps_pool_destroy(poolamc); - mps_pool_destroy(poolawl); - mps_chain_destroy(chain); - mps_fmt_destroy(format); - mps_root_destroy(root); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/37.c b/mps/qa/function/37.c deleted file mode 100644 index 7b891e5141d..00000000000 --- a/mps/qa/function/37.c +++ /dev/null @@ -1,132 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!37.c(trunk.5) $ - summary = check exfmt works. - language = c - link = testlib.o exfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "mpsavm.h" -#include "exfmt.h" - - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - - -void *stackpointer; - - -static void test(void) -{ - mps_arena_t arena; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - mps_root_t root2; - - mps_fmt_t format; - mps_chain_t chain; - mps_ap_t ap; - - mycell *z[10]; - - mycell **a = &z[0]; - mycell **b = &z[1]; - mycell **c = &z[2]; - mycell **d = &z[3]; - mycell **e = &z[4]; - mycell **f = &z[5]; - mycell **g = &z[6]; - - int i; - int j; - - RC; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), mmqaArenaSIZE), - "create arena"); - - die(mps_thread_reg(&thread, arena), "register thread"); - - cdie( - mps_root_create_table(&root, arena, MPS_RANK_AMBIG, 0, (mps_addr_t*)&z[0], 10), - "create table root"); - cdie( - mps_root_create_table(&root2, arena, MPS_RANK_AMBIG, 0, &exfmt_root, 1), - "create exfmt root"); - - die(mps_fmt_create_A(&format, arena, &fmtA), "create format"); - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - die(mmqa_pool_create_chain(&pool, arena, mps_class_amc(), format, chain), - "create pool"); - - cdie( - mps_ap_create(&ap, pool, MPS_RANK_EXACT), - "create ap"); - - for (j=1; j<10; j++) { - comment("%i of 10.", j); - UC; - *a = allocone(ap, 5, 1); - *b = *a; - *c = *a; - *d = *a; - *e = *a; - *f = *a; - *g = *a; - - for (i=1; i<1000; i++) { - UC; - *c = allocone(ap, 1000, 1); - if (ranint(8) == 0) *d = *c; - if (ranint(8) == 0) *e = *c; - if (ranint(8) == 0) *f = *c; - if (ranint(8) == 0) *g = *c; - UC; - setref(*b, 0, *c); - UC; - setref(*c, 1, *d); - UC; - setref(*c, 2, *e); - UC; - setref(*c, 3, *f); - UC; - setref(*c, 4, *g); - UC; - *b = *c; - } - checkfrom(*a); - } - DC; - DMC; - - checkfrom(*a); - - mps_ap_destroy(ap); - mps_pool_destroy(pool); - mps_chain_destroy(chain); - mps_fmt_destroy(format); - mps_root_destroy(root); - mps_root_destroy(root2); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/38.c b/mps/qa/function/38.c deleted file mode 100644 index 32d410e2eef..00000000000 --- a/mps/qa/function/38.c +++ /dev/null @@ -1,183 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!38.c(trunk.7) $ - summary = test of location dependencies - language = c - link = testlib.o rankfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscawl.h" -#include "mpscmv.h" -#include "mpscamc.h" -#include "mpsavm.h" -#include "rankfmt.h" -#include "mpsavm.h" - - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - -#define MAXLDS 100 - - -void *stackpointer; - -mps_arena_t arena; -static mycell *obj_table[MAXLDS]; -static mps_ld_t lds[MAXLDS]; - - -static void checklds(void) -{ - int i; - - for (i=0; i < MAXLDS; i++) { - if (obj_table[i]->data.copycount != 0) { - asserts(mps_ld_isstale(lds[i], arena, (mps_addr_t) obj_table[i]), - "%d isn't stale but should be", i); - if (ranint(4) == 0) { - obj_table[i]->data.copycount = 0; - mps_ld_reset(lds[i], arena); - comment("reset %d", i); - mps_ld_add(lds[i], arena, (mps_addr_t) obj_table[i]); - } - } - } -} - - -static void test(void) -{ - mps_pool_t poolmv, poolawl, poolamc; - mps_thr_t thread; - mps_root_t root0, root1, root2; - - mps_addr_t p; - mps_fmt_t format; - mps_chain_t chain; - mps_ap_t apawl, apamc; - - mycell *a, *b; - - int i,j; - - RC; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t)1024*1024*30), - "create arena"); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie(mps_root_create_table(&root0, arena, MPS_RANK_AMBIG, 0, - (mps_addr_t*)&exfmt_root, 1), - "create exfmt root"); - cdie(mps_root_create_table(&root2, arena, MPS_RANK_EXACT, 0, - (mps_addr_t *)obj_table, MAXLDS), - "create table root"); - - cdie(mps_root_create_reg(&root1, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create register and stack root"); - - cdie(mps_fmt_create_A(&format, arena, &fmtA), - "create format"); - - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - cdie(mps_pool_create(&poolawl, arena, mps_class_awl(), format), - "create awl pool"); - - cdie(mps_pool_create(&poolmv, arena, mps_class_mv(), 0x4000, 128, 0x4000), - "create mv pool"); - - cdie(mps_ap_create(&apawl, poolawl, MPS_RANK_EXACT), - "create ap"); - - /* First we'll use only pool classes MV and AWL. So LDs shouldn't */ - /* go stale at all. */ - - b = allocone(apawl, 5, MPS_RANK_EXACT); - - for (i=0; i < MAXLDS; i++) { - comment("%d", i); - mps_alloc(&p, poolmv, sizeof(mps_ld_s)); - a = allocone(apawl, 5, MPS_RANK_EXACT); - setref(a, 0, b); - b = a; - a = allocdumb(apawl, 256*1024, MPS_RANK_EXACT); - comment("alloc"); - lds[i] = p; - mps_ld_reset(lds[i], arena); - comment("reset"); - if (i>0) { - mps_ld_add(lds[i], arena, (mps_addr_t) b); - } - comment("add"); - } - - for (i=0; i < MAXLDS; i++) { - comment("%d", i); - asserts(mps_ld_isstale(lds[i], arena, p) == 0, - "%d stale but shouldn't be", i); - } - - /* Then use AMC, so object do move and LDs go stale. */ - - die(mmqa_pool_create_chain(&poolamc, arena, mps_class_amc(), format, chain), - "create pool"); - - cdie( - mps_ap_create(&apamc, poolamc, MPS_RANK_EXACT), - "create ap"); - - /* Allocate MAXLDS objects, and make each LD depend on the corresponding */ - /* object. */ - - for (i=0; i < MAXLDS; i++) { - comment("%d", i); - obj_table[i] = allocone(apamc, ranint(100), MPS_RANK_EXACT); - mps_ld_add(lds[i], arena, (mps_addr_t) obj_table[i]); - } - - for (i=0; i < 1000; i++) { - comment("%d of 1000", i); - checklds(); - for (j=0; j < 8; j++) { - a = allocdumb(apamc, 32*1024, MPS_RANK_EXACT); - } - } - - mps_ap_destroy(apawl); - mps_ap_destroy(apamc); - mps_pool_destroy(poolmv); - mps_pool_destroy(poolamc); - mps_pool_destroy(poolawl); - comment("Destroyed pools."); - - mps_chain_destroy(chain); - mps_fmt_destroy(format); - - mps_root_destroy(root0); - mps_root_destroy(root1); - mps_root_destroy(root2); - comment("Destroyed roots."); - - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/39.c b/mps/qa/function/39.c deleted file mode 100644 index 5bd09c6fc99..00000000000 --- a/mps/qa/function/39.c +++ /dev/null @@ -1,114 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!39.c(trunk.5) $ - summary = try to provoke request.dylan.170463 using LO pool - language = c - link = testlib.o awlfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscawl.h" -#include "mpscamc.h" -#include "mpsavm.h" -#include "mpsclo.h" -#include "awlfmt.h" - - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - - -void *stackpointer; - - -static void test(void) -{ - mps_arena_t arena; - mps_pool_t poolamc, poollo; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_chain_t chain; - mps_ap_t apamc, aplo; - - mycell *a[100], *b; - - int i; - int j; - int k,z; - - alloccomments = 1; - formatcomments = 1; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), mmqaArenaSIZE), - "create arena"); - - die(mps_thread_reg(&thread, arena), "register thread"); - die(mps_root_create_reg(&root, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - die(mps_fmt_create_A(&format, arena, &fmtA), "create format"); - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - die(mmqa_pool_create_chain(&poolamc, arena, mps_class_amc(), format, chain), - "create pool(amc)"); - - die(mps_pool_create(&poollo, arena, mps_class_lo(), format), - "create pool(lo)"); - - cdie( - mps_ap_create(&aplo, poollo, MPS_RANK_EXACT), - "create ap"); - - cdie( - mps_ap_create(&apamc, poolamc, MPS_RANK_EXACT), - "create ap"); - - for(i=0; i<100; i++) { - a[i] = allocone(aplo, 6, 1); - } - - for(i=0; i<10000; i++) { - j = ranint(100); - comment("New object %i", j); - a[j] = allocone(aplo, 5+ranint(50), 1); - k = ranint(50); - z = ranint(5); - comment("setting %i (%p) %i", k, a[k], z); - setref(a[k], z, a[j]); - b = allocdumb(apamc, 0x400*64, 0); - } - - mps_ap_destroy(aplo); - mps_ap_destroy(apamc); - comment("Destroyed aps."); - - mps_pool_destroy(poolamc); - mps_pool_destroy(poollo); - comment("Destroyed pools."); - - mps_chain_destroy(chain); - mps_fmt_destroy(format); - - mps_root_destroy(root); - mps_thread_dereg(thread); - - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/4.c b/mps/qa/function/4.c deleted file mode 100644 index b35a763c45d..00000000000 --- a/mps/qa/function/4.c +++ /dev/null @@ -1,114 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = allocate 100 items, throw away and repeat - language = c - link = myfmt.o testlib.o - manual = true -END_HEADER -*/ - -/* you have to type in the size (in hex) of the items allocated */ -/* same as test function/3.c, but - this version (4.c) prints timings for each 100 iterations, - so you can see if things slow down or speed up */ - -#include -#include "testlib.h" -#include "mpscamc.h" -#include "myfmt.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_ap_t ap; - - mycell *a,*b,*c; - size_t inpsize; - - int i,j,k; - clock_t time0, time1; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - formatcomments = 0; - - cdie( - mps_pool_create(&pool, space, mps_class_amc(), format), - "create pool"); - - cdie( - mps_ap_create(&ap, pool, MPS_RANK_EXACT), - "create ap"); - - scanf("%lx", &inpsize); - - time0 = clock(); - asserts(time0 != -1, "processor time not available"); - - for (k=0; k<100; k++) - { - - for (j=0; j<100; j++) - { - a = allocone(ap, 0, NULL, NULL, inpsize); - b = a; - - for (i=1; i<100; i++) - { - c = allocone(ap, i, NULL, NULL, inpsize); - b->ref[0] = c; - b = c; - } - } - - time1 = clock(); - comment("%d: %i", k, (int) (100*(time1-time0)/CLOCKS_PER_SEC)); - time0 = time1; - } - - mps_ap_destroy(ap); - comment("Destroyed ap."); - - mps_pool_destroy(pool); - comment("Destroyed pool."); - - mps_fmt_destroy(format); - comment("Destroyed format."); - - mps_root_destroy(root); - comment("Destroyed root."); - - mps_thread_dereg(thread); - comment("Deregistered thread."); - - mps_space_destroy(space); - comment("Destroyed space."); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/function/40.c b/mps/qa/function/40.c deleted file mode 100644 index 99f3aa44e9a..00000000000 --- a/mps/qa/function/40.c +++ /dev/null @@ -1,99 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!40.c(trunk.5) $ - summary = check tagged roots are scanned correctly - language = c - link = testlib.o exfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "mpsavm.h" -#include "exfmt.h" - - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - - -void *stackpointer; - - -static void test(void) -{ - mps_arena_t arena; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - mps_root_t root2; - - mps_fmt_t format; - mps_chain_t chain; - mps_ap_t ap; - - mycell *z[100]; - - int i; - - formatcomments = 1; - RC; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), mmqaArenaSIZE), - "create arena"); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - - die(mps_root_create_table_masked(&root, arena, MPS_RANK_EXACT, - 0, (mps_addr_t*)&z[0], 100, 0x4), - "create table root"); - die(mps_root_create_table(&root2, arena, MPS_RANK_AMBIG, 0, &exfmt_root, 1), - "create exfmt root"); - - die(mps_fmt_create_A(&format, arena, &fmtA), "create format"); - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - die(mmqa_pool_create_chain(&pool, arena, mps_class_amc(), format, chain), - "create pool(amc)"); - - cdie( - mps_ap_create(&ap, pool, MPS_RANK_EXACT), - "create ap"); - - for (i=0; i<100; i++) { - comment("%i of 10.", i); - UC; - z[i] = allocone(ap, 1, 1); - if (i % 8 == 0) { z[i] = (mycell *) ((int)z[i] + 4); } /* error to scan this! */ - } - - for (i=0; i<1000; i++) { - z[0] = allocone(ap, 1000, 0); - } - DC; - DMC; - - mps_ap_destroy(ap); - mps_pool_destroy(pool); - mps_chain_destroy(chain); - mps_fmt_destroy(format); - mps_root_destroy(root); - mps_root_destroy(root2); - comment("Destroyed roots."); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/41.c b/mps/qa/function/41.c deleted file mode 100644 index 4198792a52e..00000000000 --- a/mps/qa/function/41.c +++ /dev/null @@ -1,134 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!41.c(trunk.4) $ - summary = regression test for request.dylan.170427 - language = c - link = testlib.o awlfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscawl.h" -#include "mpscamc.h" -#include "awlfmt.h" -#include "mpsavm.h" - - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - - -void *stackpointer; - - -static void test(void) -{ - mps_arena_t arena; - mps_pool_t poolamc, poolawl; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_chain_t chain; - mps_ap_t apamc, apawl; - - mycell *a, *b, *c, *d, *e, *f, *g; - - int i; - int j; - - RC; - - fixcomments=1; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), mmqaArenaSIZE), - "create arena"); - - die(mps_thread_reg(&thread, arena), "register thread"); - die(mps_root_create_reg(&root, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - die(mps_fmt_create_A(&format, arena, &fmtA), "create format"); - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - die(mmqa_pool_create_chain(&poolamc, arena, mps_class_amc(), format, chain), - "create pool"); - - cdie( - mps_pool_create(&poolawl, arena, mps_class_awl(), format), - "create pool"); - - cdie( - mps_ap_create(&apawl, poolawl, MPS_RANK_WEAK), - "create ap"); - - cdie( - mps_ap_create(&apamc, poolamc, MPS_RANK_EXACT), - "create ap"); - - b = allocone(apamc, 1, 1); - - for (j=1; j<10; j++) { - comment("%i of 10.", j); - UC; - a = allocone(apawl, 5, 1); - a->data.assoc = stackpointer; - setref(b, 0, a); - b = a; - c = a; - d = a; - e = a; - f = a; - g = a; - - for (i=1; i<1000; i++) { - UC; - c = allocone(apamc, 10000, 1); - c = allocone(apawl, 10000, 1); - c->data.assoc = stackpointer; - if (ranint(8) == 0) d = c; - if (ranint(8) == 0) e = c; - if (ranint(8) == 0) f = c; - if (ranint(8) == 0) g = c; - UC; - setref(b, 0, c); - UC; - setref(c, 1, d); - UC; - setref(c, 2, e); - UC; - setref(c, 3, f); - UC; - setref(c, 4, g); - UC; - b = c; - } - DC; - DMC; - } - - mps_ap_destroy(apawl); - mps_ap_destroy(apamc); - mps_pool_destroy(poolamc); - mps_pool_destroy(poolawl); - mps_chain_destroy(chain); - mps_fmt_destroy(format); - mps_root_destroy(root); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/42.c b/mps/qa/function/42.c deleted file mode 100644 index 37188fb9212..00000000000 --- a/mps/qa/function/42.c +++ /dev/null @@ -1,130 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!42.c(trunk.4) $ - summary = test awl and amc pools - language = c - link = testlib.o awlfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscawl.h" -#include "mpscamc.h" -#include "awlfmt.h" -#include "mpsavm.h" - - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - - -void *stackpointer; - - -static void test(void) -{ - mps_arena_t arena; - mps_pool_t poolamc, poolawl; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_chain_t chain; - mps_ap_t apamc, apawl; - - mycell *a, *b, *c, *d, *e, *f, *g; - - int i; - int j; - - RC; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), mmqaArenaSIZE), - "create arena"); - - die(mps_thread_reg(&thread, arena), "register thread"); - die(mps_root_create_reg(&root, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - die(mps_fmt_create_A(&format, arena, &fmtA), "create format"); - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - die(mmqa_pool_create_chain(&poolamc, arena, mps_class_amc(), format, chain), - "create pool"); - - cdie( - mps_pool_create(&poolawl, arena, mps_class_awl(), format), - "create pool"); - - cdie( - mps_ap_create(&apawl, poolawl, MPS_RANK_WEAK), - "create ap"); - - cdie( - mps_ap_create(&apamc, poolamc, MPS_RANK_EXACT), - "create ap"); - - b = allocone(apamc, 1, 1); - - for (j=1; j<10; j++) { - comment("%i of 10.", j); - UC; - a = allocone(apawl, 5, 1); - setref(b, 0, a); - b = a; - c = a; - d = a; - e = a; - f = a; - g = a; - - for (i=1; i<1000; i++) { - UC; - c = allocone(apamc, 100, 1); - c = allocone(apawl, 100, 1); - if (ranint(8) == 0) d = c; - if (ranint(8) == 0) e = c; - if (ranint(8) == 0) f = c; - if (ranint(8) == 0) g = c; - UC; - setref(b, 0, c); - UC; - setref(c, 1, d); - UC; - setref(c, 2, e); - UC; - setref(c, 3, f); - UC; - setref(c, 4, g); - UC; - b = c; - } - DC; - DMC; - } - - mps_ap_destroy(apawl); - mps_ap_destroy(apamc); - mps_pool_destroy(poolamc); - mps_pool_destroy(poolawl); - mps_chain_destroy(chain); - mps_fmt_destroy(format); - mps_root_destroy(root); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/43.c b/mps/qa/function/43.c deleted file mode 100644 index bb1c9f91342..00000000000 --- a/mps/qa/function/43.c +++ /dev/null @@ -1,141 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!43.c(trunk.4) $ - summary = regresion test for request.dylan.170461 - language = c - link = testlib.o awlfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscawl.h" -#include "mpscamc.h" -#include "awlfmt.h" -#include "mpsavm.h" - - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - - -void *stackpointer; - - -static void test(void) -{ - mps_arena_t arena; - mps_pool_t poolamc, poolawl; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_chain_t chain; - mps_ap_t apamc, apexact, apweak; - - mycell *a, *b, *c, *d, *e, *f, *g; - - int i; - int j; - - RC; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), mmqaArenaSIZE), - "create arena"); - - die(mps_thread_reg(&thread, arena), "register thread"); - die(mps_root_create_reg(&root, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - die(mps_fmt_create_A(&format, arena, &fmtA), "create format"); - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - die(mmqa_pool_create_chain(&poolamc, arena, mps_class_amc(), format, chain), - "create pool"); - - cdie( - mps_pool_create(&poolawl, arena, mps_class_awl(), format), - "create pool"); - - cdie( - mps_ap_create(&apexact, poolawl, MPS_RANK_EXACT), - "create ap"); - - cdie( - mps_ap_create(&apweak, poolawl, MPS_RANK_WEAK), - "create ap"); - - cdie( - mps_ap_create(&apamc, poolamc, MPS_RANK_EXACT), - "create ap"); - - b = allocone(apamc, 1, 1); - - for (j=1; j<10; j++) { - comment("%i of 10.", j); - UC; - a = allocone(apexact, 5, 1); - setref(a, 0, b); - b = a; - c = a; - d = a; - e = a; - f = a; - g = a; - - for (i=1; i<1000; i++) { - UC; - c = allocone(apamc, 1000, 0); - if (ranint(2) == 0) { - c = allocone(apweak, 100, 1); - } else { - c = allocone(apexact, 100, 1); - } - if (ranint(8) == 0) d = c; - if (ranint(8) == 0) e = c; - if (ranint(8) == 0) f = c; - if (ranint(8) == 0) g = c; - UC; - setref(c, 0, b); - UC; - setref(c, 1, d); - UC; - setref(c, 2, e); - UC; - setref(c, 3, f); - UC; - setref(c, 4, g); - UC; - b = c; - } - DC; - DMC; - } - - mps_ap_destroy(apweak); - mps_ap_destroy(apexact); - mps_ap_destroy(apamc); - comment("Destroyed aps."); - - mps_pool_destroy(poolamc); - mps_pool_destroy(poolawl); - mps_chain_destroy(chain); - mps_fmt_destroy(format); - mps_root_destroy(root); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/44.c b/mps/qa/function/44.c deleted file mode 100644 index 2f8039f4021..00000000000 --- a/mps/qa/function/44.c +++ /dev/null @@ -1,191 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!44.c(trunk.5) $ - summary = clamp and arena_collect tests - language = c - harness = 2.1 - link = testlib.o exfmt.o -OUTPUT_SPEC - diff0 > 0 - diff1 > 0 - completed = yes -END_HEADER -*/ - -#include "testlib.h" -#include "mpscawl.h" -#include "mpscamc.h" -#include "exfmt.h" -#include "mpsavm.h" - - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - - -void *stackpointer; - - -static void test(void) -{ - mps_arena_t arena; - mps_pool_t poolamc, poolawl; - mps_thr_t thread; - mps_root_t root, root1; - - mps_fmt_t format; - mps_chain_t chain; - mps_ap_t apamc, apawl; - - size_t size0, size1; - mycell *a, *b, *c, *d, *e, *f, *g; - - int i; - int j; - - RC; - - deathcomments = 0; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), mmqaArenaSIZE), - "create arena"); - - die(mps_thread_reg(&thread, arena), "register thread"); - die(mps_root_create_reg(&root, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_root_create_table(&root1, arena, MPS_RANK_AMBIG, 0, &exfmt_root, 1), - "create exfmt root"); - - die(mps_fmt_create_A(&format, arena, &fmtA), "create format"); - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - die(mmqa_pool_create_chain(&poolamc, arena, mps_class_amc(), format, chain), - "create pool"); - - cdie( - mps_pool_create(&poolawl, arena, mps_class_awl(), format), - "create pool"); - - cdie( - mps_ap_create(&apawl, poolawl, MPS_RANK_WEAK), - "create ap"); - - cdie( - mps_ap_create(&apamc, poolamc, MPS_RANK_EXACT), - "create ap"); - - b = allocone(apamc, 1, 1); - - for (j=1; j<10; j++) { - comment("%i of 10.", j); - a = allocone(apawl, 5, 1); - setref(b, 0, a); - b = a; - c = a; - d = a; - e = a; - f = a; - g = a; - for (i=1; i<1000; i++) { - if (i%100 == 0) { - comment(" %i", i); - } - if (ranint(2)) { - c = allocone(apamc, 1000, 1); - } else { - c = allocone(apawl, 1000, 1); - } - if (ranint(8) == 0) d = c; - if (ranint(8) == 0) e = c; - if (ranint(8) == 0) f = c; - if (ranint(8) == 0) g = c; - setref(b, 0, c); - setref(c, 1, d); - setref(c, 2, e); - setref(c, 3, f); - setref(c, 4, g); - b = c; - } - if (j==3) { - DC; - comment("...collecting:"); - RC; - size0 = arena_committed_and_used(arena); - mps_arena_collect(arena); - size1 = arena_committed_and_used(arena); - report("sizebefore0", "%lu", (unsigned long) size0); - report("sizeafter0", "%lu", (unsigned long) size1); - report("diff0", "%lu", (unsigned long) size0-size1); - DC; - mps_arena_release(arena); - comment("...released"); - } - DC; - comment("clamping..."); - mps_arena_park(arena); - RC; - for (i=1; i<1000; i++) { - if (i%100 == 0) { - comment(" %i", i); - } - if (ranint(2)) { - c = allocone(apamc, 1000, 1); - } else { - c = allocone(apawl, 1000, 1); - } - if (ranint(8) == 0) d = c; - if (ranint(8) == 0) e = c; - if (ranint(8) == 0) f = c; - if (ranint(8) == 0) g = c; - setref(b, 0, c); - setref(c, 1, d); - setref(c, 2, e); - setref(c, 3, f); - setref(c, 4, g); - b = c; - } - asserts(counters[COPY_COUNT]==0, "Eppur si muove!"); - DC; - if (j==9) { - comment("collecting..."); - size0 = arena_committed_and_used(arena); - mps_arena_collect(arena); - size1 = arena_committed_and_used(arena); - report("sizebefore1", "%lu", (unsigned long) size0); - report("sizeafter1", "%lu", (unsigned long) size1); - report("diff1", "%lu", (unsigned long) size0-size1); - DC; - } - mps_arena_release(arena); - comment("released."); - RC; - } - - mps_ap_destroy(apawl); - mps_ap_destroy(apamc); - mps_pool_destroy(poolamc); - mps_pool_destroy(poolawl); - mps_chain_destroy(chain); - mps_fmt_destroy(format); - mps_root_destroy(root); - mps_root_destroy(root1); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/45.c b/mps/qa/function/45.c deleted file mode 100644 index 5839fe87e7e..00000000000 --- a/mps/qa/function/45.c +++ /dev/null @@ -1,212 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!45.c(trunk.4) $ - summary = arena_collect when lots of APs are in mid-cycle - language = c - link = testlib.o newfmt.o -END_HEADER -*/ - -/* - See MMQA_test_function!12.c, on which this test is closely based. -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "mpsavm.h" -#include "newfmt.h" - - -#define NCELLS 100 -#define NAPS 100 -#define PNULL (ranint(100)<25) -#define NUMREFS (ranint(80)) -#define BLAH 0 - - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - - -void *stackpointer; - -mps_ap_t ap[NAPS]; -mycell *p[NAPS]; -size_t s[NAPS]; -int nrefs[NAPS]; -int ap_state[NAPS]; - - -static void test(void) -{ - mps_arena_t arena; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_chain_t chain; - - mycell *cells; - - int h,i,j,k,l; - mycell *pobj; - - mycell *ambig[NAPS]; - - size_t size0, size1; - long mdiff = 0; - size_t bytes; - size_t alignment; - mps_addr_t q; - int nextid = 0x1000000; - - /* turn on comments about copying and scanning */ - formatcomments = BLAH; - fixcomments = BLAH; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), mmqaArenaSIZE), - "create arena"); - - die(mps_thread_reg(&thread, arena), "register thread"); - die(mps_root_create_reg(&root, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - die(mps_fmt_create_A(&format, arena, &fmtA), "create format"); - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - die(mmqa_pool_create_chain(&pool, arena, mps_class_amc(), format, chain), - "create pool"); - - for (i = 0; i < NAPS; i++) { - die(mps_ap_create(&ap[i], pool, MPS_RANK_EXACT), "create ap"); - ap_state[i] = 0; - } - - cells = allocone(ap[0], NCELLS); - - /* ap_state can have the following values: - 0 before reserve - 1 after reverse - 2 after init - 3 after I=A - 0 after commit - */ - - for(h=0; h<100; h++) { - comment("%i of 100", h); - - for(j=0; j<1000; j++) { - if (j == 500) { - size0 = mps_arena_committed(arena); - mps_arena_collect(arena); - size1 = mps_arena_committed(arena); - asserts(((long) size1)-((long) size0) < 1024*1024, - "Collection made arena bigger: %lu -> %lu", - (unsigned long) size0, (unsigned long) size1); - if (((long) size1)-((long) size0) > mdiff) { - mdiff = ((long) size1) - ((long) size0); - } - } - i = ranint(NAPS); - - switch (ap_state[i]) { - case 0: - nrefs[i] = NUMREFS; - bytes = offsetof(struct data, ref)+nrefs[i]*sizeof(struct refitem); - alignment = MPS_PF_ALIGN; - bytes = (bytes+alignment-1)&~(alignment-1); - s[i] = bytes; - die(mps_reserve(&q, ap[i], s[i]), "reserve: "); - p[i] = q; - p[i]->data.tag = 0xD033E2A6; - p[i]->data.id = nextid; - ap_state[i] = 1; - commentif(BLAH, "%i: reserve %li at %p", i, nextid, q); - nextid +=1; - break; - case 1: - commentif(BLAH, "%i: init %li", i, p[i]->data.id); - p[i]->data.tag = MCdata; - p[i]->data.numrefs = nrefs[i]; - p[i]->data.size = s[i]; - ap_state[i] = 2; - for (k=0; kdata.ref[k].addr = NULL; - p[i]->data.ref[k].id = 0; - } else { - l = ranint(NCELLS); - pobj = getref(cells, l); - p[i]->data.ref[k].addr = pobj; - p[i]->data.ref[k].id = (pobj==NULL ? 0 : pobj->data.id); - } - commentif(BLAH, " ref %i -> %li", k, p[i]->data.ref[k].id); - } - break; - case 2: - commentif(BLAH, "%i: begin commit %li", i, p[i]->data.id); - ambig[i] = p[i]; - ap[i]->init = ap[i]->alloc; - ap_state[i] = 3; - break; - case 3: - commentif(BLAH, "%i: end commit %li", i, p[i]->data.id); - q=p[i]; - if (ap[i]->limit != 0 || mps_ap_trip(ap[i], p[i], s[i])) { - l = ranint(NCELLS); - setref(cells, l, q); - commentif(BLAH, "%i -> %i", i, l); - } - ap_state[i] = 0; - ambig[i] = NULL; - break; - } - } - checkfrom(cells); - } - - comment("Maximum size increase:"); - report("mincr", "%ld", mdiff); - - comment("Finished main loop"); - - for (i=0; idata.tag = MCdata; - p[i]->data.numrefs = 0; - p[i]->data.size = s[i]; - case 2: - commentif(BLAH, "%i begin commit", i); - ap[i]->init = ap[i]->alloc; - case 3: - commentif(BLAH, "% end commit", i); - (void) (ap[i]->limit != 0 || mps_ap_trip(ap[i], p[i], s[i])); - } - mps_ap_destroy(ap[i]); - } - - mps_pool_destroy(pool); - mps_chain_destroy(chain); - mps_fmt_destroy(format); - mps_root_destroy(root); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/46.c b/mps/qa/function/46.c deleted file mode 100644 index 9517bf1f099..00000000000 --- a/mps/qa/function/46.c +++ /dev/null @@ -1,163 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = mps_park and mps_amc_apply - language = c - link = testlib.o exfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "exfmt.h" - -#define MAGICSIZE ((size_t) 10342) - -void *stackpointer; -long int appcount; -long int apppadcount; - -static void test_apply(mps_addr_t addr, void *V, size_t S) { - mycell *a; - - asserts(S == MAGICSIZE, "Size didn't get passed!"); - a = addr; - asserts(((a->tag) & 0x3) == MCdata || ((a->tag) & 0x3) == MCpad, - "apply on non-data and non-pad object at %p", addr); - if (((a->tag) & 0x3) == MCdata) { - appcount += 1; - } else { - apppadcount +=1; - } -} - -static void test(void) -{ - mps_space_t space; - mps_pool_t poolamc; - mps_thr_t thread; - mps_root_t root, root1; - - mps_fmt_t format; - mps_ap_t apamc; - - mycell *a, *b, *c, *d, *e, *f, *g; - - int i; - int j; - - RC; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_root_create_table(&root1, space, MPS_RANK_AMBIG, 0, &exfmt_root, 1), - "create exfmt root"); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - cdie( - mps_pool_create(&poolamc, space, mps_class_amc(), format), - "create pool"); - - cdie( - mps_ap_create(&apamc, poolamc, MPS_RANK_EXACT), - "create ap"); - - b = allocone(apamc, 1, 1); - - for (j=1; j<10; j++) { - comment("%i of 10.", j); - a = allocone(apamc, 5, 1); - b = a; - c = a; - d = a; - e = a; - f = a; - g = a; - for (i=1; i<1000; i++) { - c = allocone(apamc, 1000, 1); - if (ranint(8) == 0) d = c; - if (ranint(8) == 0) e = c; - if (ranint(8) == 0) f = c; - if (ranint(8) == 0) g = c; - setref(c, 0, b); - setref(c, 1, d); - setref(c, 2, e); - setref(c, 3, f); - setref(c, 4, g); - b = c; - } - comment("parking..."); - mps_arena_park(space); - for (i=1; i<1000; i++) { - c = allocone(apamc, 1000, 1); - if (ranint(8) == 0) d = c; - if (ranint(8) == 0) e = c; - if (ranint(8) == 0) f = c; - if (ranint(8) == 0) g = c; - setref(c, 0, b); - setref(c, 1, d); - setref(c, 2, e); - setref(c, 3, f); - setref(c, 4, g); - b = c; - } - a = c; - b = c; - d = c; - e = c; - f = c; - g = c; - mps_arena_collect(space); - comment("calling amc_apply:"); - checkfrom(c); - appcount = 0; - apppadcount = 0; - mps_amc_apply(poolamc, &test_apply, NULL, MAGICSIZE); - comment("finished amc_apply."); - report("appcount", "%ld", appcount); - report("apppadcount", "%ld", apppadcount); - mps_arena_release(space); - comment("released."); - RC; - } - - mps_ap_destroy(apamc); - comment("Destroyed aps."); - - mps_pool_destroy(poolamc); - comment("Destroyed pools."); - - mps_fmt_destroy(format); - comment("Destroyed format."); - - mps_root_destroy(root); - mps_root_destroy(root1); - comment("Destroyed roots."); - - mps_thread_dereg(thread); - comment("Deregistered thread."); - - mps_space_destroy(space); - comment("Destroyed space."); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - report("result", "unknown"); - return 0; -} diff --git a/mps/qa/function/47.c b/mps/qa/function/47.c deleted file mode 100644 index cd24b356ee4..00000000000 --- a/mps/qa/function/47.c +++ /dev/null @@ -1,120 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!47.c(trunk.5) $ - summary = LDs don't go stale when using only non-moving pools - language = c - link = testlib.o rankfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscawl.h" -#include "mpscmv.h" -#include "mpscamc.h" -#include "mpsavm.h" -#include "rankfmt.h" - - -#define MAXLDS 100 - -void *stackpointer; - - -static void test(void) { - mps_arena_t arena; - mps_pool_t poolmv, poolawl; - mps_thr_t thread; - mps_root_t root0, root1; - - mps_addr_t p; - mps_ld_t lds[MAXLDS]; - mps_fmt_t format; - mps_ap_t apawl; - - mycell *a, *b; - - int i; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t)1024*1024*30), - "create arena"); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie(mps_root_create_table(&root0, arena, MPS_RANK_AMBIG, 0, - (mps_addr_t *)&exfmt_root, 1), - "create exfmt root"); - - cdie(mps_root_create_reg(&root1, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create register and stack root"); - - cdie(mps_fmt_create_A(&format, arena, &fmtA), - "create format"); - - cdie(mps_pool_create(&poolawl, arena, mps_class_awl(), format), - "create awl pool"); - - cdie(mps_pool_create(&poolmv, arena, mps_class_mv(), 0x4000, 128, 0x4000), - "create mv pool"); - - cdie(mps_ap_create(&apawl, poolawl, MPS_RANK_EXACT), - "create ap"); - - b = allocone(apawl, 5, MPS_RANK_EXACT); - - for (i=0; i < MAXLDS; i++) { - comment("%d", i); - mps_alloc(&p, poolmv, sizeof(mps_ld_s)); - a = allocone(apawl, 5, MPS_RANK_EXACT); - setref(a, 0, b); - b = a; - a = allocdumb(apawl, 256*1024, MPS_RANK_EXACT); - comment("alloc"); - lds[i] = p; - mps_ld_reset(lds[i], arena); - comment("reset"); - if (i>0) { - mps_ld_add(lds[i], arena, (mps_addr_t) b); - } - comment("add"); - } - - for (i=0; i < MAXLDS; i++) { - comment("%d", i); - asserts(mps_ld_isstale(lds[i], arena, p) == 0, - "%d stale but shouldn't be", i); - } - - - - mps_ap_destroy(apawl); - comment("Destroyed ap."); - - mps_pool_destroy(poolmv); - mps_pool_destroy(poolawl); - comment("Destroyed pools."); - - mps_fmt_destroy(format); - comment("Destroyed format."); - - mps_root_destroy(root0); - mps_root_destroy(root1); - comment("Destroyed roots."); - - mps_thread_dereg(thread); - comment("Deregistered thread."); - - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/48.c b/mps/qa/function/48.c deleted file mode 100644 index 66f1f456dc5..00000000000 --- a/mps/qa/function/48.c +++ /dev/null @@ -1,140 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!48.c(trunk.4) $ - summary = test awl and amc pools, checking ranks work properly - language = c - link = testlib.o rankfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscawl.h" -#include "mpscamc.h" -#include "rankfmt.h" -#include "mpsavm.h" - - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - - -void *stackpointer; - - -static void test(void) -{ - mps_arena_t arena; - mps_pool_t poolamc, poolawl; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_chain_t chain; - mps_ap_t apamc, apawl, apweak; - - mycell *a, *b, *c, *d, *e, *f, *g; - - int i; - int j; - - RC; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), mmqaArenaSIZE), - "create arena"); - - die(mps_thread_reg(&thread, arena), "register thread"); - die(mps_root_create_reg(&root, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - die(mps_fmt_create_A(&format, arena, &fmtA), "create format"); - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - die(mmqa_pool_create_chain(&poolamc, arena, mps_class_amc(), format, chain), - "create pool"); - - cdie( - mps_pool_create(&poolawl, arena, mps_class_awl(), format), - "create pool"); - - cdie( - mps_ap_create(&apweak, poolawl, MPS_RANK_WEAK), - "create ap"); - - cdie( - mps_ap_create(&apawl, poolawl, MPS_RANK_EXACT), - "create ap"); - - cdie( - mps_ap_create(&apamc, poolamc, MPS_RANK_EXACT), - "create ap"); - - b = allocone(apamc, 1, 1); - - for (j=1; j<10; j++) { - comment("%i of 10.", j); - UC; - a = allocone(apawl, 5, MPS_RANK_EXACT); - setref(b, 0, a); - b = a; - c = a; - d = a; - e = a; - f = a; - g = a; - - for (i=1; i<1000; i++) { - UC; - if (ranint(3) == 0) { - c = allocone(apawl, 500, MPS_RANK_EXACT); - } else if (ranint(2) == 0) { - c = allocone(apweak, 500, MPS_RANK_WEAK); - } else { - c = allocone(apamc, 500, MPS_RANK_EXACT); - } - if (ranint(8) == 0) d = c; - if (ranint(8) == 0) e = c; - if (ranint(8) == 0) f = c; - if (ranint(8) == 0) g = c; - UC; - setref(b, 0, c); - UC; - setref(c, 1, d); - UC; - setref(c, 2, e); - UC; - setref(c, 3, f); - UC; - setref(c, 4, g); - UC; - b = c; - } - DC; - DMC; - } - - mps_ap_destroy(apawl); - mps_ap_destroy(apamc); - mps_ap_destroy(apweak); - mps_pool_destroy(poolamc); - mps_pool_destroy(poolawl); - mps_chain_destroy(chain); - mps_fmt_destroy(format); - mps_root_destroy(root); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/49.c b/mps/qa/function/49.c deleted file mode 100644 index 452ca3cba00..00000000000 --- a/mps/qa/function/49.c +++ /dev/null @@ -1,302 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!49.c(trunk.7) $ - summary = finalization tests with AMC, AWL and LO - language = c - link = testlib.o rankfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscawl.h" -#include "mpscamc.h" -#include "mpsclo.h" -#include "mpsavm.h" -#include "rankfmt.h" -#include "mpsavm.h" - - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - - -void *stackpointer; - -mps_arena_t arena; - -int final_count = 0; - - -enum { - FINAL_DISCARD, - FINAL_REREGISTER, - FINAL_STORE, - FINAL_QUEUE -}; - - -mps_message_t mqueue[10000]; - -int qhd = 0; -int qtl = 0; - - -static void nq(mps_message_t mess) -{ - mqueue[qhd] = mess; - qhd = (qhd+1) % 10000; - asserts(qhd != qtl, "No space in message queue."); -} - - -static int qmt(void) -{ - if (qhd == qtl) { - return 1; - } else { - return 0; - } -} - - -static int dq(mps_message_t *mess) -{ - if (qhd == qtl) { - return 0; - } else { - *mess = mqueue[qtl]; - qtl = (qtl+1) % 10000; - return 1; - } -} - - -static void process_mess(mps_message_t message, int faction, mps_addr_t *ref) -{ - mps_addr_t ffref; - - switch (faction) { - case FINAL_DISCARD: - mps_message_discard(arena, message); - break; - case FINAL_REREGISTER: - mps_message_finalization_ref(&ffref, arena, message); - mps_finalize(arena, &ffref); - final_count +=1; - mps_message_discard(arena, message); - break; - case FINAL_STORE: - mps_message_finalization_ref(ref, arena, message); - mps_message_discard(arena, message); - break; - case FINAL_QUEUE: - nq(message); - break; - default: - asserts(0, "Unknown finalization action."); - } -} - - -static void qpoll(mycell **ref, int faction) -{ - mps_message_t message; - - if (dq(&message)) { - process_mess(message, faction, (mps_addr_t*)ref); - } -} - - -static void finalpoll(mycell **ref, int faction) -{ - mps_message_t message; - - if (mps_message_get(&message, arena, MPS_MESSAGE_TYPE_FINALIZATION)) { - final_count -=1; - process_mess(message, faction, (mps_addr_t*)ref); - } -} - - -static void test(void) -{ - mps_pool_t poolamc, poolawl, poollo; - mps_thr_t thread; - mps_root_t root0, root1; - - mps_fmt_t format; - mps_chain_t chain; - mps_ap_t apamc, apawl, aplo; - - mycell *a, *b, *c, *d, *z; - - long int j; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t)1024*1024*30), - "create arena"); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - cdie(mps_root_create_reg(&root0, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie(mps_root_create_table(&root1, arena, MPS_RANK_AMBIG, 0, - (mps_addr_t *)&exfmt_root, 1), - "create table root"); - - cdie(mps_fmt_create_A(&format, arena, &fmtA), - "create format"); - - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - die(mmqa_pool_create_chain(&poolamc, arena, mps_class_amc(), format, chain), - "create pool"); - - cdie(mps_pool_create(&poolawl, arena, mps_class_awl(), format), - "create pool"); - - cdie(mps_pool_create(&poollo, arena, mps_class_lo(), format), - "create pool"); - - cdie(mps_ap_create(&apawl, poolawl, MPS_RANK_WEAK), - "create ap"); - - cdie( - mps_ap_create(&apamc, poolamc, MPS_RANK_EXACT), - "create ap"); - - cdie( - mps_ap_create(&aplo, poollo, MPS_RANK_EXACT), - "create ap"); - - mps_message_type_enable(arena, mps_message_type_finalization()); - - /* register loads of objects for finalization (1000*4) */ - - a = allocone(apamc, 2, 1); - b = a; - - for (j=0; j<1000; j++) { - a = allocone(apamc, 2, MPS_RANK_EXACT); - c = allocone(apawl, 2, MPS_RANK_WEAK); - d = allocone(aplo, 2, MPS_RANK_EXACT); /* rank irrelevant here! */ - mps_finalize(arena, (mps_addr_t*)&a); - mps_finalize(arena, (mps_addr_t*)&c); - mps_finalize(arena, (mps_addr_t*)&d); - mps_finalize(arena, (mps_addr_t*)&d); - final_count += 4; - setref(a, 0, b); - setref(a, 1, c); - setref(c, 1, d); - b = a; - } - - /* throw them all away and collect everything */ - - a = NULL; - b = NULL; - c = NULL; - d = NULL; - - mps_arena_collect(arena); - - while (mps_message_poll(arena)) { - finalpoll(&z, FINAL_DISCARD); - } - - /* how many are left? (n.b. ideally this would be 0 but - there's no guarantee) - */ - - report("count1", "%i", final_count); - - /* now to test leaving messages open for a long time! */ - - for (j=0; j<1000; j++) { - if (j % 50 == 0) - comment("%d of 1000", j); - a = allocone(apamc, 10000, MPS_RANK_EXACT); - mps_finalize(arena, (mps_addr_t*)&a); - final_count +=1; - comment("finalize"); - finalpoll(&z, FINAL_QUEUE); - } - - comment("reregister"); - - for (j=0; j<500; j++) { - comment("%d of 500", j); - qpoll(&z, FINAL_REREGISTER); - } - - b = a; - z = a; - - for (j=0; j<1000; j++) { - comment("%d of 1000", j); - finalpoll(&z, FINAL_QUEUE); - qpoll(&z, FINAL_STORE); - a = allocone(apamc, 2, MPS_RANK_EXACT); - setref(z, 0, b); - setref(a, 1, z); - b = a; - } - - - for (j=0; j<1000; j++) { - a = allocone(apamc, 2, MPS_RANK_EXACT); - qpoll(&z, FINAL_DISCARD); - finalpoll(&z, FINAL_DISCARD); - setref(a, 0, b); - b = a; - } - - /* Force old objects to be killed */ - - while (qmt() == 0) { - qpoll(&z, FINAL_DISCARD); - } - - mps_root_destroy(root0); - mps_root_destroy(root1); - comment("Destroyed roots."); - - mps_arena_collect(arena); - comment("Collected arena."); - - while (mps_message_poll(arena)) { - finalpoll(&z, FINAL_DISCARD); - } - - report("count2", "%d", final_count); - - mps_ap_destroy(apawl); - mps_ap_destroy(apamc); - mps_ap_destroy(aplo); - comment("Destroyed aps."); - - mps_pool_destroy(poolamc); - mps_pool_destroy(poolawl); - mps_pool_destroy(poollo); - comment("Destroyed pools."); - - mps_chain_destroy(chain); - mps_fmt_destroy(format); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/5.c b/mps/qa/function/5.c deleted file mode 100644 index 634090cf012..00000000000 --- a/mps/qa/function/5.c +++ /dev/null @@ -1,114 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!5.c(trunk.6) $ - summary = (regression test) have an ambiguous reference to a reserved but not committed object, and then allocate lots more with another AP, to make it collect - language = c - link = testlib.o newfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "mpsavm.h" -#include "newfmt.h" - - -#define OBJ_SIZE (MPS_PF_ALIGN*32) -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - - -void *stackpointer; - -static void test(void) -{ - mps_arena_t arena; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_chain_t chain; - mps_ap_t apA; - mps_ap_t apB; - - mps_addr_t p; - mycell *q; - - int i; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), mmqaArenaSIZE), - "create arena"); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - cdie( - mps_root_create_reg(&root, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(&format, arena, &fmtA), - "create format"); - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - formatcomments = 0; - - cdie(mmqa_pool_create_chain(&pool, arena, mps_class_amc(), format, chain), - "create pool"); - - cdie( - mps_ap_create(&apA, pool, MPS_RANK_EXACT), "create apA"); - cdie( - mps_ap_create(&apB, pool, MPS_RANK_EXACT), "create apB"); - - - die(mps_reserve(&p, apA, OBJ_SIZE), "Reserve: "); - - for (i=1; i<10000; i++) - { - allocone(apB, 100); - } - - q = p; - q->data.tag = MCdata; - q->data.id = 0; - q->data.numrefs = 0; - q->data.size = OBJ_SIZE; - (void) mps_commit(apA, p, OBJ_SIZE); - - mps_ap_destroy(apA); - comment("Destroyed apA."); - mps_ap_destroy(apB); - comment("Destroyed apB."); - - mps_pool_destroy(pool); - comment("Destroyed pool."); - - mps_chain_destroy(chain); - comment("Destroyed chain."); - - mps_fmt_destroy(format); - comment("Destroyed format."); - - mps_root_destroy(root); - comment("Destroyed root."); - - mps_thread_dereg(thread); - comment("Deregistered thread."); - - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/50.c b/mps/qa/function/50.c deleted file mode 100644 index 5f2c33a2b7c..00000000000 --- a/mps/qa/function/50.c +++ /dev/null @@ -1,305 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!50.c(trunk.6) $ - summary = finalization tests with AMC, AWL and LO - language = c - link = testlib.o rankfmt.o -OUTPUT_SPEC - count1 < 50 - count2 < 50 - result = pass -END_HEADER -*/ - -#include "testlib.h" -#include "mpscawl.h" -#include "mpscamc.h" -#include "mpsclo.h" -#include "mpsavm.h" -#include "rankfmt.h" - - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - - -void *stackpointer; - -mps_arena_t arena; - -int final_count = 0; - - -enum { - FINAL_DISCARD, - FINAL_REREGISTER, - FINAL_STORE, - FINAL_QUEUE -}; - - -mps_message_t mqueue[10000]; - -int qhd = 0; -int qtl = 0; - - -static void nq(mps_message_t mess) -{ - mqueue[qhd] = mess; - qhd = (qhd+1) % 10000; - asserts(qhd != qtl, "No space in message queue."); -} - - -static int qmt(void) -{ - if (qhd == qtl) { - return 1; - } else { - return 0; - } -} - - -static int dq(mps_message_t *mess) -{ - if (qhd == qtl) { - return 0; - } else { - *mess = mqueue[qtl]; - qtl = (qtl+1) % 10000; - return 1; - } -} - - -static void process_mess(mps_message_t message, int faction, mps_addr_t *ref) -{ - mps_addr_t ffref; - - switch (faction) { - case FINAL_DISCARD: - mps_message_discard(arena, message); - break; - case FINAL_REREGISTER: - mps_message_finalization_ref(&ffref, arena, message); - mps_finalize(arena, &ffref); - final_count +=1; - mps_message_discard(arena, message); - break; - case FINAL_STORE: - mps_message_finalization_ref(ref, arena, message); - mps_message_discard(arena, message); - break; - case FINAL_QUEUE: - nq(message); - break; - default: - asserts(0, "Unknown finalization action."); - } -} - - -static void qpoll(mycell **ref, int faction) -{ - mps_message_t message; - - if (dq(&message)) { - process_mess(message, faction, (mps_addr_t*)ref); - } -} - - -static void finalpoll(mycell **ref, int faction) -{ - mps_message_t message; - - if (mps_message_get(&message, arena, MPS_MESSAGE_TYPE_FINALIZATION)) { - final_count -=1; - process_mess(message, faction, (mps_addr_t*)ref); - } -} - - -static void test(void) -{ - mps_pool_t poolamc, poolawl, poollo; - mps_thr_t thread; - mps_root_t root0, root1; - - mps_fmt_t format; - mps_chain_t chain; - mps_ap_t apamc, apawl, aplo; - - mycell *a, *b, *c, *d, *z; - - long int j; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t)1024*1024*30), - "create arena"); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - cdie(mps_root_create_reg(&root0, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie(mps_root_create_table(&root1, arena, MPS_RANK_AMBIG, 0, - (mps_addr_t *)&exfmt_root, 1), - "create table root"); - - cdie(mps_fmt_create_A(&format, arena, &fmtA), - "create format"); - - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - die(mmqa_pool_create_chain(&poolamc, arena, mps_class_amc(), format, chain), - "create pool"); - - cdie(mps_pool_create(&poolawl, arena, mps_class_awl(), format), - "create pool"); - - cdie(mps_pool_create(&poollo, arena, mps_class_lo(), format), - "create pool"); - - cdie(mps_ap_create(&apawl, poolawl, MPS_RANK_WEAK), - "create ap"); - - cdie(mps_ap_create(&apamc, poolamc, MPS_RANK_EXACT), - "create ap"); - - cdie( - mps_ap_create(&aplo, poollo, MPS_RANK_EXACT), - "create ap"); - - mps_message_type_enable(arena, mps_message_type_finalization()); - - /* register loads of objects for finalization (1000*4) */ - - a = allocone(apamc, 2, 1); - b = a; - - for (j=0; j<10; j++) { - a = allocone(apamc, 2, MPS_RANK_EXACT); - c = allocone(apawl, 2, MPS_RANK_WEAK); - d = allocone(aplo, 2, MPS_RANK_EXACT); /* rank irrelevant here! */ - mps_finalize(arena, (mps_addr_t*)&a); - mps_finalize(arena, (mps_addr_t*)&c); - mps_finalize(arena, (mps_addr_t*)&d); - mps_finalize(arena, (mps_addr_t*)&d); - final_count += 4; - setref(a, 0, b); - setref(a, 1, c); - setref(c, 1, d); - b = a; - } - - /* throw them all away and collect everything */ - - a = NULL; - b = NULL; - c = NULL; - d = NULL; - - mps_arena_collect(arena); - - while (mps_message_poll(arena)) { - finalpoll(&z, FINAL_DISCARD); - } - - /* How many are left? (ideally, this would be 0 but there's no guarantee) */ - - report("count1", "%i", final_count); - - /* Now to test leaving messages open for a long time! */ - - for (j=0; j<10; j++) { - comment("%d of 10", j); - a = allocone(apamc, 10000, MPS_RANK_EXACT); - mps_finalize(arena, (mps_addr_t*)&a); - final_count +=1; - comment("finalize"); - finalpoll(&z, FINAL_QUEUE); - } - - comment("reregister"); - - for (j=0; j<10; j++) { - comment("%d of 10", j); - qpoll(&z, FINAL_REREGISTER); - } - - b = a; - z = a; - - for (j=0; j<10; j++) { - comment("%d of 10", j); - finalpoll(&z, FINAL_QUEUE); - qpoll(&z, FINAL_STORE); - a = allocone(apamc, 2, MPS_RANK_EXACT); - setref(z, 0, b); - setref(a, 1, z); - b = a; - } - - - for (j=0; j<10; j++) { - a = allocone(apamc, 2, MPS_RANK_EXACT); - qpoll(&z, FINAL_DISCARD); - finalpoll(&z, FINAL_DISCARD); - setref(a, 0, b); - b = a; - } - - /* Force old objects to be killed */ - - while (qmt() == 0) { - qpoll(&z, FINAL_DISCARD); - } - - while (mps_message_poll(arena)) { - finalpoll(&z, FINAL_DISCARD); - } - - mps_root_destroy(root0); - mps_root_destroy(root1); - comment("Destroyed roots."); - - mps_ap_destroy(apawl); - mps_ap_destroy(apamc); - mps_ap_destroy(aplo); - comment("Destroyed aps."); - - mps_arena_collect(arena); - comment("Collected arena."); - - while (mps_message_poll(arena)) { - finalpoll(&z, FINAL_DISCARD); - } - - report("count2", "%d", final_count); - - mps_pool_destroy(poolamc); - mps_pool_destroy(poolawl); - mps_pool_destroy(poollo); - comment("Destroyed pools."); - - mps_chain_destroy(chain); - mps_fmt_destroy(format); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/500.txt b/mps/qa/function/500.txt deleted file mode 100644 index 50d93620ac9..00000000000 --- a/mps/qa/function/500.txt +++ /dev/null @@ -1,42 +0,0 @@ - -TEST_HEADER - id = $HopeName$ - summary = compare MM and boehm performance in Dylan - language = english -END_HEADER - -1. Get a recent, stable release of Dylan. If you're not sure what release would -be appropriate, ask Tony. - -2. Create a version of hqn-dylan.dll that uses the memory manager to be tested. -Do this by compiling the dylan library, then copying the mmdw.lib you want to -the dylan\lib directory, then from the dylan\build\dylan directory run -"build microsoft force dll". This is assuming you have not already done -step 3, which creates a new pentium-run-time.lib. - -3. Create a version of hqn-dylan.dll that uses the boehm collector. -Do this by running "nmake install-boehm" from from the Sources\lib\pentium-run-time -directory. - -4. Run the following tests on each version: - -dylan-compile -compile-library -force-parse -force-compile harlequin-extensions -compile-library -force-parse -force-compile harlequin-extensions -compile-library -force-compile dylan -quit - -dylan-compile -update-libraries -force -save -flush dfmc-modeling -quit - -Or make up some other similar tests. -Compare CPU times and lines per minute as reported by Dylan. - -The test is passed if the MM being tested is as fast as or faster than the -boehm collector (in all cases). The two may have different memory requirements, -so make sure to note how much memory your machine has, as well as the version of -dylan used, and to check whether cpu time and clock-on-the-wall time are noticeably -different. - -rit 1998-03-13 diff --git a/mps/qa/function/501.txt b/mps/qa/function/501.txt deleted file mode 100644 index 510e53ddd92..00000000000 --- a/mps/qa/function/501.txt +++ /dev/null @@ -1,31 +0,0 @@ - -TEST_HEADER - id = $HopeName$ - summary = MM works with Dylan - language = english -END_HEADER - -1. Get a recent, stable release of Dylan. If you're not sure what release would -be appropriate, ask Tony. - -2. Create a version of hqn-dylan.dll that uses the memory manager to be tested. -Do this by compiling the dylan library ("compile-library -force-compile dylan"), -then copying the mmdw.lib you want to the dylan\lib directory, then from the -dylan\build\dylan directory run "build microsoft force dll". - -3. Run the following tests: - -dylan-compile -compile-library -force-parse -force-compile harlequin-extensions -compile-library -force-parse -force-compile harlequin-extensions -compile-library -force-compile dylan -quit - -dylan-compile -update-libraries -force -save dfmc-modeling -quit - -The test is passed if there are no problems (apart from the usual -dylan compiler warnings) with these runs. - -rit 1998-03-13 diff --git a/mps/qa/function/502.txt b/mps/qa/function/502.txt deleted file mode 100644 index 06a4778e87c..00000000000 --- a/mps/qa/function/502.txt +++ /dev/null @@ -1,34 +0,0 @@ - -TEST_HEADER - id = $HopeName$ - summary = MM works with Dylan debugger - language = english -END_HEADER - -1. Get a recent, stable release of Dylan. If you're not sure what release would -be appropriate, ask Tony. - -2. Create a version of hqn-dylan.dll that uses the memory manager to be tested. -Do this by compiling the dylan library, then copying the mmdw.lib you want to -the dylan\lib directory, then from the dylan\build\dylan directory run -"build microsoft force dll". - -3. Run the following tests, making sure the new hqn-dylan is used for the -debugger and the debuggee. - -console-debug dylan-compile -profile at 50 -c ---> compile-library -force-compile dylan -STOP -profile results [check that MM functions appear correctly in the profile] -break AMCFix -c -(breakpoint hit) -bt 20 [check that MM functions appear correctly on the stack] -quit - -The test is passed if MM functions are correctly understood by the debugger -and there are no other problems. - -rit 1998-03-13 diff --git a/mps/qa/function/503.txt b/mps/qa/function/503.txt deleted file mode 100644 index db8b830be90..00000000000 --- a/mps/qa/function/503.txt +++ /dev/null @@ -1,39 +0,0 @@ - -TEST_HEADER - id = $HopeName$ - summary = Compare variety.hi/he and variety.wi performance - language = english -END_HEADER - -From variety.hi and variety/he: -| -| .desc: This variety is intended to have as much checking and -| telemetry as possible, but with no significant performance -| overhead as compared to variety.wi. -| -| .slow: A "significant performance overhead" is a slow-down of -| more than 10% in any typical operation. -| -| .slow.just: The figure 10% was chosen because it is at a level -| that an interactive user would not observe. -| - -To test that varieties hi and he meet these requirements, compare -them with wi by running tests and measuring times. Tests to run: - -- client application (Dylan, ScriptWorks &c) -- MMQA_test_function!{77,78,79,80}.c and others - -It's not quite clear in the quote above whether "a slow-down of -more than 10%" means a slow down in memory-managament time, or -a slow down in total application time. I take it to refer to a -slow-down in memory-management time, given a typical pattern of -allocation, freeing, &c. Therefore if, say, Dylan goes 5% slower -with variety.hi than variety.wi, I will complain because the -MM takes less than 50% of Dylan's time, so the MM overhead must -be more than 10%. - -Test is passed if varieties hi and he are within 10% of performance -of variety.wi. - -rit 1998-03-13 diff --git a/mps/qa/function/504.txt b/mps/qa/function/504.txt deleted file mode 100644 index d96f9e044de..00000000000 --- a/mps/qa/function/504.txt +++ /dev/null @@ -1,19 +0,0 @@ - -TEST_HEADER - id = $HopeName$ - summary = check release notes - language = english -END_HEADER - -Release notes for each release should be in Darwin (in the release -document). They should describe all changes relevant to the users -since the last release shipped to users. - -In particular, they should: - - - describe any new functionality introduced - - explain any changes to the interface, whether to function names, - arguments, header files needed or whatever. - - warn of any serious negative changes in performance - -rit 1998-03-13 diff --git a/mps/qa/function/505.txt b/mps/qa/function/505.txt deleted file mode 100644 index c4b131b17ef..00000000000 --- a/mps/qa/function/505.txt +++ /dev/null @@ -1,28 +0,0 @@ - -TEST_HEADER - id = $HopeName$ - summary = SW memory leak detection - language = english -END_HEADER - -1. Check out a version of SW known to be stable and reliable. It's -best to opt for one which corresponds to an actual external release, -e.g. SW_B11, which is 4.5r1. - -2. Build a release version using the new memory manager. Bear in mind -that in this context, "memory manager" means not just the mmsw library, -but the glue code. If the distance between the current SW trunk and the -branch you chose is great enough, you may need to edit the new glue code -to make it compatible with the old SW. - -3. Set up device and page settings. Turn on the memory statistics -page feature. Then quit and remove LOGFILE from the SW folder. - -4. Start SW, run tests, quit. - -5. Look at - -If time permits, try on a range of platforms with a range of ScriptWorks -settings. See other SW tests for suggestions. - -rit 1998-03-13 diff --git a/mps/qa/function/506.txt b/mps/qa/function/506.txt deleted file mode 100644 index d96a93a2c84..00000000000 --- a/mps/qa/function/506.txt +++ /dev/null @@ -1,69 +0,0 @@ - -TEST_HEADER - id = $HopeName$ - summary = SW performance no worse than last release - language = english -END_HEADER - -EP have a requirement that each release of ScriptWorks be no slower -than the last in any typical operation. EPQA test this by running -various test suites, with various combinations of settings, and -seeing if anything gets slower. It's not just the overall time -for a suite that's important, but the times for individual jobs, -because each job could be typical for a particular user. - -Of course, SW performance is mostly out of our hands; however, -we should check that each release of the MM is as fast as releases -that have previously gone out to customers. Here's a performance -comparison. - -1. Check out a version of SW known to be stable and reliable. It's -best to opt for one which corresponds to an actual external release, -e.g. SW_B11, which is 4.5r1. - -2. Build a release version using the old memory manager and one using -the new memory manager. Bear in mind that in this context, "memory -manager" means not just the mmsw library, but the glue code. If the -distance between the current SW trunk and the branch you chose is -great enough, you may well need to edit the new glue code to make it -compatible with the old SW. - -3. If on a Mac, set the memory of the two versions of SW (with -File Info) so that the RIP gets the same amount of memory in -the end (e.g. 30000K is a reasonable number). - -4. Use either executable to set up device and page settings. Then -quit, remove LOGFILE from the SW folder, and backup the SW folder. - -5. Start one executable, run tests, quit, keep LOGFILE. Bear in mind -that the times reported in log file are clock-on-the-wall times, and -will be affected by other processes running on your machine. - -6. Delete SW folder and restore from backup. - -7. Start other executable, run same tests, quit, keep LOGFILE. - -8. Compare performance by running "difflogs" on the two LOGFILEs. Look for -jobs which - - used to run but now fail -- this could be serious. - - now run slower than before (total or interpretation time) - - produce unexpected differences in output, e.g. checksums. -When a job looks like it might be a problem, try running it again, both -on its own and within the suite. There is significant random variation -in the times recorded in SW LOGFILEs, so it's important to check that -what looks like a difference really is one. - -If time permits, try on a range of platforms with a range of ScriptWorks -settings, including memory settings. Here are some examples of suitable -settings to try: - -TestHqn capstan device. 1270 dpi, produce separations, HPS on, lots of -grey levels, single (if required) mode. - -EasyTrap on. - -Something with Harlequin Colour Management (make sure to use a colour -device, or produce separations). - - -rit 1998-03-13 diff --git a/mps/qa/function/51.c b/mps/qa/function/51.c deleted file mode 100644 index f67211df157..00000000000 --- a/mps/qa/function/51.c +++ /dev/null @@ -1,222 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!51.c(trunk.7) $ - summary = wait until all registered objects are finalized - language = c - link = testlib.o rankfmt.o -OUTPUT_SPEC - count = 0 - iter < 4 - result = pass -END_HEADER -*/ - -#include "testlib.h" -#include "mpscawl.h" -#include "mpscamc.h" -#include "mpsclo.h" -#include "mpsavm.h" -#include "rankfmt.h" - - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - - -void *stackpointer; - -mps_arena_t arena; - -int final_count = 0; - - -enum { - FINAL_DISCARD, - FINAL_REREGISTER, - FINAL_STORE, - FINAL_QUEUE -}; - - -mps_message_t mqueue[10000]; - -int qhd = 0; -int qtl = 0; - - -static void nq(mps_message_t mess) -{ - mqueue[qhd] = mess; - qhd = (qhd+1) % 10000; - asserts(qhd != qtl, "No space in message queue."); -} - - -static void process_mess(mps_message_t message, int faction, mps_addr_t *ref) -{ - mps_addr_t ffref; - - switch (faction) { - case FINAL_DISCARD: - mps_message_discard(arena, message); - break; - case FINAL_REREGISTER: - mps_message_finalization_ref(&ffref, arena, message); - mps_finalize(arena, &ffref); - final_count +=1; - mps_message_discard(arena, message); - break; - case FINAL_STORE: - mps_message_finalization_ref(ref, arena, message); - mps_message_discard(arena, message); - break; - case FINAL_QUEUE: - nq(message); - break; - default: - asserts(0, "Unknown finalization action."); - } -} - - -static void finalpoll(mycell **ref, int faction) -{ - mps_message_t message; - - if (mps_message_get(&message, arena, MPS_MESSAGE_TYPE_FINALIZATION)) { - final_count -=1; - process_mess(message, faction, (mps_addr_t*)ref); - } -} - - -static void test(void) -{ - mps_pool_t poolamc, poolawl, poollo; - mps_thr_t thread; - mps_root_t root0, root1; - - mps_fmt_t format; - mps_chain_t chain; - mps_ap_t apamc, apawl, aplo; - - mycell *a, *b, *c, *d, *z; - - long int i,j; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t)1024*1024*30), - "create arena"); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - cdie(mps_root_create_reg(&root0, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie(mps_root_create_table(&root1, arena, MPS_RANK_AMBIG, 0, - (mps_addr_t *)&exfmt_root, 1), - "create table root"); - - cdie(mps_fmt_create_A(&format, arena, &fmtA), - "create format"); - - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - die(mmqa_pool_create_chain(&poolamc, arena, mps_class_amc(), format, chain), - "create pool"); - - cdie(mps_pool_create(&poolawl, arena, mps_class_awl(), format), - "create pool"); - - cdie(mps_pool_create(&poollo, arena, mps_class_lo(), format), - "create pool"); - - cdie(mps_ap_create(&apawl, poolawl, MPS_RANK_WEAK), - "create ap"); - - cdie(mps_ap_create(&apamc, poolamc, MPS_RANK_EXACT), - "create ap"); - - cdie(mps_ap_create(&aplo, poollo, MPS_RANK_EXACT), - "create ap"); - - mps_message_type_enable(arena, mps_message_type_finalization()); - - /* register loads of objects for finalization (1000*4) */ - - a = allocone(apamc, 2, 1); - b = a; - - for (j=0; j<1000; j++) { - a = allocone(apamc, 2, MPS_RANK_EXACT); - c = allocone(apawl, 2, MPS_RANK_WEAK); - d = allocone(aplo, 2, MPS_RANK_EXACT); /* rank irrelevant here! */ - mps_finalize(arena, (mps_addr_t*)&a); - mps_finalize(arena, (mps_addr_t*)&c); - mps_finalize(arena, (mps_addr_t*)&d); - mps_finalize(arena, (mps_addr_t*)&d); - final_count += 4; - } - - /* throw them all away and collect everything */ - - a = NULL; - b = NULL; - c = NULL; - d = NULL; - - mps_root_destroy(root0); - mps_root_destroy(root1); - comment("Destroyed roots."); - - mps_arena_collect(arena); - - i = 0; - - while (final_count != 0 && i < 10) { - finalpoll(&z, FINAL_DISCARD); - if (mps_message_poll(arena) == 0) { - i++; - a = allocdumb(apawl, 1024, MPS_RANK_WEAK); - a = allocdumb(apamc, 1024, MPS_RANK_EXACT); - a = allocdumb(aplo, 1024, MPS_RANK_EXACT); - mps_arena_collect(arena); - comment(" %i", final_count); - } - } - - /* How many are left? (Ideally, this would be 0 but there's no guarantee.) */ - - report("count", "%i", final_count); - report("iter", "%i", i); - - /* now to test leaving messages open for a long time! */ - - mps_ap_destroy(apawl); - mps_ap_destroy(apamc); - mps_ap_destroy(aplo); - comment("Destroyed aps."); - - mps_pool_destroy(poolamc); - mps_pool_destroy(poolawl); - mps_pool_destroy(poollo); - comment("Destroyed pools."); - - mps_chain_destroy(chain); - mps_fmt_destroy(format); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/52.c b/mps/qa/function/52.c deleted file mode 100644 index e8afb9f0ce2..00000000000 --- a/mps/qa/function/52.c +++ /dev/null @@ -1,110 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!52.c(trunk.6) $ - summary = provoke mad behaviour by constant allocation - language = c - link = rankfmt.o testlib.o -END_HEADER -*/ - -/* this is based on MMQA_test_function!4.c, but with no user-input -*/ - -#include -#include "testlib.h" -#include "mpscamc.h" -#include "mpsavm.h" -#include "rankfmt.h" - - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - - -void *stackpointer; - - -static void test(void) -{ - mps_arena_t arena; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root, root1; - - mps_fmt_t format; - mps_chain_t chain; - mps_ap_t ap; - - mycell *a[3]; - - int i,j,k; - clock_t time0, time1; - - formatcomments = 1; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t)1024*1024*30), - "create arena"); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie(mps_root_create_table(&root, arena, MPS_RANK_AMBIG, 0, - (mps_addr_t*)&a[0], 3), - "create table root"); - cdie(mps_root_create_table(&root1, arena, MPS_RANK_AMBIG, 0, - (mps_addr_t *)&exfmt_root, 1), - "exfmt root"); - - cdie(mps_fmt_create_A(&format, arena, &fmtA), - "create format"); - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - die(mmqa_pool_create_chain(&pool, arena, mps_class_amc(), format, chain), - "create pool"); - - cdie(mps_ap_create(&ap, pool, MPS_RANK_EXACT), - "create ap"); - - time0 = clock(); - asserts(time0 != -1, "processor time not available"); - - for (k=0; k<100; k++) { - - for (j=0; j<100; j++) { - a[0] = allocone(ap, 50, MPS_RANK_EXACT); - a[1] = a[0]; - - for (i=1; i<100; i++) { - a[2] = allocone(ap, 50, MPS_RANK_EXACT); - setref(a[1], 0, a[2]); - a[1] = a[2]; - } - } - - time1 = clock(); - comment("%d: %i", k, (int) (100*(time1-time0)/CLOCKS_PER_SEC)); - time0 = time1; - } - - mps_ap_destroy(ap); - mps_pool_destroy(pool); - mps_chain_destroy(chain); - mps_fmt_destroy(format); - mps_root_destroy(root); - mps_root_destroy(root1); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/53.c b/mps/qa/function/53.c deleted file mode 100644 index c08ab8b6e66..00000000000 --- a/mps/qa/function/53.c +++ /dev/null @@ -1,129 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!53.c(trunk.4) $ - summary = use AMC with inactive LO pool - language = c - link = testlib.o awlfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "mpsclo.h" -#include "mpsavm.h" -#include "awlfmt.h" - - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - - -void *stackpointer; - - -static void test(void) -{ - mps_arena_t arena; - mps_pool_t poolamc, poollo; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_chain_t chain; - mps_ap_t apamc, aplo; - - mycell *a, *b, *c, *d, *e, *f, *g; - - int i; - int j; - - RC; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), mmqaArenaSIZE), - "create arena"); - - die(mps_thread_reg(&thread, arena), "register thread"); - die(mps_root_create_reg(&root, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - die(mps_fmt_create_A(&format, arena, &fmtA), "create format"); - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - die(mmqa_pool_create_chain(&poolamc, arena, mps_class_amc(), format, chain), - "create pool(amc)"); - - cdie( - mps_pool_create(&poollo, arena, mps_class_lo(), format), - "create pool"); - - cdie( - mps_ap_create(&apamc, poolamc, MPS_RANK_EXACT), - "create ap"); - cdie( - mps_ap_create(&aplo, poollo, MPS_RANK_EXACT), - "create ap(lo)"); - - b = allocone(apamc, 1, 1); - - for (j=1; j<100; j++) { - comment("%i of 100.", j); - UC; - a = allocone(apamc, 5, 1); - b = a; - c = a; - d = a; - e = a; - f = a; - g = a; - - for (i=1; i<5000; i++) { - UC; - c = allocone(apamc, 20, 1); - d = allocone(apamc, 20, 1); - if (ranint(8) == 0) e = c; - if (ranint(8) == 0) f = c; - if (ranint(8) == 0) g = c; - UC; - setref(b, 0, c); - UC; - setref(c, 1, d); - UC; - setref(c, 2, e); - UC; - setref(c, 3, f); - UC; - setref(c, 4, g); - UC; - b = c; - } - DC; - DMC; - } - - mps_ap_destroy(apamc); - mps_ap_destroy(aplo); - comment("Destroyed aps."); - mps_pool_destroy(poolamc); - mps_pool_destroy(poollo); - comment("Destroyed pools."); - mps_chain_destroy(chain); - mps_fmt_destroy(format); - mps_root_destroy(root); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/54.c b/mps/qa/function/54.c deleted file mode 100644 index f74bdb84eb7..00000000000 --- a/mps/qa/function/54.c +++ /dev/null @@ -1,129 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!54.c(trunk.4) $ - summary = use AMC and AWL without inactive LO pool - language = c - link = testlib.o awlfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscawl.h" -#include "mpscamc.h" -#include "mpsclo.h" -#include "awlfmt.h" -#include "mpsavm.h" - - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - - -void *stackpointer; - - -static void test(void) -{ - mps_arena_t arena; - mps_pool_t poolamc, poolawl; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_chain_t chain; - mps_ap_t apamc, apawl; - - mycell *a, *b, *c, *d, *e, *f, *g; - - int i; - int j; - - RC; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), mmqaArenaSIZE), - "create arena"); - - die(mps_thread_reg(&thread, arena), "register thread"); - die(mps_root_create_reg(&root, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - die(mps_fmt_create_A(&format, arena, &fmtA), "create format"); - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - die(mmqa_pool_create_chain(&poolamc, arena, mps_class_amc(), format, chain), - "create pool"); - - cdie( - mps_pool_create(&poolawl, arena, mps_class_awl(), format), - "create pool"); - - cdie( - mps_ap_create(&apawl, poolawl, MPS_RANK_EXACT), - "create ap"); - - cdie( - mps_ap_create(&apamc, poolamc, MPS_RANK_EXACT), - "create ap"); - - b = allocone(apamc, 1, 1); - - for (j=1; j<100; j++) { - comment("%i of 100.", j); - UC; - a = allocone(apamc, 5, 1); - b = a; - c = a; - d = a; - e = a; - f = a; - g = a; - - for (i=1; i<5000; i++) { - UC; - c = allocone(apamc, 20, 1); - d = allocone(apawl, 20, 1); - if (ranint(8) == 0) e = c; - if (ranint(8) == 0) f = c; - if (ranint(8) == 0) g = c; - UC; - setref(b, 0, c); - UC; - setref(c, 1, d); - UC; - setref(c, 2, e); - UC; - setref(c, 3, f); - UC; - setref(c, 4, g); - UC; - b = c; - } - DC; - DMC; - } - - mps_ap_destroy(apawl); - mps_ap_destroy(apamc); - mps_pool_destroy(poolamc); - mps_pool_destroy(poolawl); - mps_chain_destroy(chain); - mps_fmt_destroy(format); - mps_root_destroy(root); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/55.c b/mps/qa/function/55.c deleted file mode 100644 index 14520333b06..00000000000 --- a/mps/qa/function/55.c +++ /dev/null @@ -1,128 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!55.c(trunk.4) $ - summary = use AMC and LO without inactive LO pool - language = c - link = testlib.o awlfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "mpsclo.h" -#include "mpsavm.h" -#include "awlfmt.h" - - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - - -void *stackpointer; - - -static void test(void) -{ - mps_arena_t arena; - mps_pool_t poolamc, poolawl; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_chain_t chain; - mps_ap_t apamc, apawl; - - mycell *a, *b, *c, *d, *e, *f, *g; - - int i; - int j; - - RC; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), mmqaArenaSIZE), - "create arena"); - - die(mps_thread_reg(&thread, arena), "register thread"); - die(mps_root_create_reg(&root, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - die(mps_fmt_create_A(&format, arena, &fmtA), "create format"); - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - die(mmqa_pool_create_chain(&poolamc, arena, mps_class_amc(), format, chain), - "create pool(amc)"); - - cdie( - mps_pool_create(&poolawl, arena, mps_class_lo(), format), - "create pool"); - - cdie( - mps_ap_create(&apawl, poolawl, MPS_RANK_EXACT), - "create ap"); - - cdie( - mps_ap_create(&apamc, poolamc, MPS_RANK_EXACT), - "create ap(amc)"); - - b = allocone(apamc, 1, 1); - - for (j = 1; j < 100; j++) { - comment("%i of 100.", j); - UC; - a = allocone(apamc, 5, 1); - b = a; - c = a; - d = a; - e = a; - f = a; - g = a; - - for (i = 1; i < 5000; i++) { - UC; - c = allocone(apamc, 20, 1); - d = allocone(apawl, 20, 1); - if (ranint(8) == 0) e = c; - if (ranint(8) == 0) f = c; - if (ranint(8) == 0) g = c; - UC; - setref(b, 0, c); - UC; - setref(c, 1, d); - UC; - setref(c, 2, e); - UC; - setref(c, 3, f); - UC; - setref(c, 4, g); - UC; - b = c; - } - DC; - DMC; - } - - mps_ap_destroy(apawl); - mps_ap_destroy(apamc); - mps_pool_destroy(poolamc); - mps_pool_destroy(poolawl); - mps_chain_destroy(chain); - mps_fmt_destroy(format); - mps_root_destroy(root); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/56.c b/mps/qa/function/56.c deleted file mode 100644 index e6179463055..00000000000 --- a/mps/qa/function/56.c +++ /dev/null @@ -1,126 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!56.c(trunk.5) $ - summary = use AMC and AMC without inactive LO pool - language = c - link = testlib.o awlfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "mpsavm.h" -#include "awlfmt.h" - - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - - -void *stackpointer; - - -static void test(void) -{ - mps_arena_t arena; - mps_pool_t poolamc, poolawl; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_chain_t chain; - mps_ap_t apamc, apawl; - - mycell *a, *b, *c, *d, *e, *f, *g; - - int i; - int j; - - RC; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), mmqaArenaSIZE), - "create arena"); - - die(mps_thread_reg(&thread, arena), "register thread"); - die(mps_root_create_reg(&root, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - die(mps_fmt_create_A(&format, arena, &fmtA), "create format"); - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - die(mmqa_pool_create_chain(&poolamc, arena, mps_class_amc(), format, chain), - "create pool(amc)"); - /* Yes, we do intend an AMC pool, even though we call it poolawl (cf. 54.c). */ - die(mmqa_pool_create_chain(&poolawl, arena, mps_class_amc(), format, chain), - "create pool(awl)"); - - cdie( - mps_ap_create(&apawl, poolawl, MPS_RANK_EXACT), - "create ap"); - - cdie( - mps_ap_create(&apamc, poolamc, MPS_RANK_EXACT), - "create ap(amc)"); - - b = allocone(apamc, 1, 1); - - for (j = 1; j < 100; j++) { - comment("%i of 100.", j); - UC; - a = allocone(apamc, 5, 1); - b = a; - c = a; - d = a; - e = a; - f = a; - g = a; - - for (i = 1; i < 5000; i++) { - UC; - c = allocone(apamc, 20, 1); - d = allocone(apawl, 20, 1); - if (ranint(8) == 0) e = c; - if (ranint(8) == 0) f = c; - if (ranint(8) == 0) g = c; - UC; - setref(b, 0, c); - UC; - setref(c, 1, d); - UC; - setref(c, 2, e); - UC; - setref(c, 3, f); - UC; - setref(c, 4, g); - UC; - b = c; - } - DC; - DMC; - } - - mps_ap_destroy(apawl); - mps_ap_destroy(apamc); - mps_pool_destroy(poolamc); - mps_pool_destroy(poolawl); - mps_chain_destroy(chain); - mps_fmt_destroy(format); - mps_root_destroy(root); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/57.c b/mps/qa/function/57.c deleted file mode 100644 index 28ac4c06348..00000000000 --- a/mps/qa/function/57.c +++ /dev/null @@ -1,122 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!57.c(trunk.4) $ - summary = use AMC and itself without inactive LO pool - language = c - link = testlib.o awlfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "mpsavm.h" -#include "awlfmt.h" - - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - - -void *stackpointer; - - -static void test(void) -{ - mps_arena_t arena; - mps_pool_t poolamc; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_chain_t chain; - mps_ap_t apamc, apawl; - - mycell *a, *b, *c, *d, *e, *f, *g; - - int i; - int j; - - RC; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), mmqaArenaSIZE), - "create arena"); - - die(mps_thread_reg(&thread, arena), "register thread"); - die(mps_root_create_reg(&root, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - die(mps_fmt_create_A(&format, arena, &fmtA), "create format"); - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - die(mmqa_pool_create_chain(&poolamc, arena, mps_class_amc(), format, chain), - "create pool(amc)"); - - cdie( - mps_ap_create(&apawl, poolamc, MPS_RANK_EXACT), - "create ap"); - - cdie( - mps_ap_create(&apamc, poolamc, MPS_RANK_EXACT), - "create ap(amc)"); - - b = allocone(apamc, 1, 1); - - for (j = 1; j < 100; j++) { - comment("%i of 100.", j); - UC; - a = allocone(apamc, 5, 1); - b = a; - c = a; - d = a; - e = a; - f = a; - g = a; - - for (i = 1; i < 5000; i++) { - UC; - c = allocone(apamc, 20, 1); - d = allocone(apawl, 20, 1); - if (ranint(8) == 0) e = c; - if (ranint(8) == 0) f = c; - if (ranint(8) == 0) g = c; - UC; - setref(b, 0, c); - UC; - setref(c, 1, d); - UC; - setref(c, 2, e); - UC; - setref(c, 3, f); - UC; - setref(c, 4, g); - UC; - b = c; - } - DC; - DMC; - } - - mps_ap_destroy(apawl); - mps_ap_destroy(apamc); - mps_pool_destroy(poolamc); - mps_chain_destroy(chain); - mps_fmt_destroy(format); - mps_root_destroy(root); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/6.c b/mps/qa/function/6.c deleted file mode 100644 index f42dcda8442..00000000000 --- a/mps/qa/function/6.c +++ /dev/null @@ -1,101 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!6.c(trunk.5) $ - summary = (regression test ) Keep resetting lds in managed memory while doing allocation. The idea is to force a collection so that the ld will be protected when you try to reset it. - language = c - link = testlib.o newfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "mpsavm.h" -#include "newfmt.h" - - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - - -void *stackpointer; - -static void test(void) -{ - mps_arena_t arena; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_chain_t chain; - mps_ap_t ap; - - mycell *a, *b, *c; - mycell *p; - mps_ld_t ld; - - int i, j; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), mmqaArenaSIZE), - "create arena"); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie(mps_root_create_reg(&root, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie(mps_fmt_create_A(&format, arena, &fmtA), "create format"); - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - cdie(mmqa_pool_create_chain(&pool, arena, mps_class_amc(), format, chain), - "create pool"); - - cdie(mps_ap_create(&ap, pool, MPS_RANK_EXACT), "create ap"); - - a = allocone(ap, 100); - b = a; - c = a; - - for (j = 1; j < 100; j++) { - comment("%i of 100", j); - p = allocdumb(ap, sizeof(mps_ld_s)); - ld = (mps_ld_t) getdata(p); - - b = a; - c = a; - - for (i = 1; i < 100; i++) { - mps_ld_reset(ld, arena); - - UC; - c = allocone(ap, 200); - UC; - setref(b, 0, c); - UC; - b = c; - } - } - - mps_ap_destroy(ap); - mps_pool_destroy(pool); - mps_chain_destroy(chain); - mps_fmt_destroy(format); - mps_root_destroy(root); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/60.c b/mps/qa/function/60.c deleted file mode 100644 index bc43c42f277..00000000000 --- a/mps/qa/function/60.c +++ /dev/null @@ -1,110 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = loops an AMC and an AWL pool - language = c - link = testlib.o awlfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "mpscawl.h" -#include "awlfmt.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t poolamc1, poolawl2; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_ap_t ap1, ap2; - - mycell *a, *b; - - int i; - int j; - - RC; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - cdie( - mps_pool_create(&poolamc1, space, mps_class_amc(), format), - "create pool"); - - cdie( - mps_pool_create(&poolawl2, space, mps_class_awl(), format), - "create pool"); - - cdie( - mps_ap_create(&ap1, poolamc1, MPS_RANK_EXACT), - "create ap"); - - cdie( - mps_ap_create(&ap2, poolawl2, MPS_RANK_EXACT), - "create ap"); - - for (j=1; j<100; j++) - { - comment("%i of 100.", j); - - for (i=1; i<10000; i++) - { - UC; - a = allocone(ap1, 100, 1); - b = allocone(ap2, 100, 1); - setref(a, 0, b); - setref(b, 0, a); - UC; - } - DC; - DMC; - } - - mps_ap_destroy(ap1); - mps_ap_destroy(ap2); - comment("Destroyed aps."); - - mps_pool_destroy(poolamc1); - mps_pool_destroy(poolawl2); - comment("Destroyed pools."); - - mps_fmt_destroy(format); - comment("Destroyed format."); - - mps_root_destroy(root); - comment("Destroyed root."); - - mps_thread_dereg(thread); - comment("Deregistered thread."); - - mps_space_destroy(space); - comment("Destroyed space."); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/61.c b/mps/qa/function/61.c deleted file mode 100644 index 258c0eec349..00000000000 --- a/mps/qa/function/61.c +++ /dev/null @@ -1,103 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!61.c(trunk.4) $ - summary = loops between two AMC pools - language = c - link = testlib.o awlfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "mpsavm.h" -#include "awlfmt.h" - - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - - -void *stackpointer; - - -static void test(void) -{ - mps_arena_t arena; - mps_pool_t poolamc1, poolamc2; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_chain_t chain; - mps_ap_t ap1, ap2; - - mycell *a, *b; - - int i; - int j; - - RC; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), mmqaArenaSIZE), - "create arena"); - - die(mps_thread_reg(&thread, arena), "register thread"); - die(mps_root_create_reg(&root, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - die(mps_fmt_create_A(&format, arena, &fmtA), "create format"); - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - die(mmqa_pool_create_chain(&poolamc1, arena, mps_class_amc(), format, chain), - "create pool(1)"); - die(mmqa_pool_create_chain(&poolamc2, arena, mps_class_amc(), format, chain), - "create pool(1)"); - - cdie( - mps_ap_create(&ap1, poolamc1, MPS_RANK_EXACT), - "create ap"); - - cdie( - mps_ap_create(&ap2, poolamc2, MPS_RANK_EXACT), - "create ap"); - - for (j = 1; j < 100; j++) { - comment("%i of 100.", j); - - for (i = 1; i < 10000; i++) { - UC; - a = allocone(ap1, 100, 1); - b = allocone(ap2, 100, 1); - setref(a, 0, b); - setref(b, 0, a); - UC; - } - DC; - DMC; - } - - mps_ap_destroy(ap1); - mps_ap_destroy(ap2); - mps_pool_destroy(poolamc1); - mps_pool_destroy(poolamc2); - mps_chain_destroy(chain); - mps_fmt_destroy(format); - mps_root_destroy(root); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/62.c b/mps/qa/function/62.c deleted file mode 100644 index f4733f7279f..00000000000 --- a/mps/qa/function/62.c +++ /dev/null @@ -1,103 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!62.c(trunk.4) $ - summary = loops wthin an AMC pool - language = c - link = testlib.o awlfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "mpsavm.h" -#include "awlfmt.h" - - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - - -void *stackpointer; - - -static void test(void) -{ - mps_arena_t arena; - mps_pool_t poolamc1, poolamc2; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_chain_t chain; - mps_ap_t ap1, ap2; - - mycell *a, *b; - - int i; - int j; - - RC; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), mmqaArenaSIZE), - "create arena"); - - die(mps_thread_reg(&thread, arena), "register thread"); - die(mps_root_create_reg(&root, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - die(mps_fmt_create_A(&format, arena, &fmtA), "create format"); - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - die(mmqa_pool_create_chain(&poolamc1, arena, mps_class_amc(), format, chain), - "create pool(1)"); - die(mmqa_pool_create_chain(&poolamc2, arena, mps_class_amc(), format, chain), - "create pool(2)"); - - cdie( - mps_ap_create(&ap1, poolamc1, MPS_RANK_EXACT), - "create ap"); - - cdie( - mps_ap_create(&ap2, poolamc2, MPS_RANK_EXACT), - "create ap"); - - for (j = 1; j < 100; j++) { - comment("%i of 100.", j); - - for (i = 1; i < 10000; i++) { - UC; - a = allocone(ap1, 2, 1); - b = allocone(ap1, 2, 1); - setref(a, 0, b); - setref(b, 0, a); - UC; - } - DC; - DMC; - } - - mps_ap_destroy(ap1); - mps_ap_destroy(ap2); - mps_pool_destroy(poolamc1); - mps_pool_destroy(poolamc2); - mps_chain_destroy(chain); - mps_fmt_destroy(format); - mps_root_destroy(root); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/63.c b/mps/qa/function/63.c deleted file mode 100644 index a74c89e2695..00000000000 --- a/mps/qa/function/63.c +++ /dev/null @@ -1,95 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!63.c(trunk.4) $ - summary = loops wthin an AMC pool - language = c - link = testlib.o awlfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "mpsavm.h" -#include "awlfmt.h" - - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - - -void *stackpointer; - - -static void test(void) -{ - mps_arena_t arena; - mps_pool_t poolamc1; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_chain_t chain; - mps_ap_t ap1; - - mycell *a, *b; - - int i; - int j; - - RC; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), mmqaArenaSIZE), - "create arena"); - - die(mps_thread_reg(&thread, arena), "register thread"); - die(mps_root_create_reg(&root, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - die(mps_fmt_create_A(&format, arena, &fmtA), "create format"); - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - die(mmqa_pool_create_chain(&poolamc1, arena, mps_class_amc(), format, chain), - "create pool(1)"); - - cdie( - mps_ap_create(&ap1, poolamc1, MPS_RANK_EXACT), - "create ap"); - - for (j = 1; j < 100; j++) { - comment("%i of 100.", j); - - for (i = 1; i < 10000; i++) { - UC; - a = allocone(ap1, 2, 1); - b = allocone(ap1, 2, 1); - setref(a, 0, b); - setref(b, 0, a); - UC; - } - DC; - DMC; - } - - mps_ap_destroy(ap1); - mps_pool_destroy(poolamc1); - mps_chain_destroy(chain); - mps_fmt_destroy(format); - mps_root_destroy(root); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/64.c b/mps/qa/function/64.c deleted file mode 100644 index 8f1096b9228..00000000000 --- a/mps/qa/function/64.c +++ /dev/null @@ -1,128 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!64.c(trunk.4) $ - summary = use AMC with inactive LO pool - language = c - link = testlib.o awlfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "mpsclo.h" -#include "mpsavm.h" -#include "awlfmt.h" - - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - - -void *stackpointer; - - -static void test(void) -{ - mps_arena_t arena; - mps_pool_t poolamc, poollo; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_chain_t chain; - mps_ap_t apamc, aplo; - - mycell *a, *b, *c, *d, *e, *f, *g; - - int i; - int j; - - RC; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), mmqaArenaSIZE), - "create arena"); - - die(mps_thread_reg(&thread, arena), "register thread"); - die(mps_root_create_reg(&root, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - die(mps_fmt_create_A(&format, arena, &fmtA), "create format"); - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - die(mmqa_pool_create_chain(&poolamc, arena, mps_class_amc(), format, chain), - "create pool(amc)"); - - cdie( - mps_pool_create(&poollo, arena, mps_class_lo(), format), - "create pool"); - - cdie( - mps_ap_create(&apamc, poolamc, MPS_RANK_EXACT), - "create ap(amc)"); - - cdie( - mps_ap_create(&aplo, poollo, MPS_RANK_EXACT), - "create ap"); - - b = allocone(apamc, 1, 1); - - for (j = 1; j < 100; j++) { - comment("%i of 100.", j); - UC; - a = allocone(apamc, 5, 1); - b = a; - c = a; - d = a; - e = a; - f = a; - g = a; - - for (i = 1; i < 1000; i++) { - UC; - c = allocone(apamc, 20, 1); - d = allocone(apamc, 20, 1); - if (ranint(8) == 0) e = c; - if (ranint(8) == 0) f = c; - if (ranint(8) == 0) g = c; - UC; - setref(b, 0, c); - UC; - setref(c, 1, d); - UC; - setref(c, 2, e); - UC; - setref(c, 3, f); - UC; - setref(c, 4, g); - UC; - b = c; - } - DC; - DMC; - } - - mps_ap_destroy(apamc); - mps_ap_destroy(aplo); - mps_pool_destroy(poolamc); - mps_pool_destroy(poollo); - mps_chain_destroy(chain); - mps_fmt_destroy(format); - mps_root_destroy(root); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/65.c b/mps/qa/function/65.c deleted file mode 100644 index 0322a7cccba..00000000000 --- a/mps/qa/function/65.c +++ /dev/null @@ -1,211 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!65.c(trunk.6) $ - summary = sort-of-leak in arena_collect - language = c - link = testlib.o exfmt.o -OUTPUT_SPEC - junksize = 0 - result = pass -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "mpsavm.h" -#include "exfmt.h" - -#define MAGICSIZE ((size_t) 10342) - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - - -void *stackpointer; -long int appcount; -long int apppadcount; -long int cutoff_id; -size_t junk_size; - - -static void test_apply(mps_addr_t addr, void *V, size_t S) -{ - mycell *a; - long int id; - - asserts(S == MAGICSIZE, "Size didn't get passed!"); - a = addr; - asserts(((a->tag) & 0x3) == MCdata || ((a->tag) & 0x3) == MCpad, - "apply on non-data and non-pad object at %p", addr); - if (((a->tag) & 0x3) == MCdata) { - appcount += 1; - id = getid(a); - if (id < cutoff_id) { - junk_size += a->data.size; - } - } else { - apppadcount +=1; - } -} - - -static void test(void) -{ - mps_arena_t arena; - mps_pool_t poolamc; - mps_thr_t thread; - mps_root_t root, root2, root3, root4, root5, root6, root7, root1; - - mps_fmt_t format; - mps_chain_t chain; - mps_ap_t apamc; - - typedef mycell * myroot; - myroot a, b, c, d, e, f, g; - - int i; - int j; - - RC; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), mmqaArenaSIZE), - "create arena"); - - die(mps_thread_reg(&thread, arena), "register thread"); - - cdie( - mps_root_create_table(&root1, arena, MPS_RANK_EXACT, 0, (mps_addr_t*)&a, 1), - "root"); - cdie( - mps_root_create_table(&root2, arena, MPS_RANK_EXACT, 0, (mps_addr_t*)&b, 1), - "root"); - cdie( - mps_root_create_table(&root3, arena, MPS_RANK_EXACT, 0, (mps_addr_t*)&c, 1), - "root"); - cdie( - mps_root_create_table(&root4, arena, MPS_RANK_EXACT, 0, (mps_addr_t*)&d, 1), - "root"); - cdie( - mps_root_create_table(&root5, arena, MPS_RANK_EXACT, 0, (mps_addr_t*)&e, 1), - "root"); - cdie( - mps_root_create_table(&root6, arena, MPS_RANK_EXACT, 0, (mps_addr_t*)&f, 1), - "root"); - cdie( - mps_root_create_table(&root7, arena, MPS_RANK_EXACT, 0, (mps_addr_t*)&g, 1), - "root"); - - cdie( - mps_root_create_table(&root, arena, MPS_RANK_EXACT, 0, &exfmt_root, 1), - "create exfmt root"); - - die(mps_fmt_create_A(&format, arena, &fmtA), "create format"); - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - die(mmqa_pool_create_chain(&poolamc, arena, mps_class_amc(), format, chain), - "create pool"); - - cdie( - mps_ap_create(&apamc, poolamc, MPS_RANK_EXACT), - "create ap"); - - comment("parking..."); - mps_arena_park(arena); - - b = allocone(apamc, 1, 1); - - for (j=1; j<10; j++) { - comment("%i of 10.", j); - a = allocone(apamc, 5, 1); - cutoff_id = getid(a); - b = a; - c = a; - d = a; - e = a; - f = a; - g = a; - for (i=1; i<1000; i++) { - c = allocone(apamc, 1000, 1); - if (ranint(8) == 0) d = c; - if (ranint(8) == 0) e = c; - if (ranint(8) == 0) f = c; - if (ranint(8) == 0) g = c; - setref(c, 0, b); - setref(c, 1, d); - setref(c, 2, e); - setref(c, 3, f); - setref(c, 4, g); - b = c; - } - - for (i=1; i<1000; i++) { - c = allocone(apamc, 1000, 1); - if (ranint(8) == 0) d = c; - if (ranint(8) == 0) e = c; - if (ranint(8) == 0) f = c; - if (ranint(8) == 0) g = c; - setref(c, 0, b); - setref(c, 1, d); - setref(c, 2, e); - setref(c, 3, f); - setref(c, 4, g); - b = c; - } - a = c; - b = c; - d = c; - e = c; - f = c; - g = c; - exfmt_root = c; - mps_arena_collect(arena); - comment(" reserved: %lu", (unsigned long) mps_arena_reserved(arena)); - comment("committed: %lu", (unsigned long) mps_arena_committed(arena)); - comment("calling amc_apply:"); - checkfrom(c); - appcount = 0; - apppadcount = 0; - junk_size = 0; - mps_amc_apply(poolamc, &test_apply, NULL, MAGICSIZE); - comment("finished amc_apply"); - report("junksize", "%lu", (unsigned long) junk_size); - report("appcount", "%ld", appcount); - report("apppadcount", "%ld", apppadcount); - RC; - } - - mps_arena_release(arena); - comment("released."); - - mps_ap_destroy(apamc); - mps_pool_destroy(poolamc); - mps_chain_destroy(chain); - mps_fmt_destroy(format); - - mps_root_destroy(root); - mps_root_destroy(root1); - mps_root_destroy(root2); - mps_root_destroy(root3); - mps_root_destroy(root4); - mps_root_destroy(root5); - mps_root_destroy(root6); - mps_root_destroy(root7); - comment("Destroyed roots."); - - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/66.c b/mps/qa/function/66.c deleted file mode 100644 index c6255e19b6b..00000000000 --- a/mps/qa/function/66.c +++ /dev/null @@ -1,179 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = test of location dependencies - language = c - link = testlib.o rankfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscawl.h" -#include "mpscmv.h" -#include "mpscamc.h" -#include "rankfmt.h" - -#define MAXLDS 1000 - -void *stackpointer; - -mps_space_t space; -static mycell *obj_table[MAXLDS]; -static mps_ld_t lds[MAXLDS]; - -static void checklds(void) { - int i; - - for (i=0; i < MAXLDS; i++) { - if (obj_table[i]->data.copycount != 0) { - asserts(mps_ld_isstale(lds[i], space, (mps_addr_t) obj_table[i]), - "%d isn't stale but should be", i); - if (ranint(4) == 0) { - obj_table[i]->data.copycount = 0; - mps_ld_reset(lds[i], space); - comment("reset %d", i); - mps_ld_add(lds[i], space, (mps_addr_t) obj_table[i]); - } - } - } -} - -static void test(void) { - mps_pool_t poolmv, poolawl, poolamc; - mps_thr_t thread; - mps_root_t root0, root1, root2; - - mps_addr_t p; - mps_fmt_t format; - mps_ap_t apawl, apamc; - - mycell *a, *b; - - int i,j; - - RC; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_table(&root0, space, MPS_RANK_AMBIG, 0, &exfmt_root, 1), - "create exfmt root"); - - cdie( - mps_root_create_table(&root2, space, MPS_RANK_EXACT, 0, - (mps_addr_t *)obj_table, MAXLDS), - "create table root"); - - cdie( - mps_root_create_reg(&root1, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create register and stack root"); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - cdie( - mps_pool_create(&poolawl, space, mps_class_awl(), format), - "create awl pool"); - - cdie( - mps_pool_create(&poolmv, space, mps_class_mv(), 0x4000, 128, 0x4000), - "create mv pool"); - - cdie( - mps_ap_create(&apawl, poolawl, MPS_RANK_EXACT), - "create ap"); - - cdie( - mps_pool_create(&poolamc, space, mps_class_amc(), format), - "create amc pool"); - - cdie( - mps_ap_create(&apamc, poolamc, MPS_RANK_EXACT), - "create ap"); - - /* first we'll use only pool classes MV and AWL. So LDs shouldn't - go stale at all. - */ - - b = allocone(apawl, 5, MPS_RANK_EXACT); - - for (i=0; i < MAXLDS; i++) { - comment("%d", i); - mps_alloc(&p, poolmv, sizeof(mps_ld_s)); - a = allocone(apawl, 5, MPS_RANK_EXACT); - setref(a, 0, b); - b = a; - a = allocdumb(apamc, 256*1024, MPS_RANK_EXACT); - a = allocdumb(apawl, 256*1024, MPS_RANK_EXACT); - comment("alloc"); - lds[i] = p; - mps_ld_reset(lds[i], space); - comment("reset"); - if (i>0) { - mps_ld_add(lds[i], space, (mps_addr_t) b); - } - comment("add"); - } - - for (i=0; i < MAXLDS; i++) { - comment("%d", i); - asserts(mps_ld_isstale(lds[i], space, p) == 0, - "%d stale but shouldn't be", i); - } - -/* allocate MAXLDS objects, and make each LD depend on the corresponding - object -*/ - - for (i=0; i < MAXLDS; i++) { - comment("%d", i); - obj_table[i] = allocone(apamc, ranint(100), MPS_RANK_EXACT); - mps_ld_add(lds[i], space, (mps_addr_t) obj_table[i]); - } - - for (i=0; i < 1000; i++) { - comment("%d of 1000", i); - checklds(); - for (j=0; j < 4; j++) { - a = allocdumb(apamc, 32*1024, MPS_RANK_EXACT); - } - } - - mps_ap_destroy(apawl); - mps_ap_destroy(apamc); - comment("Destroyed aps."); - - mps_pool_destroy(poolmv); - mps_pool_destroy(poolamc); - mps_pool_destroy(poolawl); - comment("Destroyed pools."); - - mps_fmt_destroy(format); - comment("Destroyed format."); - - mps_root_destroy(root0); - mps_root_destroy(root1); - mps_root_destroy(root2); - comment("Destroyed roots."); - - mps_thread_dereg(thread); - comment("Deregistered thread."); - - mps_space_destroy(space); - comment("Destroyed space."); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/67.c b/mps/qa/function/67.c deleted file mode 100644 index c7c039690b6..00000000000 --- a/mps/qa/function/67.c +++ /dev/null @@ -1,124 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!67.c(trunk.5) $ - summary = test for non-bug with mark-sweep scanning in AWL - language = c - link = testlib.o exfmt.o -END_HEADER - - I wrote this test with drj when we were convinced there was - a bug in pool scanning because of ScanStateSetSummary setting - unfixed to be potentially bigger than the segment summary. But - it turned out not to be a problem, 'cos ScanStateSetSummary is - called (at least by AWL) _before_ scanning is done. -*/ - -#include "testlib.h" -#include "mpscawl.h" -#include "mpscamc.h" -#include "exfmt.h" -#include "mpsavm.h" - - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - - -void *stackpointer; - - -static void test(void) -{ - mps_arena_t arena; - mps_pool_t poolamc, poolawl; - mps_thr_t thread; - mps_root_t root, root1, root2; - - mps_fmt_t format; - mps_chain_t chain; - mps_ap_t apamc, apawl; - - mycell *a[3]; - - int j; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), mmqaArenaSIZE), - "create arena"); - - die(mps_thread_reg(&thread, arena), "register thread"); - die(mps_root_create_table(&root, arena, MPS_RANK_EXACT, 0, - (mps_addr_t*)&a[0], 2), - "create table root"); - - cdie( - mps_root_create_table(&root2, arena, MPS_RANK_AMBIG, 0, (mps_addr_t*)&a[2], 1), - "ambig table root"); - - cdie( - mps_root_create_table(&root1, arena, MPS_RANK_AMBIG, 0, &exfmt_root, 1), - "create exfmt root"); - - die(mps_fmt_create_A(&format, arena, &fmtA), "create format"); - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - die(mmqa_pool_create_chain(&poolamc, arena, mps_class_amc(), format, chain), - "create pool"); - - cdie( - mps_pool_create(&poolawl, arena, mps_class_awl(), format), - "create pool"); - - cdie( - mps_ap_create(&apawl, poolawl, MPS_RANK_EXACT), - "create ap"); - - cdie( - mps_ap_create(&apamc, poolamc, MPS_RANK_EXACT), - "create ap"); - - a[1] = allocone(apawl, 2, 1); - a[0] = allocone(apawl, 2, 1); - - a[2] = allocone(apamc, 2, 1); - setref(a[0], 0, a[2]); - - mps_ap_destroy(apawl); - comment("Destroyed awl ap"); - - for(j=0; j<100; j++) { - allocdumb(apamc, 1024*256, 1); - } - - mps_ap_destroy(apamc); - comment("Destroyed amc ap."); - - mps_root_destroy(root1); - mps_root_destroy(root2); - comment("Destroyed ambiguous roots."); - - a[1] = a[0]; - comment("Now to try arena_collect:"); - mps_arena_collect(arena); - - mps_pool_destroy(poolamc); - mps_pool_destroy(poolawl); - mps_chain_destroy(chain); - mps_fmt_destroy(format); - mps_root_destroy(root); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/68.c b/mps/qa/function/68.c deleted file mode 100644 index 413d90aae5a..00000000000 --- a/mps/qa/function/68.c +++ /dev/null @@ -1,107 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = keep calling arena_collect - language = c - link = testlib.o exfmt.o - manual = true -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "exfmt.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - mps_pool_t poolamc; - mps_thr_t thread; - mps_root_t root, root1; - - mps_fmt_t format; - mps_ap_t apamc; - - size_t size0, size1; - mycell *a, *b; - - int i; - int j; - - RC; - - deathcomments = 0; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_root_create_table(&root1, space, MPS_RANK_AMBIG, 0, &exfmt_root, 1), - "create exfmt root"); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - cdie( - mps_pool_create(&poolamc, space, mps_class_amc(), format), - "create pool"); - - cdie( - mps_ap_create(&apamc, poolamc, MPS_RANK_EXACT), - "create ap"); - - b = allocone(apamc, 1, 1); - - for (j=1; j<500; j++) { - a = allocone(apamc, 1000, 1); - setref(a, 0, b); - b = a; - } - - comment("Collecting"); - - size0 = mps_arena_committed(space); - - while(1) { - mps_arena_collect(space); - size1 = mps_arena_committed(space); - report("diff", "%lu", (unsigned long) (size1-size0)); - } - - mps_ap_destroy(apamc); - comment("Destroyed aps."); - - mps_pool_destroy(poolamc); - comment("Destroyed pools."); - - mps_fmt_destroy(format); - comment("Destroyed format."); - - mps_root_destroy(root); - mps_root_destroy(root1); - comment("Destroyed roots."); - - mps_thread_dereg(thread); - comment("Deregistered thread."); - - mps_space_destroy(space); - comment("Destroyed space."); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - return 0; -} diff --git a/mps/qa/function/69.c b/mps/qa/function/69.c deleted file mode 100644 index e2f36c7dbe0..00000000000 --- a/mps/qa/function/69.c +++ /dev/null @@ -1,116 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!69.c(trunk.6) $ - summary = request.dylan.170563 (colour invariant and finalization) - language = c - link = testlib.o rankfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "mpsavm.h" -#include "rankfmt.h" - - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - - -void *stackpointer; - -mps_arena_t arena; - - -static void test(void) { - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_chain_t chain; - mps_addr_t ref; - mps_message_t message; - mps_ap_t ap; - - mycell *a, *b; - tag myTag; - - long int j; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), mmqaArenaSIZE), - "create arena"); - - die(mps_thread_reg(&thread, arena), "register thread"); - die(mps_root_create_reg(&root, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - die(mps_fmt_create_A(&format, arena, &fmtA), "create format"); - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - die(mmqa_pool_create_chain(&pool, arena, mps_class_amc(), format, chain), - "create pool"); - - cdie( - mps_ap_create(&ap, pool, MPS_RANK_EXACT), - "create ap"); - - mps_message_type_enable(arena, mps_message_type_finalization()); - - b = allocone(ap, 400, 1); - - for (j=0; j<1000; j++) { - a = allocone(ap, 400, 1); - setref(a, 0, b); - b = a; - } - - a = allocone(ap, 2, 1); - mps_finalize(arena, (mps_addr_t*)&a); - myTag = a->tag; - - a = allocone(ap, 4000, 1); - mps_arena_collect(arena); - - if (!mps_message_get(&message, arena, MPS_MESSAGE_TYPE_FINALIZATION)) { - error("No message on queue!"); - } - - for (j=0; j<50; j++) { - comment("%d of 50", j); - a = allocdumb(ap, 1024*1024*10, 1); - mps_message_finalization_ref(&ref, arena, message); - mps_arena_park(arena); - a = ref; - comment(" %p", a); - asserts(a->tag == myTag, "Bad reference!"); - a = NULL; - ref = NULL; - mps_arena_release(arena); - } - - mps_message_discard(arena, message); - - mps_root_destroy(root); - mps_ap_destroy(ap); - mps_pool_destroy(pool); - mps_chain_destroy(chain); - mps_fmt_destroy(format); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/7.c b/mps/qa/function/7.c deleted file mode 100644 index 31741a70d37..00000000000 --- a/mps/qa/function/7.c +++ /dev/null @@ -1,35 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = create 1000 spaces and destroy each one just after the next is created - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" - -static void test(void) -{ - mps_space_t space; - mps_space_t space1; - - int p; - - die(mps_space_create(&space1), "create"); - - for (p=0; p<1000; p++) - { - die(mps_space_create(&space), "create"); - comment("%i", p); - mps_space_destroy(space1); - space1=space; - } -} - -int main(void) -{ - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/70.c b/mps/qa/function/70.c deleted file mode 100644 index 418ebdeae7c..00000000000 --- a/mps/qa/function/70.c +++ /dev/null @@ -1,39 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!70.c(trunk.3) $ - summary = create a space and see how much mem is taken - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" - - -static void test(void) -{ - mps_space_t space; - - comment("Entered trampoline"); - mmqa_pause(10); - cdie(mps_space_create(&space), "create space"); - comment("Created space"); - report("committed", "%ul", mps_arena_committed(space)); - report("reserved", "%ul", mps_arena_reserved(space)); - mmqa_pause(10); - mps_space_destroy(space); - comment("Destroyed space"); - mmqa_pause(10); -} - - -int main(void) -{ - comment("Started"); - mmqa_pause(10); - easy_tramp(test); - comment("Left trampoline"); - mmqa_pause(10); - pass(); - return 0; -} diff --git a/mps/qa/function/71.c b/mps/qa/function/71.c deleted file mode 100644 index 221e158df95..00000000000 --- a/mps/qa/function/71.c +++ /dev/null @@ -1,33 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = create 1000 spaces and destroy each one just before the next is created - language = c - link = testlib.o -END_HEADER -*/ - -#include "testlib.h" - -static void test(void) -{ - mps_space_t space; - - int p; - - die(mps_space_create(&space), "create"); - - for (p=0; p<1000; p++) - { - mps_space_destroy(space); - die(mps_space_create(&space), "create"); - comment("%i", p); - } -} - -int main(void) -{ - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/72.c b/mps/qa/function/72.c deleted file mode 100644 index 8e1359af57f..00000000000 --- a/mps/qa/function/72.c +++ /dev/null @@ -1,103 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!72.c(trunk.4) $ - summary = request.dylan.170439 (detect bad pointers) - language = c - link = testlib.o exfmt.o -OUTPUT_SPEC - assert = true - assertfile P= trace.c - assertline = 963 -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "exfmt.h" - -void *stackpointer; -mycell *z; - -static void test(void) -{ - mps_space_t space; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_ap_t ap; - - mycell *a, *b; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - cdie( - mps_root_create_reg(&root, space, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - cdie( - mps_pool_create(&pool, space, mps_class_amc(), format), - "create pool"); - - cdie( - mps_ap_create(&ap, pool, MPS_RANK_EXACT), - "create ap"); - - a = allocone(ap, 1024, 1); - z = a; - - b = allocone(ap, 1024, 1); - setref(b, 0, a); - - a = allocdumb(ap, 1024*64, 1); - a = allocdumb(ap, 1024*64, 1); - - comment("Collecting..."); - mps_arena_collect(space); - asserts(z != a, "Didn't move!"); - - comment("Writing bad pointer..."); - - b->data.ref[0].addr = z; - mps_arena_collect(space); - comment("Bad pointer not spotted in collection"); - - fail(); - - mps_ap_destroy(ap); - comment("Destroyed ap."); - - mps_pool_destroy(pool); - comment("Destroyed pool."); - - mps_fmt_destroy(format); - comment("Destroyed format."); - - mps_root_destroy(root); - comment("Destroyed root."); - - mps_thread_dereg(thread); - comment("Deregistered thread."); - - mps_space_destroy(space); - comment("Destroyed space."); - -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/73.c b/mps/qa/function/73.c deleted file mode 100644 index cd86a025090..00000000000 --- a/mps/qa/function/73.c +++ /dev/null @@ -1,93 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!73.c(trunk.4) $ - summary = AWL pool should get collected (request.dylan.170322) - language = c - link = testlib.o rankfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscawl.h" -#include "rankfmt.h" -#include "mpsavm.h" - - -void *stackpointer; - -mps_arena_t arena; - - -static void test(void) { - mps_pool_t poolawl; - mps_thr_t thread; - mps_root_t root0, root1; - - mps_fmt_t format; - mps_ap_t apawl; - - mycell *a; - - long int j; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t)1024*1024*30), - "create arena"); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie(mps_root_create_reg(&root0, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie(mps_root_create_table(&root1, arena, MPS_RANK_AMBIG, 0, - (mps_addr_t *)&exfmt_root, 1), - "create table root"); - - cdie(mps_fmt_create_A(&format, arena, &fmtA), - "create format"); - - cdie(mps_pool_create(&poolawl, arena, mps_class_awl(), format), - "create pool"); - - cdie(mps_ap_create(&apawl, poolawl, MPS_RANK_EXACT), - "create ap"); - - /* alloc lots in an AWL pool; it should be collected away */ - - for(j=0; j<1000; j++) { - a = allocdumb(apawl, 1024ul*1024, MPS_RANK_EXACT); - } - - /* (total allocated is 1000 M) */ - - mps_root_destroy(root0); - mps_root_destroy(root1); - comment("Destroyed roots."); - - mps_ap_destroy(apawl); - comment("Destroyed ap."); - - mps_pool_destroy(poolawl); - comment("Destroyed pool."); - - mps_fmt_destroy(format); - comment("Destroyed format."); - - mps_thread_dereg(thread); - comment("Deregistered thread."); - - mps_arena_destroy(arena); - comment("Destroyed arena."); - - pass(); -} - - -int main(void) { - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/74.c b/mps/qa/function/74.c deleted file mode 100644 index 1ae751119a4..00000000000 --- a/mps/qa/function/74.c +++ /dev/null @@ -1,93 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!74.c(trunk.4) $ - summary = LO pool should get collected (cf request.dylan.170322) - language = c - link = testlib.o rankfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpsclo.h" -#include "rankfmt.h" -#include "mpsavm.h" - - -void *stackpointer; - -mps_arena_t arena; - - -static void test(void) { - mps_pool_t poollo; - mps_thr_t thread; - mps_root_t root0, root1; - - mps_fmt_t format; - mps_ap_t aplo; - - mycell *a; - - long int j; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t)1024*1024*30), - "create arena"); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie(mps_root_create_reg(&root0, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie(mps_root_create_table(&root1, arena, MPS_RANK_AMBIG, 0, - (mps_addr_t *)&exfmt_root, 1), - "create table root"); - - cdie(mps_fmt_create_A(&format, arena, &fmtA), - "create format"); - - cdie(mps_pool_create(&poollo, arena, mps_class_lo(), format), - "create pool"); - - cdie(mps_ap_create(&aplo, poollo, MPS_RANK_EXACT), - "create ap"); - - /* alloc lots in an LO pool; it should be collected away */ - - for(j=0; j<1000; j++) { - a = allocdumb(aplo, 1024ul*1024, MPS_RANK_EXACT); - } - - /* (total allocated is 1000 M) */ - - mps_root_destroy(root0); - mps_root_destroy(root1); - comment("Destroyed roots."); - - mps_ap_destroy(aplo); - comment("Destroyed ap."); - - mps_pool_destroy(poollo); - comment("Destroyed pool."); - - mps_fmt_destroy(format); - comment("Destroyed format."); - - mps_thread_dereg(thread); - comment("Deregistered thread."); - - mps_arena_destroy(arena); - comment("Destroyed arena."); - - pass(); -} - - -int main(void) { - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/75.c b/mps/qa/function/75.c deleted file mode 100644 index dac161501af..00000000000 --- a/mps/qa/function/75.c +++ /dev/null @@ -1,96 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!75.c(trunk.5) $ - summary = AWL pool should get collected (cf request.dylan.170322) - language = c - link = testlib.o rankfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "mpsavm.h" -#include "rankfmt.h" - - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - - -void *stackpointer; - -mps_arena_t arena; - - -static void test(void) -{ - mps_pool_t poolamc; - mps_thr_t thread; - mps_root_t root0, root1; - - mps_fmt_t format; - mps_chain_t chain; - mps_ap_t apamc; - - mycell *a; - - long int j; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t)1024*1024*30), - "create arena"); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - cdie(mps_root_create_reg(&root0, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie(mps_root_create_table(&root1, arena, MPS_RANK_AMBIG, 0, - (mps_addr_t *)&exfmt_root, 1), - "create table root"); - - cdie(mps_fmt_create_A(&format, arena, &fmtA), - "create format"); - - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - die(mmqa_pool_create_chain(&poolamc, arena, mps_class_amc(), format, chain), - "create pool"); - - cdie(mps_ap_create(&apamc, poolamc, MPS_RANK_EXACT), - "create ap"); - - /* alloc lots in an AMC pool; it should be collected away */ - - for(j=0; j<1000; j++) { - a = allocdumb(apamc, 1024ul*1024, MPS_RANK_EXACT); - } - - /* (total allocated is 1000 M) */ - - mps_root_destroy(root0); - mps_root_destroy(root1); - comment("Destroyed roots."); - - mps_ap_destroy(apamc); - mps_pool_destroy(poolamc); - mps_chain_destroy(chain); - mps_fmt_destroy(format); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena."); - - pass(); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/76.c b/mps/qa/function/76.c deleted file mode 100644 index 67bf2a612c4..00000000000 --- a/mps/qa/function/76.c +++ /dev/null @@ -1,150 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!76.c(trunk.5) $ - summary = destroy space when messages are on the queue - language = c - link = testlib.o rankfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscawl.h" -#include "mpscamc.h" -#include "mpsavm.h" -#include "mpsclo.h" -#include "rankfmt.h" - - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - - -void *stackpointer; - -mps_arena_t arena; - -int final_count = 0; - - -static void test(void) -{ - mps_pool_t poolamc, poolawl, poollo; - mps_thr_t thread; - mps_root_t root0, root1; - - mps_fmt_t format; - mps_chain_t chain; - mps_ap_t apamc, apawl, aplo; - - mycell *a, *b, *c, *d; - - long int j; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t)1024*1024*30), - "create arena"); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - cdie(mps_root_create_reg(&root0, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie(mps_root_create_table(&root1, arena, MPS_RANK_AMBIG, 0, - (mps_addr_t*)&exfmt_root, 1), - "create table root"); - - cdie(mps_fmt_create_A(&format, arena, &fmtA), - "create format"); - - die(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - die(mmqa_pool_create_chain(&poolamc, arena, mps_class_amc(), format, chain), - "create pool(amc)"); - - cdie(mps_pool_create(&poolawl, arena, mps_class_awl(), format), - "create pool(awl)"); - - cdie(mps_pool_create(&poollo, arena, mps_class_lo(), format), - "create pool"); - - cdie(mps_ap_create(&apawl, poolawl, MPS_RANK_WEAK), - "create ap(amc)"); - - cdie(mps_ap_create(&apamc, poolamc, MPS_RANK_EXACT), - "create ap(awl)"); - - cdie(mps_ap_create(&aplo, poollo, MPS_RANK_EXACT), - "create ap"); - - mps_message_type_enable(arena, mps_message_type_finalization()); - - /* register loads of objects for finalization (1000*4) */ - - a = allocone(apamc, 2, 1); - b = a; - - for (j=0; j<1000; j++) { - a = allocone(apamc, 2, MPS_RANK_EXACT); - c = allocone(apawl, 2, MPS_RANK_WEAK); - d = allocone(aplo, 2, MPS_RANK_EXACT); /* rank irrelevant here! */ - mps_finalize(arena, (mps_addr_t*)&a); - mps_finalize(arena, (mps_addr_t*)&c); - mps_finalize(arena, (mps_addr_t*)&d); - mps_finalize(arena, (mps_addr_t*)&d); - final_count += 4; - } - - /* throw them all away and collect everything */ - - a = NULL; - b = NULL; - c = NULL; - d = NULL; - - mps_root_destroy(root0); - mps_root_destroy(root1); - comment("Destroyed roots."); - - mps_arena_collect(arena); - - while(mps_message_poll(arena) == 0) { - a = allocdumb(apawl, 1024, MPS_RANK_WEAK); - a = allocdumb(apamc, 1024, MPS_RANK_EXACT); - a = allocdumb(aplo, 1024, MPS_RANK_EXACT); - mps_arena_collect(arena); - } - - /* how many are left? (n.b. ideally this would be 0 but - there's no guarantee) - */ - - /* now to test leaving messages open for a long time! */ - - mps_ap_destroy(apawl); - mps_ap_destroy(apamc); - mps_ap_destroy(aplo); - comment("Destroyed aps."); - - mps_pool_destroy(poolamc); - mps_pool_destroy(poolawl); - mps_pool_destroy(poollo); - comment("Destroyed pools."); - - mps_chain_destroy(chain); - mps_fmt_destroy(format); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/77.c b/mps/qa/function/77.c deleted file mode 100644 index 973761832d1..00000000000 --- a/mps/qa/function/77.c +++ /dev/null @@ -1,119 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!77.c(trunk.3) $ - summary = AMC and AWL performance - language = c - link = testlib.o fastfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscawl.h" -#include "mpscamc.h" -#include "mpsclo.h" -#include "fastfmt.h" -#include "mpsavm.h" - - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - - -void *stackpointer; - - -static void test(void) -{ - mps_arena_t arena; - mps_pool_t poolamc, poolawl; - mps_thr_t thread; - mps_root_t root, root1; - - mps_fmt_t format; - mps_chain_t chain; - mps_ap_t apamc, apawl; - - mycell *a, *b, *c, *d, *e, *f, *g; - - int i; - int j; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), mmqaArenaSIZE), - "create arena"); - - die(mps_thread_reg(&thread, arena), "register thread"); - die(mps_root_create_reg(&root, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_root_create_table(&root1,arena,MPS_RANK_AMBIG,0,&exfmt_root,1), - "create table root"); - - die(mps_fmt_create_A(&format, arena, &fmtA), "create format"); - die(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - die(mmqa_pool_create_chain(&poolamc, arena, mps_class_amc(), format, chain), - "create pool(amc)"); - - die(mps_pool_create(&poolawl, arena, mps_class_awl(), format), - "create pool(awl)"); - - die(mps_ap_create(&apawl, poolawl, MPS_RANK_EXACT), - "create ap(awl)"); - - die(mps_ap_create(&apamc, poolamc, MPS_RANK_EXACT), - "create ap(amc)"); - - b = allocone(apamc, 1, MPS_RANK_EXACT); - - for (j=1; j<100; j++) { - comment("%i of 100.", j); - a = allocone(apamc, 5, MPS_RANK_EXACT); - b = a; - c = a; - d = a; - e = a; - f = a; - g = a; - - for (i=1; i<5000; i++) { - c = allocone(apamc, 20, MPS_RANK_EXACT); - d = allocone(apawl, 20, MPS_RANK_EXACT); - if (ranint(8) == 0) e = c; - if (ranint(8) == 0) f = c; - if (ranint(8) == 0) g = c; - setref(b, 0, c); - setref(c, 1, d); - setref(c, 2, e); - setref(c, 3, f); - setref(c, 4, g); - b = c; - } - } - - mps_ap_destroy(apawl); - mps_ap_destroy(apamc); - mps_pool_destroy(poolamc); - mps_pool_destroy(poolawl); - mps_chain_destroy(chain); - mps_fmt_destroy(format); - mps_root_destroy(root); - mps_root_destroy(root1); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/78.c b/mps/qa/function/78.c deleted file mode 100644 index 283267e1854..00000000000 --- a/mps/qa/function/78.c +++ /dev/null @@ -1,122 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!78.c(trunk.3) $ - summary = AMC and LO performance - language = c - link = testlib.o fastfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscawl.h" -#include "mpscamc.h" -#include "mpsclo.h" -#include "mpsavm.h" -#include "fastfmt.h" - - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - - -void *stackpointer; - - -static void test(void) -{ - mps_arena_t arena; - mps_pool_t poolamc, poolawl; - mps_thr_t thread; - mps_root_t root, root1; - - mps_fmt_t format; - mps_chain_t chain; - mps_ap_t apamc, apawl; - - mycell *a, *b, *c, *d, *e, *f, *g; - - int i; - int j; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), mmqaArenaSIZE), - "create arena"); - - die(mps_thread_reg(&thread, arena), "register thread"); - die(mps_root_create_reg(&root, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_root_create_table(&root1,arena,MPS_RANK_AMBIG,0,&exfmt_root,1), - "create table root"); - - die(mps_fmt_create_A(&format, arena, &fmtA), "create format"); - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - die(mmqa_pool_create_chain(&poolamc, arena, mps_class_amc(), format, chain), - "create pool(amc)"); - - cdie( - mps_pool_create(&poolawl, arena, mps_class_lo(), format), - "create pool"); - - cdie( - mps_ap_create(&apawl, poolawl, MPS_RANK_EXACT), - "create ap"); - - cdie( - mps_ap_create(&apamc, poolamc, MPS_RANK_EXACT), - "create ap(amc)"); - - b = allocone(apamc, 1, MPS_RANK_EXACT); - - for (j = 1; j < 100; j++) { - comment("%i of 100.", j); - a = allocone(apamc, 5, MPS_RANK_EXACT); - b = a; - c = a; - d = a; - e = a; - f = a; - g = a; - - for (i = 1; i < 5000; i++) { - c = allocone(apamc, 20, MPS_RANK_EXACT); - d = allocone(apawl, 20, MPS_RANK_EXACT); - if (ranint(8) == 0) e = c; - if (ranint(8) == 0) f = c; - if (ranint(8) == 0) g = c; - setref(b, 0, c); - setref(c, 1, d); - setref(c, 2, e); - setref(c, 3, f); - setref(c, 4, g); - b = c; - } - } - - mps_ap_destroy(apawl); - mps_ap_destroy(apamc); - mps_pool_destroy(poolamc); - mps_pool_destroy(poolawl); - mps_chain_destroy(chain); - mps_fmt_destroy(format); - mps_root_destroy(root); - mps_root_destroy(root1); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/79.c b/mps/qa/function/79.c deleted file mode 100644 index cfb20e591d0..00000000000 --- a/mps/qa/function/79.c +++ /dev/null @@ -1,119 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!79.c(trunk.3) $ - summary = AMC and AMC performance - language = c - link = testlib.o fastfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscawl.h" -#include "mpscamc.h" -#include "mpsclo.h" -#include "fastfmt.h" -#include "mpsavm.h" - - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - - -void *stackpointer; - - -static void test(void) -{ - mps_arena_t arena; - mps_pool_t poolamc, poolawl; - mps_thr_t thread; - mps_root_t root, root1; - - mps_fmt_t format; - mps_chain_t chain; - mps_ap_t apamc, apawl; - - mycell *a, *b, *c, *d, *e, *f, *g; - - int i; - int j; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), mmqaArenaSIZE), - "create arena"); - - die(mps_thread_reg(&thread, arena), "register thread"); - die(mps_root_create_reg(&root, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_root_create_table(&root1,arena,MPS_RANK_AMBIG,0,&exfmt_root,1), - "create table root"); - - die(mps_fmt_create_A(&format, arena, &fmtA), "create format"); - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - die(mmqa_pool_create_chain(&poolamc, arena, mps_class_amc(), format, chain), - "create pool"); - die(mmqa_pool_create_chain(&poolawl, arena, mps_class_amc(), format, chain), - "create pool"); - - cdie( - mps_ap_create(&apawl, poolawl, MPS_RANK_EXACT), - "create ap"); - cdie( - mps_ap_create(&apamc, poolamc, MPS_RANK_EXACT), - "create ap"); - - b = allocone(apamc, 1, MPS_RANK_EXACT); - - for (j = 1; j < 100; j++) { - comment("%i of 100.", j); - a = allocone(apamc, 5, MPS_RANK_EXACT); - b = a; - c = a; - d = a; - e = a; - f = a; - g = a; - - for (i = 1; i < 5000; i++) { - c = allocone(apamc, 20, MPS_RANK_EXACT); - d = allocone(apawl, 20, MPS_RANK_EXACT); - if (ranint(8) == 0) e = c; - if (ranint(8) == 0) f = c; - if (ranint(8) == 0) g = c; - setref(b, 0, c); - setref(c, 1, d); - setref(c, 2, e); - setref(c, 3, f); - setref(c, 4, g); - b = c; - } - } - - mps_ap_destroy(apawl); - mps_ap_destroy(apamc); - mps_pool_destroy(poolamc); - mps_pool_destroy(poolawl); - mps_chain_destroy(chain); - mps_fmt_destroy(format); - mps_root_destroy(root); - mps_root_destroy(root1); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/8.c b/mps/qa/function/8.c deleted file mode 100644 index 488fed5f2b9..00000000000 --- a/mps/qa/function/8.c +++ /dev/null @@ -1,65 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!8.c(trunk.4) $ - summary = create arenas until an error results, see if it leaks at failure - language = c - link = testlib.o -OUTPUT_SPEC - arena > 10 - arena_tight = 129 -END_HEADER -*/ - -#include "testlib.h" -#include "mpsavm.h" - - -#define minArenaSIZE ((size_t)(130 * 1024)) - - -static void test(void) -{ - mps_arena_t arena, previousArena = NULL; - mps_res_t res; - size_t size = (size_t)(1024*1024*10L); - int p = 0, i; - - /* make sure you can create at least 10 */ - while ((res = mps_arena_create(&arena, mps_arena_class_vm(), size)) - == MPS_RES_OK) { - p++; - report("arena", "%i", p); - } - asserts(res == MPS_RES_RESOURCE, "wrong error loop"); - /* fill address space with arenas */ - while (size > 2 * minArenaSIZE) { - size /= 2; - res = mps_arena_create(&arena, mps_arena_class_vm(), size); - asserts(res == MPS_RES_OK || res == MPS_RES_RESOURCE, "error fill"); - if (res == MPS_RES_OK) p++; - } - report("arena2", "%i", p); - report("size", "%i", size); - /* there could still be holes, fill some more */ - while ((res = mps_arena_create(&arena, mps_arena_class_vm(), minArenaSIZE)) - == MPS_RES_OK) { - p++; previousArena = arena; - } - mps_arena_destroy(previousArena); - report("arena3", "%i", p); - /* test that you can create and fail without leaking */ - for (i = 0; i < minArenaSIZE / 1024; ++i) { - res = mps_arena_create(&arena, mps_arena_class_vm(), (size_t)(1024*1024*10L)); - asserts(res == MPS_RES_RESOURCE, "error leak"); - die(mps_arena_create(&arena, mps_arena_class_vm(), minArenaSIZE), "leak"); - report("arena_tight", "%i", i); - mps_arena_destroy(arena); - } -} - - -int main(void) -{ - easy_tramp(test); - return 0; -} diff --git a/mps/qa/function/80.c b/mps/qa/function/80.c deleted file mode 100644 index b05415ed060..00000000000 --- a/mps/qa/function/80.c +++ /dev/null @@ -1,119 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!80.c(trunk.3) $ - summary = AMC and itself performance - language = c - link = testlib.o fastfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscawl.h" -#include "mpscamc.h" -#include "mpsclo.h" -#include "fastfmt.h" -#include "mpsavm.h" - - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - - -void *stackpointer; - - -static void test(void) -{ - mps_arena_t arena; - mps_pool_t poolamc, poolawl; - mps_thr_t thread; - mps_root_t root, root1; - - mps_fmt_t format; - mps_chain_t chain; - mps_ap_t apamc, apawl; - - mycell *a, *b, *c, *d, *e, *f, *g; - - int i; - int j; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), mmqaArenaSIZE), - "create arena"); - - die(mps_thread_reg(&thread, arena), "register thread"); - die(mps_root_create_reg(&root, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_root_create_table(&root1,arena,MPS_RANK_AMBIG,0,&exfmt_root,1), - "create table root"); - - die(mps_fmt_create_A(&format, arena, &fmtA), "create format"); - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - die(mmqa_pool_create_chain(&poolamc, arena, mps_class_amc(), format, chain), - "create pool"); - die(mmqa_pool_create_chain(&poolawl, arena, mps_class_amc(), format, chain), - "create pool"); - - cdie( - mps_ap_create(&apawl, poolawl, MPS_RANK_EXACT), - "create ap"); - cdie( - mps_ap_create(&apamc, poolamc, MPS_RANK_EXACT), - "create ap"); - - b = allocone(apamc, 1, MPS_RANK_EXACT); - - for (j = 1; j < 100; j++) { - comment("%i of 100.", j); - a = allocone(apamc, 5, MPS_RANK_EXACT); - b = a; - c = a; - d = a; - e = a; - f = a; - g = a; - - for (i = 1; i < 5000; i++) { - c = allocone(apamc, 20, MPS_RANK_EXACT); - d = allocone(apamc, 20, MPS_RANK_EXACT); - if (ranint(8) == 0) e = c; - if (ranint(8) == 0) f = c; - if (ranint(8) == 0) g = c; - setref(b, 0, c); - setref(c, 1, d); - setref(c, 2, e); - setref(c, 3, f); - setref(c, 4, g); - b = c; - } - } - - mps_ap_destroy(apawl); - mps_ap_destroy(apamc); - mps_pool_destroy(poolamc); - mps_pool_destroy(poolawl); - mps_chain_destroy(chain); - mps_fmt_destroy(format); - mps_root_destroy(root); - mps_root_destroy(root1); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/81.c b/mps/qa/function/81.c deleted file mode 100644 index 93d2e975870..00000000000 --- a/mps/qa/function/81.c +++ /dev/null @@ -1,101 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!81.c(trunk.4) $ - summary = run out of memory while collecting - language = c - link = testlib.o fastfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "mpsavm.h" -#include "rankfmt.h" - - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - - -void *stackpointer; - - -static void test(void) -{ - mps_arena_t arena; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root, root1; - - mps_fmt_t format; - mps_chain_t chain; - mps_ap_t ap; - - mycell *a, *b; - - int j; - - /* create an arena that can't grow beyond 15 Mb */ - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t)(1024*1024*15)), - "create arena"); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie(mps_root_create_reg(&root, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie(mps_root_create_table(&root1, arena, MPS_RANK_AMBIG, 0, - (mps_addr_t*)&exfmt_root, 1), - "create table root"); - - cdie(mps_fmt_create_A(&format, arena, &fmtA), - "create format"); - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - die(mmqa_pool_create_chain(&pool, arena, mps_class_amc(), format, chain), - "create pool"); - - cdie(mps_ap_create(&ap, pool, MPS_RANK_EXACT), - "create ap"); - - b = allocone(ap, 100, MPS_RANK_EXACT); - - /* allocate at least 100 * 10K = 10M */ - - for (j = 0; j < 100; j++) { - comment("%i of 100.", j); - a = allocone(ap, 2, MPS_RANK_EXACT); - setref(a, 0, b); - b = a; - a = allocdumb(ap, (size_t) (1024*100), MPS_RANK_EXACT); - setref(b, 1, a); - } - - /* now collect world. There's isn't enough space to copy everything! */ - - mps_arena_collect(arena); - - mps_ap_destroy(ap); - mps_pool_destroy(pool); - mps_chain_destroy(chain); - mps_fmt_destroy(format); - mps_root_destroy(root); - mps_root_destroy(root1); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/82.c b/mps/qa/function/82.c deleted file mode 100644 index 87b4edf39e3..00000000000 --- a/mps/qa/function/82.c +++ /dev/null @@ -1,140 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = EPVM save, alloc, restore in two pools - language = c - link = testlib.o epvmfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscepvm.h" -#include "mpsavm.h" -#include "epvmfmt.h" - -#define MAX_SAVE 20 -#define INIT_SAVE 3 - -void *stackpointer; - -static void test(void) -{ - mps_arena_t arena; - mps_pool_t pool1, pool2; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_ap_t ap1p, ap1s, ap2p, ap2s; - - psobj *a; - - int i, j; - - mps_epvm_save_level_t lev1, lev2; - -/* create an arena that can't grow beyond 64M */ - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t) (1024*1024*64)), - "create arena"); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie(mps_root_create_reg(&root, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie(mps_fmt_create_A(&format, arena, &fmtepvm), "create format"); - - cdie(mps_pool_create(&pool1, arena, mps_class_epvm(), - format, MAX_SAVE, INIT_SAVE), "create pool1"); - - cdie(mps_pool_create(&pool2, arena, mps_class_epvm(), - format, MAX_SAVE, INIT_SAVE), "create pool2"); - - cdie(mps_ap_create(&ap1p, pool1, 1), "create ap1p"); - cdie(mps_ap_create(&ap1s, pool1, 0), "create ap1s"); - cdie(mps_ap_create(&ap2p, pool2, 1), "create ap2p"); - cdie(mps_ap_create(&ap2s, pool2, 0), "create ap2s"); - - lev1 = INIT_SAVE; - lev2 = INIT_SAVE; - - for (i=0; i<100000; i++) { - if (i % 1000 ==0) { - comment("---------------------- Restore to zero."); - lev1 = 0; - mps_epvm_restore(pool1, lev1); - lev1++; - mps_epvm_save(pool1); - lev2 = 0; - mps_epvm_restore(pool2, lev2); - lev2++; - mps_epvm_save(pool2); - } - j = ranint(40); - switch (j) { - case 1: - if (lev1==1) break; - lev1--; - comment("Restore 1: %i", lev1); - while (ranint(2) && (lev1>1)) lev1--; - mps_epvm_restore(pool1, lev1); - break; - case 2: - if (lev2==1) break; - lev2--; - while (ranint(2) && (lev2>1)) lev2--; - comment("Restore 2: %i", lev2); - mps_epvm_restore(pool2, lev2); - break; - case 3: - case 4: - if (lev11)) lev1--; - mps_epvm_restore(pool1, lev1); - break; - case 2: - break; - case 3: - case 4: - if (lev1 0) { - lev1--; - mps_epvm_restore(pool1, lev1); - } - mps_epvm_save(pool1); - lev1++; - } - j = ranint(40); - switch (j) { - case 1: - if (lev1==1) break; - lev1--; - mps_epvm_restore(pool1, lev1); - comment("Restore to %i", lev1); - while (ranint(2) && (lev1>1)) { - lev1--; - mps_epvm_restore(pool1, lev1); - } - break; - case 2: - break; - case 3: - case 4: - if (lev10)) lev1--; - mps_epvm_restore(pool1, lev1); - break; - case 2: - if (lev2==0) break; - lev2--; - while (ranint(2) && (lev2>0)) lev2--; - comment("Restore 2: %i", lev2); - mps_epvm_restore(pool2, lev2); - break; - case 3: - case 4: - if (lev1 i) { - comment("free %i", j); - sizes[j] = (size_t) 0; - } - } -} - - -static void mycheck(psobj *addr, size_t size) { - int i; - unsigned long ob, om, pb, pm; - - pb = (unsigned long) addr; - pm = pb+size; - - for (i=0; i= pm, - "overlapping objects: %p, %p", addr, addrs[i]); - } - } -} - - -static void myalloc(int i) { - size_t s; - psobj *a; - - s = 8 * (ranint(50)+1); - a = allocepvm(ap1s, s); - - comment("alloc %i at %p level %i", i, a, lev1); - - mycheck(a, s); - - addrs[i] = a; - sizes[i] = s; - levels[i] = lev1; -} - - -static void mysave(void) { - if (lev1 < MAX_SAVE) { - lev1++; - comment("save to %i", lev1); - mps_epvm_save(pool1); - } -} - -static int myfindblank(int *ii) { - int j; - - for (j=0; j0 && ranint(100)!=0) { - lev1--; - } - myrestore(lev1); - if (lev1 == 0) { - mysave(); - } - } - if (ranint(100)<20) { - mysave(); - } - } - - mps_ap_destroy(ap1s); - mps_pool_destroy(pool1); - mps_fmt_destroy(format); - mps_root_destroy(root); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena"); - -} - - -int main(void) { - void *m; - stackpointer=&m; - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/88.c b/mps/qa/function/88.c deleted file mode 100644 index 8e43a308d8d..00000000000 --- a/mps/qa/function/88.c +++ /dev/null @@ -1,85 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!88.c(trunk.2) $ - summary = EPVM allocate and collect_world - language = c - link = testlib.o epvmfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscepvm.h" -#include "mpsavm.h" -#include "epvmfmt.h" - -#define MAX_SAVE 32 -#define INIT_SAVE 0 - -void *stackpointer; - -psobj *a[100]; - -static void test(void) -{ - mps_arena_t arena; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - - mps_pool_t pool1; - mps_epvm_save_level_t lev1; - mps_ap_t ap1s; - - int i, j; - - alloccomments = 1; - - /* create an arena that can't grow beyond 64M */ - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t) (1024*1024*64)), - "create arena"); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie(mps_root_create_table(&root, arena, MPS_RANK_AMBIG, 0, - (mps_addr_t *)&a[0], 100), - "create root"); - - cdie(mps_fmt_create_A(&format, arena, &fmtepvm), "create format"); - - cdie(mps_pool_create(&pool1, arena, mps_class_epvm(), - format, MAX_SAVE, INIT_SAVE), "create pool1"); - - cdie(mps_ap_create(&ap1s, pool1, 0), "create ap1s"); - - lev1 = INIT_SAVE; - - for (i=0; i<10; i++) { - for (j=0; j<10000; j++) { - a[ranint(100)] = allocepvm(ap1s, (size_t) (8+8*ranint(16))); - } - mps_arena_collect(arena); - comment("collected %i", i); - } - - mps_ap_destroy(ap1s); - mps_pool_destroy(pool1); - mps_fmt_destroy(format); - mps_root_destroy(root); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena"); - -} - - -int main(void) { - void *m; - stackpointer=&m; - - easy_tramp(test); - pass(); - return 0; -} - diff --git a/mps/qa/function/89.c b/mps/qa/function/89.c deleted file mode 100644 index 00d41edd6bb..00000000000 --- a/mps/qa/function/89.c +++ /dev/null @@ -1,79 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = EPVM allocate and epvm_collect - language = c - link = testlib.o epvmfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscepvm.h" -#include "mpsavm.h" -#include "epvmfmt.h" - -#define MAX_SAVE 1000 -#define INIT_SAVE 12 - -void *stackpointer; - -static void test(void) -{ - mps_arena_t arena; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - - mps_pool_t pool1; - mps_epvm_save_level_t lev1; - mps_ap_t ap1s; - - int i, j; - - psobj *a; - -/* create an arena that can't grow beyond 64M */ - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t) (1024*1024*64)), - "create arena"); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie(mps_fmt_create_A(&format, arena, &fmtepvm), "create format"); - - cdie(mps_pool_create(&pool1, arena, mps_class_epvm(), - format, MAX_SAVE, INIT_SAVE), "create pool1"); - - cdie(mps_ap_create(&ap1s, pool1, 0), "create ap1s"); - - lev1 = INIT_SAVE; - - for (i=0; i<50; i++) { - for (j=0; j<3000; j++) { - a = allocepvm(ap1s, (size_t) (8+8*ranint(500))); - } - comment("collecting..."); - mps_epvm_collect(pool1); - } - - mps_ap_destroy(ap1s); - mps_pool_destroy(pool1); - mps_fmt_destroy(format); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena"); - -} - -int main(void) { - void *m; - stackpointer=&m; - - easy_tramp(test); - pass(); - return 0; -} - - - diff --git a/mps/qa/function/9.c b/mps/qa/function/9.c deleted file mode 100644 index 6c0eb6547bb..00000000000 --- a/mps/qa/function/9.c +++ /dev/null @@ -1,80 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!9.c(trunk.4) $ - summary = (regression test) Allocate a big object (>64M, perhaps up to 1G) in an AMC pool - language = c - link = testlib.o newfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "mpsavm.h" -#include "newfmt.h" - - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - - -void *stackpointer; - - -static void test(void) -{ - mps_arena_t arena; - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - mps_chain_t chain; - mps_ap_t ap; - - mycell *a; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), mmqaArenaSIZE), - "create arena"); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - cdie( - mps_root_create_reg(&root, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_fmt_create_A(&format, arena, &fmtA), - "create format"); - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - cdie(mmqa_pool_create_chain(&pool, arena, mps_class_amc(), format, chain), - "create pool"); - - cdie( - mps_ap_create(&ap, pool, MPS_RANK_EXACT), - "create ap"); - - a = allocdumb(ap, 1024*1024*80); - - mps_ap_destroy(ap); - mps_pool_destroy(pool); - mps_chain_destroy(chain); - mps_fmt_destroy(format); - mps_root_destroy(root); - mps_thread_dereg(thread); - mps_arena_destroy(arena); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} - diff --git a/mps/qa/function/90.c b/mps/qa/function/90.c deleted file mode 100644 index ab95aeb0abd..00000000000 --- a/mps/qa/function/90.c +++ /dev/null @@ -1,120 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!90.c(trunk.2) $ - summary = various EPVM functional tests - language = c - link = testlib.o epvmfmt.o -END_HEADER -*/ - -/* This test used to use ambiguous roots, but then EPVM was changed - so as not to "support" them. -*/ - -#include "testlib.h" -#include "mpscepvm.h" -#include "mpsavm.h" -#include "epvmfmt.h" - -#define MAX_SAVE 32 -#define INIT_SAVE 4 - -#define RT_SIZE 1000 - -void *stackpointer; - -static void test(void) -{ - mps_arena_t arena; - mps_thr_t thread; - mps_root_t root; - - mps_fmt_t format; - - mps_pool_t pool1; - mps_ap_t ap1s, ap1p; - - unsigned int i, j, k; - - psobj *a[RT_SIZE], *b; - -/* create an arena that can't grow beyond 64M */ - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t) (1024*1024*64)), - "create arena"); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie(mps_root_create_table(&root, arena, MPS_RANK_EXACT, 0, &a[0], RT_SIZE), - "create root"); - - cdie(mps_fmt_create_A(&format, arena, &fmtepvm), "create format"); - - cdie(mps_pool_create(&pool1, arena, mps_class_epvm(), - format, MAX_SAVE, INIT_SAVE), "create pool1"); - - cdie(mps_ap_create(&ap1s, pool1, 0), "create ap1s"); - - cdie(mps_ap_create(&ap1p, pool1, 1), "create ap1p"); - - asserts(sizeof(unsigned char) == 1, "surprise! -- characters too big!"); - - for (k=0; k<20; k++) { - comment("%i of 20", k); - - comment("allocate string objects of various sizes"); - - for (i=0; i<256; i++) { - a[i] = allocepvm(ap1s, (size_t) (8+8*i)); - for (j=0; j<(8+i*8); j++) { - *((unsigned char *) a[i]+j) = i; - } - } - - comment("allocate psobjects pointing to strings"); - - for (i=0; i<256; i++) { - b = allocepvm(ap1p, (size_t) 8); - b->obj = a[i]; - b->size = i+1; - a[i] = b; - } - - comment("collect"); - - mps_epvm_collect(pool1); - - comment("check objects are ok"); - - for (i=0; i<256; i++) { - b = a[i]->obj; - asserts(a[i]->size == i+1, "object %i wrong size", i); - for (j=0; j<(8+i*8); j++) { - asserts(*((unsigned char *) b+j) == i, "object %i corrupt at %i", i, j); - } - } - comment("finished"); - } - - mps_ap_destroy(ap1s); - mps_ap_destroy(ap1p); - mps_pool_destroy(pool1); - mps_fmt_destroy(format); - mps_root_destroy(root); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena"); - -} - -int main(void) { - void *m; - stackpointer=&m; - - easy_tramp(test); - pass(); - return 0; -} - - - diff --git a/mps/qa/function/91.c b/mps/qa/function/91.c deleted file mode 100644 index c02bbca4d78..00000000000 --- a/mps/qa/function/91.c +++ /dev/null @@ -1,90 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!91.c(trunk.3) $ - summary = EPVM time allocations - language = c - link = testlib.o epvmfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscepvm.h" -#include "mpsavm.h" -#include "epvmfmt.h" -#include - -#define MAX_SAVE 1 -#define INIT_SAVE 0 - -void *stackpointer; - - -static void timealloc(mps_pool_t pool, mps_ap_t ap, size_t size, - int num, int step) { - int i, j; - clock_t t0, t1; - int secs; - psobj *a; - - mps_epvm_save(pool); - t0 = clock(); - for (j=0; j - -#define MAX_SAVE 1 -#define INIT_SAVE 0 - -void *stackpointer; - -mps_word_t CheckLevel; - -#define CheckNONE 0 -#define CheckSHALLOW 1 -#define CheckDEEP 2 - -static void timealloc(mps_pool_t pool, mps_ap_t ap, size_t size, int num, int step) { - int i, j; - clock_t t0, t1; - int secs; - psobj *a; - - mps_epvm_save(pool); - t0 = clock(); - for (j=0; j - -#define MAX_SAVE 1 -#define INIT_SAVE 0 - -void *stackpointer; - - -static void timealloc(mps_pool_t pool, mps_ap_t ap, size_t size, - int num, int step) { - int i, j; - clock_t t0, t1; - int secs; - psobj *a; - - mps_epvm_save(pool); - t0 = clock(); - for (j=0; j - -#define MAX_SAVE 1 -#define INIT_SAVE 0 - -void *stackpointer; - -static void timealloc(mps_pool_t pool, mps_ap_t ap, size_t min, size_t max, size_t total) { - int i, j; - clock_t t0, t1; - int secs; - size_t size; - psobj *a; - - mps_epvm_save(pool); - t0 = clock(); - while (total>0) { - size = ranrange(min, max+1); - if (size > total) { - size = total; - } - a = allocepvm(ap, size); - total-=size; - } - t1 = clock(); - secs = 100*(t1-t0)/CLOCKS_PER_SEC; - comment("%i, %i, %i", total*8, (max+1)*4, secs); - mps_epvm_restore(pool, 0); - -}; - -static void test(void) -{ - mps_arena_t arena; - mps_thr_t thread; - mps_fmt_t format; - mps_pool_t pool1; - mps_ap_t ap1s; - - size_t size; - size_t avgsize; - - asserts(clock() != -1, "processor time not available"); - -/* create an arena that can't grow beyond 64M */ - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t) (1024*1024*64)), - "create arena"); - - cdie(mps_thread_reg(&thread, arena), "register thread"); - - cdie(mps_fmt_create_A(&format, arena, &fmtepvm), "create format"); - - cdie(mps_pool_create(&pool1, arena, mps_class_epvm(), - format, MAX_SAVE, INIT_SAVE), "create pool1"); - - cdie(mps_ap_create(&ap1s, pool1, 0), "create ap1s"); - - size = 1024ul*1024ul*10ul/8; /* 10 Megabytes */ - - for (avgsize=1; avgsize<128; avgsize+=1) { - timealloc(pool1, ap1s, 1, 2*avgsize-1, size); - } - - mps_ap_destroy(ap1s); - mps_pool_destroy(pool1); - mps_fmt_destroy(format); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena"); - -} - -int main(void) { - void *m; - stackpointer=&m; - - easy_tramp(test); - pass(); - return 0; -} - - - diff --git a/mps/qa/function/96.c b/mps/qa/function/96.c deleted file mode 100644 index 5f1d4aa29d7..00000000000 --- a/mps/qa/function/96.c +++ /dev/null @@ -1,148 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!96.c(trunk.5) $ - summary = low memory tests with AMC (and using MV) - language = c - link = testlib.o rankfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "mpscmv.h" -#include "mpsavm.h" -#include "rankfmt.h" - - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - - -void *stackpointer; - -mps_pool_t poolmv; -mps_arena_t arena; - - -static void fillup(void) -{ - size_t size; - mps_addr_t a; - char *b; - - mps_pool_create(&poolmv, arena, mps_class_mv(), 64, 64, 64); - size=1024ul*1024ul; - while (size) { - while (mps_alloc(&a, poolmv, size)==MPS_RES_OK) { - for(b=a; b<(char *)a+size; b++) { - *b = 97; - } - } - size = size / 2; - } -} - - -static void empty(void) -{ - mps_pool_destroy(poolmv); -} - - -static void test(void) -{ - mps_pool_t pool; - mps_thr_t thread; - mps_root_t root, root1; - - mps_fmt_t format; - mps_chain_t chain; - mps_ap_t ap; - - mycell *a, *b; - - mps_res_t res; - int j; - - /* create an arena that can't grow beyond 30 M */ - cdie(mps_arena_create(&arena, mps_arena_class_vm(), (size_t) (1024*1024*30)), - "create arena"); - die(mps_arena_commit_limit_set(arena, (size_t) (1024*1024*30)), "limit"); - - die(mps_thread_reg(&thread, arena), "register thread"); - - die(mps_root_create_reg(&root, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_root_create_table(&root1,arena,MPS_RANK_AMBIG,0,&exfmt_root,1), - "create table root"); - - cdie(mps_fmt_create_A(&format, arena, &fmtA), "create format"); - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - die(mmqa_pool_create_chain(&pool, arena, mps_class_amc(), format, chain), - "create pool"); - - cdie( - mps_ap_create(&ap, pool, MPS_RANK_EXACT), - "create ap"); - - /* allocate 16 M of (live) stuff */ - - b = allocone(ap, 2, MPS_RANK_EXACT); - for (j=0; j<160; j++) { - a = allocone(ap, 2, MPS_RANK_EXACT); - setref(a, 0, b); - b = allocdumb(ap, 1024*100, MPS_RANK_EXACT); - setref(a, 1, b); - b = a; - } - - comment("created 16M of live objects"); - - fillup(); - - comment("try to make collect by allocating another 1G..."); - - empty(); - - for (j=0; j<1000*1024; j++) { - res=allocrdumb(&a, ap, 1024, MPS_RANK_EXACT); - if (res == MPS_RES_OK) { - comment("%i ok", j); - } else { - break; - } - } - - comment("collect world..."); - - for (j=0; j<10; j++) { - mps_arena_collect(arena); - } - - mps_ap_destroy(ap); - mps_pool_destroy(pool); - mps_chain_destroy(chain); - mps_fmt_destroy(format); - mps_root_destroy(root); - mps_root_destroy(root1); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/97.c b/mps/qa/function/97.c deleted file mode 100644 index b706f869877..00000000000 --- a/mps/qa/function/97.c +++ /dev/null @@ -1,249 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!97.c(trunk.6) $ - summary = test of mps_arena_formatted_objects_walk - language = c - link = testlib.o rankfmt.o -END_HEADER - - some kinds of errors that could occur in the walker: - - I. miss out a reachable object - II. miss out an unreachable object - III. extra walk over a reachable object - IV. extra walk over an unreachable object - V. step on something which isn't a valid object (or pad) - VI. assertion failure in the mps - VII. might not pass parameters correctly - - II is very hard to detect. The others we can catch with assertions, by - repeatedly tracing the graph ourselves, time-stamping objects, and then - calling the walker and time-stamping them again. Objects found with - out-of-date timestamps must have been missed on the previous trace/walk. - So when the walker finds an object not found on a previous trace, that's - an unreachable object; when it finds an object it's already found that's - III or IV. When the tracer finds an object with an out-of-date timestamp, - the walker must have missed it -- that's I. -*/ - -#include "testlib.h" -#include "mpscamc.h" -#include "mpscawl.h" -#include "mpsclo.h" -#include "rankfmt.h" - -#define MAGICSIZE (342) -#define MAGICPOINT ((mycell *) 214208) - -void *stackpointer; -long int appcount; -long int apppadcount; - -int oldstamp, newstamp; - -mps_space_t space; -mps_pool_t poolamc, poollo, poolawl; -mps_thr_t thread; -mps_root_t root, root1; - -mps_fmt_t format; -mps_ap_t apamc, aplo, apawl; - - -static void tracegraph(mycell *obj) -{ - int i; - - if (obj == NULL) { - return; - } - - asserts((obj->tag & 3) == MCdata, "odd check at %p (%p)", obj, obj->tag); - - if (obj->data.checkedflag == oldstamp) { - obj->data.checkedflag = newstamp; - if (obj->data.assoc != NULL) { - tracegraph(obj->data.assoc); - } - for (i=0; i<(obj->data.numrefs); i++) { - if (obj->data.ref[i].addr != NULL) { - tracegraph(obj->data.ref[i].addr); - } - } - } else { - asserts(obj->data.checkedflag == newstamp, - "I. trace on old object at %p", obj); - } -} - - -static void stepper(mps_addr_t addr, mps_fmt_t fmt, mps_pool_t pool, - void *V, size_t S) -{ - mycell *a; - - asserts((mycell *) V == MAGICPOINT, "VII. Void * didn't get passed!"); - asserts(S == MAGICSIZE, "VII. Size didn't get passed!"); - asserts(fmt == format, "VII. Format didn't get passed!"); - a = addr; - asserts(((a->tag) & 0x3) == MCdata || ((a->tag) & 0x3) == MCpad, - "V. step onto bad object at %p", addr); - if (((a->tag) & 0x3) == MCdata) { - appcount += 1; - asserts(a->data.checkedflag != newstamp, - "III/IV. step on object again at %p", a); - commentif(a->data.checkedflag != oldstamp, - "*. step on unreachable object at %p", a); - a->data.checkedflag = newstamp; - } else { - apppadcount +=1; - } -} - -static void test(void) -{ -/* a is a table of exact roots - b a table of ambiguous roots - f a table of non-roots -*/ - - mycell *a[4], *b[4], *f[4]; - mps_addr_t addr; - int i, j, k; - - cdie(mps_space_create(&space), "create space"); - - cdie(mps_thread_reg(&thread, space), "register thread"); - - addr = &a[0]; - cdie( - mps_root_create_table(&root, space, MPS_RANK_EXACT, 0, addr, 4), - "create a root table"); - - addr = &b[0]; - cdie( - mps_root_create_table(&root1, space, MPS_RANK_AMBIG, 0, addr, 4), - "create b root table"); - - cdie( - mps_fmt_create_A(&format, space, &fmtA), - "create format"); - - cdie( - mps_pool_create(&poolamc, space, mps_class_amc(), format), - "create pool"); - - cdie( - mps_pool_create(&poollo, space, mps_class_lo(), format), - "create pool"); - - cdie( - mps_pool_create(&poolawl, space, mps_class_awl(), format), - "create pool"); - - cdie( - mps_ap_create(&apamc, poolamc, MPS_RANK_EXACT), - "create ap"); - - cdie( - mps_ap_create(&aplo, poollo, MPS_RANK_EXACT), - "create ap"); - - cdie( - mps_ap_create(&apawl, poolawl, MPS_RANK_EXACT), - "create ap"); - - newstamp = 0; - - for (i=0; i<4; i++) { - addr = &a[i]; - die(allocrdumb(addr, aplo, 64, MPS_RANK_EXACT), "alloc failed"); - addr = &b[i]; - die(allocrone(addr, apawl, 5, MPS_RANK_EXACT), "alloc failed"); - b[i]->data.ref[0].addr = a[i]; - addr = &a[i]; - die(allocrone(addr, apamc, 5, MPS_RANK_EXACT), "alloc failed"); - a[i]->data.ref[0].addr = b[i]; - } - - - for (j=0; j<100; j++) { - - comment("%i of 100", j); - - for (i=0; i<10000; i++) { - k = ranint(4); - addr = &a[k]; - die(allocrdumb(addr, aplo, 64, MPS_RANK_EXACT), "alloc failed"); - k = ranint(4); - addr = &b[k]; - die(allocrone(addr, apawl, 5, MPS_RANK_EXACT), "alloc failed"); - b[k]->data.ref[0].addr = a[ranint(4)]; - b[k]->data.ref[1].addr = b[ranint(4)]; - addr = &a[k]; - die(allocrone(addr, apamc, 5, MPS_RANK_EXACT), "alloc failed"); - f[k] = a[k]->data.ref[2].addr; - a[k]->data.ref[2].addr = b[ranint(4)]; - } - - comment("walking..."); - - mps_arena_park(space); - mps_arena_collect(space); - - oldstamp = newstamp; - newstamp += 1; - mps_arena_formatted_objects_walk(space, stepper, - (void *) MAGICPOINT, MAGICSIZE); - mps_arena_release(space); - - comment("tracing..."); - - oldstamp = newstamp; - newstamp += 1; - tracegraph((mycell *) exfmt_root); - tracegraph(a[0]); - tracegraph(a[1]); - tracegraph(a[2]); - tracegraph(a[3]); - tracegraph(b[0]); - tracegraph(b[1]); - tracegraph(b[2]); - tracegraph(b[3]); - - comment("ok"); - } - - mps_ap_destroy(apamc); - mps_ap_destroy(aplo); - mps_ap_destroy(apawl); - comment("Destroyed aps."); - - mps_pool_destroy(poolamc); - mps_pool_destroy(poollo); - mps_pool_destroy(poolawl); - comment("Destroyed pools."); - - mps_fmt_destroy(format); - comment("Destroyed format."); - - mps_root_destroy(root); - mps_root_destroy(root1); - comment("Destroyed roots."); - - mps_thread_dereg(thread); - comment("Deregistered thread."); - - mps_space_destroy(space); - comment("Destroyed space."); -} - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/function/98.c b/mps/qa/function/98.c deleted file mode 100644 index b3a25387213..00000000000 --- a/mps/qa/function/98.c +++ /dev/null @@ -1,35 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = create arenas at once until an error results! - language = c - link = testlib.o -OUTPUT_SPEC - space > 10 -END_HEADER -*/ - -#include "testlib.h" -#include "mpsavm.h" - -static void test(void) -{ - mps_space_t space; - - int p; - - p=0; - - while (1) - { - die(mps_arena_create(&space, mps_arena_class_vm(), (size_t) (1024*1024*10)), "create"); - p = p+1; - report("space", "%i", p); - } -} - -int main(void) -{ - easy_tramp(test); - return 0; -} diff --git a/mps/qa/function/99.c b/mps/qa/function/99.c deleted file mode 100644 index 215ed189b3f..00000000000 --- a/mps/qa/function/99.c +++ /dev/null @@ -1,119 +0,0 @@ -/* -TEST_HEADER - id = $HopeName: MMQA_test_function!99.c(trunk.2) $ - summary = AMC and AMCZ performance - language = c - link = testlib.o fastfmt.o -END_HEADER -*/ - -#include "testlib.h" -#include "mpscawl.h" -#include "mpscamc.h" -#include "fastfmt.h" -#include "mpsavm.h" - - -#define genCOUNT (3) - -static mps_gen_param_s testChain[genCOUNT] = { - { 6000, 0.90 }, { 8000, 0.65 }, { 16000, 0.50 } }; - - -void *stackpointer; - - -static void test(void) -{ - mps_arena_t arena; - mps_pool_t poolamc, poolamcz; - mps_thr_t thread; - mps_root_t root, root1; - - mps_fmt_t format; - mps_chain_t chain; - mps_ap_t apamc, apamcz; - - mycell *a, *b, *c, *d, *e, *f, *g; - - int i; - int j; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), mmqaArenaSIZE), - "create arena"); - - die(mps_thread_reg(&thread, arena), "register thread"); - die(mps_root_create_reg(&root, arena, MPS_RANK_AMBIG, 0, thread, - mps_stack_scan_ambig, stackpointer, 0), - "create root"); - - cdie( - mps_root_create_table(&root1,arena,MPS_RANK_AMBIG,0,&exfmt_root,1), - "create table root"); - - die(mps_fmt_create_A(&format, arena, &fmtA), "create format"); - cdie(mps_chain_create(&chain, arena, genCOUNT, testChain), "chain_create"); - - die(mmqa_pool_create_chain(&poolamc, arena, mps_class_amc(), format, chain), - "create pool"); - die(mmqa_pool_create_chain(&poolamcz, arena, mps_class_amc(), format, chain), - "create pool"); - - cdie( - mps_ap_create(&apamcz, poolamcz, MPS_RANK_EXACT), - "create ap"); - - cdie( - mps_ap_create(&apamc, poolamc, MPS_RANK_EXACT), - "create ap"); - - b = allocone(apamc, 1, MPS_RANK_EXACT); - - for (j =1 ; j < 100; j++) { - comment("%i of 100.", j); - a = allocone(apamc, 5, MPS_RANK_EXACT); - b = a; - c = a; - d = a; - e = a; - f = a; - g = a; - - for (i = 1; i < 5000; i++) { - c = allocone(apamc, 20, MPS_RANK_EXACT); - d = allocone(apamcz, 20, MPS_RANK_EXACT); - if (ranint(8) == 0) e = c; - if (ranint(8) == 0) f = c; - if (ranint(8) == 0) g = c; - setref(b, 0, c); - setref(c, 1, d); - setref(c, 2, e); - setref(c, 3, f); - setref(c, 4, g); - b = c; - } - } - - mps_ap_destroy(apamcz); - mps_ap_destroy(apamc); - mps_pool_destroy(poolamc); - mps_pool_destroy(poolamcz); - mps_chain_destroy(chain); - mps_fmt_destroy(format); - mps_root_destroy(root); - mps_root_destroy(root1); - mps_thread_dereg(thread); - mps_arena_destroy(arena); - comment("Destroyed arena."); -} - - -int main(void) -{ - void *m; - stackpointer=&m; /* hack to get stack pointer */ - - easy_tramp(test); - pass(); - return 0; -} diff --git a/mps/qa/misc/0.c b/mps/qa/misc/0.c deleted file mode 100644 index c3abc812bfa..00000000000 --- a/mps/qa/misc/0.c +++ /dev/null @@ -1,36 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = cause segv and see if has usual effect - language = c - link = testlib.o -OUTPUT_SPEC - memoryerror = true -END_HEADER -*/ - -#include "mps.h" -#include "testlib.h" - -void *stackpointer; - -static void test(void) -{ - mps_space_t space; - int *p; - - cdie(mps_space_create(&space), "create space"); - - p = NULL; - printf("%i", *p); -} - -int main(void) -{ - void *m; - stackpointer=&m; - - easy_tramp(test); - return 0; -} - diff --git a/mps/qa/misc/1.c b/mps/qa/misc/1.c deleted file mode 100644 index c92f5fb2af8..00000000000 --- a/mps/qa/misc/1.c +++ /dev/null @@ -1,38 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = access location in last 4 bytes of address space. - language = c - link = testlib.o -OUTPUT_SPEC - memoryerror = true -END_HEADER -*/ - -#include "testlib.h" -#include "mpsavm.h" - -void *stackpointer; - - -static void test(void) -{ - mps_arena_t arena; - int *p; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), 64*1024uL*1024uL), - "create arena"); - - p = (int *)-4; - putchar(*p); -} - -int main(void) -{ - void *m; - stackpointer=&m; - - easy_tramp(test); - return 0; -} - diff --git a/mps/qa/misc/2.c b/mps/qa/misc/2.c deleted file mode 100644 index 46231ba49bd..00000000000 --- a/mps/qa/misc/2.c +++ /dev/null @@ -1,40 +0,0 @@ -/* -TEST_HEADER - id = $HopeName$ - summary = access negative location. - language = c - link = testlib.o - parameters = NUM=1 -OUTPUT_SPEC - memoryerror = true -END_HEADER -*/ - -#include "testlib.h" -#include "mpsavm.h" - -void *stackpointer; - - -static void test(void) -{ - mps_arena_t arena; - char *p; - - cdie(mps_arena_create(&arena, mps_arena_class_vm(), 64*1024uL*1024uL), - "create arena"); - - p = (char *)-NUM; - *p = 0; - comment("%p", *p); -} - -int main(void) -{ - void *m; - stackpointer=&m; - - easy_tramp(test); - return 0; -} - diff --git a/mps/qa/test/README b/mps/qa/test/README deleted file mode 100644 index e7918b73c8b..00000000000 --- a/mps/qa/test/README +++ /dev/null @@ -1,10 +0,0 @@ -$HopeName: MMQA_harness!README(trunk.8) $ - -This is the Memory Management QA test harness. To use it you need -perl 5 (or higher). Go "perl qa help" for help, "perl qa options" -to see what version of the harness you have (or look at the -file "test/version"). - -Some brief instructions are in guide.mm-qa in MM Information; ask - (ext 3822) if you need help, want to complain, &c. - diff --git a/mps/qa/test/qa b/mps/qa/test/qa deleted file mode 100644 index 4438f6679ef..00000000000 --- a/mps/qa/test/qa +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/local/bin/perl -w -# $HopeName: MMQA_harness!qa(trunk.9) $ -# -# First, we'll set up @INC so we can find the other -# perl scripts we require. This program will be in the -# test directory, and all the other scripts will be -# in the script subdirectory. -# -# $0 contains the name of this program, as it was run -# this means it may not be the full path, but should be -# enough of the path for us to use it to locate other -# perl scripts. -# We assume the separator is / and the program name is -# made only of A-Za-z0-9 and _. - -if ($] < 5) { - die "The QA harness requires perl 5 or greater (this is version $]).\n"; -} - -$test_dir = $0; - -$0 = "mmqa harness"; # this will show up in ps - -$test_dir =~ s/\\/\//g; # i.e. convert to unix-style separators - -unless ($test_dir =~ m/\//) { - $test_dir = "./".$test_dir; -} # ensure it has at least one / in it - -$test_dir =~ s/\/\w+$//; # remove leaf name and preceding separator - -$script_dir = $test_dir."/script"; - -foreach (@INC) { - if ($_ ne '.') { push(@newINC, $_) } -} -push(@newINC, $script_dir); -@INC = @newINC; - -# other directories will be set when needed by requiring -# the 'dirs' file. This must be done after reading command-line -# options, so we don't try it now - - -$| = 1; - - -# what we do is -# (1) load in the harness, via require -# (2) init, inc reading command line options -# (3) run command -# -# Policy on options is: which options are meaningful and which are -# required may be command dependent, _but_ what options exist -# and what switches correspond to them is not. -# - -require "require"; - -&harness_init; - -# n.b. the above will alter @ARGV as it reads command-line options -# - -$qa_command = shift(@ARGV); - -unless ($qa_command) { - die "You must specify a command -- try 'qa help' for details.\n"; -} -unless (-e "$script_dir/commands/".$qa_command) { - die "Unknown command '".$qa_command."' -- 'qa help' for info.\n"; -} - -do "commands/".$qa_command; -if ($@) {print $@}; - diff --git a/mps/qa/test/script/clib b/mps/qa/test/script/clib deleted file mode 100644 index c8e1ecb021d..00000000000 --- a/mps/qa/test/script/clib +++ /dev/null @@ -1,384 +0,0 @@ -#!/usr/local/perl -# $HopeName: MMQA_harness!script:clib(trunk.6) $ -# -# subroutines to compile test libraries, and check whether they -# need to be compiled -# - -1; - -sub clib { - my $success = 1; - my $tlfile; - my $tlobj; - - &objpurge(); - &scrutinize(); - &logcomment("Compiling test libraries."); - - open(MANIFEST, "$testlib_dir/manifest"); - - while (defined($tlfile = )) { - unless ($tlfile =~ /^%/) { - chop($tlfile); - $tlfile = $testlib_dir."/".$tlfile; - $tlobj = $tlfile; - $tlobj =~ s/\.c/$obj_suffix/; - $tlobj =~ s/$testlib_dir/$obj_dir/; - - if (&compile($tlfile, $tlobj)) { - } else { - $success = 0; - &logcomment(" failed on $tlfile."); - } - } - } - close(MANIFEST); - &record_clib($success); - - return $success; -} - - -# -# delete everything in the object directory -# - -sub objpurge { - unless (opendir(DIR, $obj_dir)) { - die "Failed to open object directory $obj_dir.\n"; - } - &logcomment("Cleaning out old object files."); - foreach (readdir(DIR)) { - unless ($_ eq "." || $_ eq ".." || unlink $obj_dir."/".$_) { - &logcomment(" ... but failed to delete $_."); - } - } - closedir(DIR); -} - -# -# record information about environment so that when running tests -# we can check the libraries are still applicable -# -# specifically: -# - MMQA_harness version -# - values of MPS_INCLUDE_DIR and MPS_LINK_OBJ -# - latest modification time of a mpsXXX.h files in MPS_INCLUDE_DIR, -# - or an object in MPS_LINK_OBJ -# - C-compiler version?? - -sub record_clib { - my ($success) = @_; - unless (open(REC, ">$obj_dir/record")) { - die "Unable to write clib record."; - } - print REC "HARNESS_VERSION $HARNESS_VERSION\n"; - print REC "INCLUDE_DIR $MPS_INCLUDE_DIR\n"; - print REC "LINK_OBJ $MPS_LINK_OBJ\n"; - print REC "SUCCESS $success\n"; -# &headertimes and &linkobjtimes have already been called, by &scrutinize - foreach (sort keys %mps_headers) { - print REC "HEADER $_ $mps_headers{$_}\n"; - } - foreach (sort keys %mps_linkobjs) { - print REC "LINK $_ $mps_linkobjs{$_}\n"; - } - close(REC); -} - -# -# check whether the test libraries correspond to the current -# settings -# - -sub test_clib { - my $err = 0; - - if (!open(REC, "$obj_dir/record")) { - $err = "no test library description found"; - } elsif ( ne "HARNESS_VERSION $HARNESS_VERSION\n") { - $err = "libraries were compiled with a different harness version"; - } elsif ( ne "INCLUDE_DIR $MPS_INCLUDE_DIR\n") { - $err = "MPS_INCLUDE_DIR has changed"; - } elsif ( ne "LINK_OBJ $MPS_LINK_OBJ\n") { - $err = "MPS_LINK_OBJ has changed"; - } elsif ( ne "SUCCESS 1\n") { - $err = "previous attempt to compile test libraries failed"; - } else { - &headertimes(); - &linkobjtimes(); - while () { - if (/^HEADER\s+(\S+)\s+(\S+)/) { - if (!exists $mps_headers{$1}) { - $err = "header file $1 disappeared"; - } elsif ($mps_headers{$1} != $2) { - $err = "I think $1 may have changed"; - } else { - delete $mps_headers{$1}; - } - } elsif (/^LINK\s+(\S+)\s+(\S+)/) { - if (!exists $mps_linkobjs{$1}) { - $err = "link object $1 disappeared"; - } elsif ($mps_linkobjs{$1} != $2) { - $err = "I think $1 may have changed"; - } else { - delete $mps_linkobjs{$1}; - } - } else { - $err = "test library description not understood"; - } - if ($err) { - last; - } - } - unless ($err) { - if (scalar (keys %mps_headers)) { - ($err) = keys %mps_headers; - $err = "new header file $err"; - } elsif (scalar (keys %mps_linkobjs)) { - ($err) = keys %mps_linkobjs; - $err = "new link object $err"; - } - } - } - return $err; -} - - -sub headertimes { - %mps_headers = (); - - unless (opendir(DIR, $MPS_INCLUDE_DIR)) { - die "Failed to open directory $MPS_INCLUDE_DIR.\n"; - } - foreach (readdir(DIR)) { - if (/^mps.*\.h$/) { - $mps_headers{$_} = &mod_time("$MPS_INCLUDE_DIR/$_"); - } - } - closedir(DIR); -} - -sub linkobjtimes { - %mps_linkobjs = (); - $_ = $MPS_LINK_OBJ; - - foreach (split) { - $mps_linkobjs{$_} = &mod_time($_); - } - closedir(DIR); -} - -sub mod_time { - my ($file, $modtime) = @_; - - unless (open(STAT, $file)) { - die "Couldn't find $file.\n"; - } - (undef,undef,undef,undef,undef, - undef,undef,undef,undef,$modtime) = stat STAT; - close(STAT); - return $modtime; -} - -# -# root around in MPS_INCLUDE_DIR and find useful-looking header files -# - - -sub scrutinize { - my $command; - my $comobj; - - %mps_symbols = (); - %mps_linkable = (); - - &logcomment("Checking settings."); - &headertimes(); - &linkobjtimes(); - &logcomment("Scrutinizing MPS header files."); - - foreach (keys %mps_headers) { - &scrutfile($_); - } - -# add a dummy symbol to allow us to check that non-defined -# symbols are correctly filtered out - - $mps_symbols{"MPS_MMQA_DUMMY_SYMBOL"} = 1; - - unless (open(SYM, ">$obj_dir/symtest.c")) { - die "Failed to write symbol test file.\n"; - } - print SYM "/* THIS FILE IS AUTOMATICALLY GENERATED */\n\n"; - foreach (sort keys %mps_symbols) { - print SYM "void $_(void);\n"; - } - print SYM "\n\nint main(void) {\n"; - foreach (sort keys %mps_symbols) { - print SYM " $_();\n"; - } - print SYM "\n return 1;\n}\n\n"; - close(SYM); - - $command = "$obj_dir/symtest.c"; - if ($cc_objandexe) { - $comobj = "$cc_obj$obj_dir/symtest$obj_suffix"; - } else { - $comobj = ""; - } - $comout = "$obj_dir/symtest.out"; - - if (&mysystem("$cc_command $cc_opts $comobj $cc_exe$obj_dir/symtest" - . " $obj_dir/symtest.c $MPS_LINK_OBJ $cc_link_opts " - . sprintf($stdboth_red, $comout)) - == 127) { - die "Failed link test"; - } - - %mps_linkable = %mps_symbols; - - open(LINKTEST, $comout); - while () { - while (s/((mps|MPS)_\w+)/ /) { - delete $mps_linkable{$1}; - &debug("Filtering out $1."); - } - } - close(LINKTEST); - - if (exists $mps_linkable{"MPS_MMQA_DUMMY_SYMBOL"}) { - print "Failed to determine symbols defined in MPS libraries -- exiting.\n"; - die "[Complain to mm-qa about this.]\n"; - } elsif ((scalar(keys %mps_symbols)) == 0) { - print "Couldn't determine which symbols are defined in MPS libraries -- exiting.\n"; - die "[Complain to mm-qa about this.]\n"; - } - - delete $mps_symbols{"MPS_MMQA_DUMMY_SYMBOL"}; - - unless (open(SYM, ">$obj_dir/mmqasym.h")) { - die "Failed to write mmqa symbol file.\n"; - } - print SYM "/* THIS FILE IS AUTOMATICALLY GENERATED */\n\n"; - print SYM "/* mps header files */\n\n"; - foreach (sort keys %mps_headers) { - s/\.h$//; - print SYM "#define MMQA_HEADER_$_\n"; - } - print SYM "\n\n/* symbols in header files */\n\n"; - foreach (sort keys %mps_symbols) { - print SYM "#define MMQA_SYMBOL_$_\n"; - } - print SYM "\n\n/* symbols defined in library */\n\n"; - foreach (sort keys %mps_linkable) { - print SYM "#define MMQA_DEFINED_$_\n"; - } - print SYM "\n/* end */\n"; - close(SYM); -} - -sub scrutfile { - my ($infile) = @_; - my $cmd; - - unless(open(IN, "$MPS_INCLUDE_DIR/$infile")) { - die "Whoops! Failed to read $infile.\n"; - } - while () { - chomp; - while (s/\$//) { $_ = $_.; chomp; } - if (/^\s*#\s*define\s*((mps|MPS)_\w+)/) { - $mps_symbols{$1} = 1; - } - } - close(IN); - - $cmd = &convdirseps("$preprocommand $MPS_INCLUDE_DIR/$infile |"); - &debug("OPEN >>$cmd<<"); - - unless(open(IN, $cmd)) { - die "Failed to preprocess $infile.\n"; - } - while () { - while (s/((mps|MPS)_\w+)/ /) { - $mps_symbols{$1} = 1; - } - } - close(IN); -} - - -sub readSymbols { - %mps_symbols = (); - %mps_linkable = (); - %mps_assumed = (); - - unless (open(SYM, "$obj_dir/mmqasym.h")) { - die "Couldn't read symbol list -- recompile test libraries (\"qa clib\").\n"; - } - - while () { - chop; - if (/#define MMQA_SYMBOL_(.*)$/) { - $mps_symbols{$1} = 1; - } elsif (/#define MMQA_DEFINED_(.*)$/) { - $mps_linkable{$1} = 1; - } - } - close(SYM); - - unless (open(SYM, "$testlib_dir/assumed")) { - die "Couldn't read assumed symbol list. Complain to mm-qa.\n"; - } - - while () { - chop; - unless (/^%/) { - $mps_assumed{$_} = 1; - } - } -} - - -# -# make a list of all the things which look like mps symbols -# mentioned in a file -# - -sub listFileSymbols { - my ($infile) = @_; - my @symbols = (); - - unless (open(IN, $infile)) { - die "Failed to open $infile.\n"; - } - while () { - while (s/((mps|MPS)_\w+)/ /) { - push @symbols, $1; - } - } - close(IN); - - return \@symbols; -} - - -# -# find which symbols in a list are not defined mps symbols -# Return a reference to a list of them -# - -sub missingSymbols { - my ($checklist) = @_; - my @missing = (); - - foreach (@$checklist) { - unless (exists $mps_symbols{$_} || exists $mps_assumed{$_}) { - push @missing, $_; - } - } - - return \@missing; -} diff --git a/mps/qa/test/script/commands/clib b/mps/qa/test/script/commands/clib deleted file mode 100644 index 108878147f0..00000000000 --- a/mps/qa/test/script/commands/clib +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/local/bin/perl -w -# $HopeName: MMQA_harness!script:commands:clib(trunk.7) $ -# -# Compile all the .c files in $testlib_dir, -# putting the resulting .o files in $obj_dir. -# - -&requiredoptions( - "MPS_INCLUDE_DIR", - "MPS_LINK_OBJ", -# "MPS_INTERFACE_VERSION", - "PLATFORM" -); - -&linkobjtimes(); - -&requiredoptions( - "MPS_PRODUCT" -); - -&clib; - diff --git a/mps/qa/test/script/commands/help b/mps/qa/test/script/commands/help deleted file mode 100644 index 560d5d5332c..00000000000 --- a/mps/qa/test/script/commands/help +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/local/perl -# $HopeName: MMQA_harness!script:commands:help(trunk.4) $ -# -# provide help on QA functions -# - -if (@ARGV) { - foreach (@ARGV) { - &printhelp($_); - } -} else { - opendir(DIR, $script_dir."/help"); - - print "Help topics:\n"; - foreach (readdir(DIR)) { - unless (/^\./) { - &summhelp($_); - } - } - print "For help on a topic, type 'qa help '.\n\n"; - print "For general instructions on how to run tests, see guide.mmqa in\n"; - print "the MM Information database.\n"; - - closedir(DIR); -} - -sub summhelp { - local ($infile, $sumline) = @_; - unless(open(IN, $script_dir."/help/".$infile)) { - die "File ".$infile." unexpectedly not found.\n"; - } - $sumline = ; - close(IN); - write STDOUT; -} - -sub printhelp { - local ($infile) = @_; - unless(open(IN, $script_dir."/help/".$infile)) { - print "No help available on $infile.\n"; - } else { - ; - while () { - print $_; - } - } -} - -format STDOUT = - @<<<<<<<<<<<@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< -$infile, $sumline -. - diff --git a/mps/qa/test/script/commands/index b/mps/qa/test/script/commands/index deleted file mode 100644 index e04af16b2cb..00000000000 --- a/mps/qa/test/script/commands/index +++ /dev/null @@ -1,88 +0,0 @@ -#!/usr/local/bin/perl -# $HopeName: MMQA_harness!script:commands:index(trunk.8) $ -# -# make an index of all the tests (all .c files) in the -# current directory, and write it on stdout. -# - -if (@ARGV == 0) { - @ARGV = ("."); -} - -$index_obj=$ARGV[0]; -{ - if (-d $index_obj) { - chdir($index_obj); - $index_obj = "."; - } else { - $dir = $index_obj; - if ($dir =~ s/(\/|\\|:)([^\\\/:]*)$//) { - $leaf = $2; - if ($leaf eq "") { - $leaf = "."; - } - if (-d $dir) { - chdir($dir); - $index_obj = $leaf; - } - } - } - - opendir(DIR, "."); - @names = readdir(DIR); - closedir(DIR); - @filtered = (); - - while (@names) { - $file = pop(@names); - unless ($file =~ /^\./ || -d $file) { - if (&filematch($index_obj, $file)) { - push(@filtered, $file); - } - } - } - - foreach $file (sort by_number_first @filtered) { - eval { - &readheader($file, 0); - $testname = $test_header{"summary"}; - unless (defined $testname) { - print $file.": ** bad test header **\n"; - } else { - print $file.": ".$testname."\n"; - } - } - } -} - -sub by_number_first { - $aa = $a; - $bb = $b; - $aa =~ s/\D*//g; - $bb =~ s/\D*//g; - ("0".$aa <=> "0".$bb) || ($a cmp $b); -} - -sub filematch { - local ($p, $f, $n, $q, $a, $b) = @_; - if ($p eq ".") { - return 1; - } - if ($p =~ /\/(.*)\//) { - return $f =~ $1; - } - $n = $f; - $n =~ s/\D*//g; - $n = "0".$n; - if ($p =~ /(\d*)(.*)-+(\d*)(.*)/) { - $a = $1; $b = $3; - $a = 0 if ($a eq ""); - $b = $n if ($b eq ""); - return ($n >= $a && $n <= $b); - } - $p =~ /^(\d*)/; - if ($1 ne "") { - return $1 == $n; - } - return ($p eq $f); -} diff --git a/mps/qa/test/script/commands/options b/mps/qa/test/script/commands/options deleted file mode 100644 index 29271b0ae87..00000000000 --- a/mps/qa/test/script/commands/options +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/local/bin/perl -# $HopeName: MMQA_harness!script:commands:options(trunk.2) $ -# -# display all the options ever -# - -&displayalloptions; - - diff --git a/mps/qa/test/script/commands/run b/mps/qa/test/script/commands/run deleted file mode 100644 index 6fa4570df22..00000000000 --- a/mps/qa/test/script/commands/run +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/local/bin/perl -# $HopeName: MMQA_harness!script:commands:run(trunk.6) $ -# -# run tests interactively (allows for user input, immediate results, -# &c, and give results in standard format, and mailing results) - -&requiredoptions( - "MPS_INCLUDE_DIR", - "MPS_LINK_OBJ", -# "MPS_INTERFACE_VERSION", - "MPS_PRODUCT", - "PLATFORM", - "LOG_DIR" -); - -foreach $testfile (@ARGV) { - &run_test($testfile, "yes", "results", "$LOG_DIR/last.log"); - &mailfile("$LOG_DIR/last.log", "$MAIL_SUBJECT $testid $testconclusion"); -} - diff --git a/mps/qa/test/script/commands/runset b/mps/qa/test/script/commands/runset deleted file mode 100644 index 2147c9f0240..00000000000 --- a/mps/qa/test/script/commands/runset +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/local/bin/perl -w -# $HopeName: MMQA_harness!script:commands:runset(trunk.3) $ -# -# run a set of tests specified in a test-set file -# - -&requiredoptions( - "MPS_INCLUDE_DIR", - "MPS_LINK_OBJ", -# "MPS_INTERFACE_VERSION", - "MPS_PRODUCT", - "PLATFORM", - "LOG_DIR" -); - -$testset = $ARGV[0]; - -&run_testset($testset, "$LOG_DIR/summ.log", "$LOG_DIR/res.log", "$LOG_DIR/full.log"); - diff --git a/mps/qa/test/script/commands/try b/mps/qa/test/script/commands/try deleted file mode 100644 index 27c151b6736..00000000000 --- a/mps/qa/test/script/commands/try +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/local/bin/perl -# $HopeName: MMQA_harness!script:commands:try(trunk.9) $ -# -# run tests interactively (allows for user input, immediate results, -# &c, but doesn't give results in standard format) - -print "The try command has been removed. Please use the run command instead.\n"; - - diff --git a/mps/qa/test/script/compile b/mps/qa/test/script/compile deleted file mode 100644 index e14e9323f09..00000000000 --- a/mps/qa/test/script/compile +++ /dev/null @@ -1,119 +0,0 @@ -#!/usr/local/perl -# $HopeName: MMQA_harness!script:compile(trunk.27) $ -# -# provides subroutines to compile or compile and link -# tests and test libraries. -# -# it should work at least on SunOS, Solaris and NT -# - -1; - -sub log_system { - local ($command, $output, $logfile, $stdin) = @_; - my $time0; my $time1; - - $std_log = "$obj_dir/std_log.log"; - $err_log = "$obj_dir/err_log.log"; - - &debug("LOG SYSTEM:\n c>$command\n i<$stdin\n o>$output\n l>$logfile"); - - if ($stdin eq "STDIN") { - $stdin = ""; - } else { - $stdin = $stdin_red." ".$stdin; - } - - $time0 = time; - - if ($logfile ne "no") { - open(SAVEERR, ">&STDERR"); - open(STDERR, ">$err_log"); - if ($output eq "no") { - &mysystem("$comwrap$command$comwrapend $stdin $stdout_red $std_log"); - } else { - &mysystem("$comwrap$command$comwrapend $stdin $stdout_dup $std_log"); - } - $time1 = time; - close(STDERR); - if ($output ne "no") { - &mysystem("$catcommand $err_log"); - } - open(STDERR, ">&SAVEERR"); - &mysystem("$catcommand $std_log $err_log $stdout_red $logfile"); - } else { - if ($output eq "no") { - die "Silly attempt to run test and ignore results.\n"; - } else { - &mysystem("$comwrap$command$comwrapend $stdin"); - $time1 = time; - } - } - $time1 = time; - $testtotaltime = $time1-$time0; -} - -sub compile { - local($srcfile, $objfile) = @_; - - $command = "$cc_command $cc_conly $cc_opts $cc_obj$objfile ". - "$srcfile $cc_include"; - - if (&mysystem($command)) { - return 0; - } else { - return 1; - } -} - -sub compile_and_link { - local($srcfile, $exefile, $linkfiles, $objfile, $hashdefs) = @_; - - unless ($linkfiles) {$linkfiles =""}; - $linkfiles = " ".$linkfiles; - $linkfiles =~ s/ +(\S)/ $obj_dir\/$1/g; - $linkfiles = $linkfiles." "; - $linkfiles =~ s/\.o /$obj_suffix /g; - $objfile = "$obj_dir/tmp_obj$obj_suffix"; - - $hashdefs = ""; - foreach (keys %parmdefs) { - $hashdefs .= &$quotestring($cc_def.$_.$cc_defeq.$parmdefs{$_})." "; - } - chop $hashdefs; - - if ($cc_objandexe) { - $comobjfspec = "$cc_obj$objfile " - } else { - $comobjfspec = "" - } - - $command = &convdirseps( - "$cc_command $cc_opts $hashdefs $comobjfspec$cc_exe$exefile ". - "$srcfile $linkfiles $MPS_LINK_OBJ $cc_link $cc_include $cc_link_opts|"); - - &debug("OPEN >>$command<<"); - - unless(open(COMLINK, $command)) { - return 0; - } - - $compoutput = ""; - - while () { - $compoutput .= $_; - print $_; - } - close(COMLINK); - - if ($compoutput) { - chop $compoutput; - } - - if ($?) { - return 0; - } else { - return 1; - } -} - diff --git a/mps/qa/test/script/dirs b/mps/qa/test/script/dirs deleted file mode 100644 index ef887681a55..00000000000 --- a/mps/qa/test/script/dirs +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/local/perl -# $HopeName: MMQA_harness!script:dirs(trunk.3) $ -# -# set directories up for testing -# n.b. this must happen _after_ options have been -# parsed, so we know what the value of $PLATFORM is -# - -1; - -sub set_dirs { - $testlib_dir = $test_dir."/testlib"; - - $obj_dir = $test_dir."/obj/".$PLATFORM; - &ensuredir($obj_dir); - - &ensuredir($LOG_DIR); -} - -sub ensuredir { - local ($dir, $tdir, $odir) = @_; - - until (-e $dir) { - $tdir = $dir; - $odir = $dir; - until (-e $tdir) { - $odir = $tdir; - unless ($tdir =~ /\/[^\/]*$/) { - die "Failed to create dir: $dir.\n"; - } - $tdir =~ s/\/[^\/]*$//; # assume / is separator; - } - mkdir($odir, 0777) || die "Failed to create dir: $dir.\n"; - } -} - diff --git a/mps/qa/test/script/display b/mps/qa/test/script/display deleted file mode 100644 index e16e9fe7b13..00000000000 --- a/mps/qa/test/script/display +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/local/perl -# $HopeName: MMQA_harness!script:display(trunk.1) $ -# -# provide a subroutine to pretty-print tests to a -# output stream -# - -1; - -sub display_test_source { - local ($file, $stream, $width) = @_; - - unless (open(IN, $file)) { - die "File ".$infile." unexpectedly not found.\n"; - } - - $l = ""; - - while () { - print $stream $_; - } - - close(IN); -} - -# -# Ideas: -# -# line properties: join at start / join at end? -# specials: -# start paragraph -# special formatting (alignment?) -# lists, itemised, tables &c -# -# diff --git a/mps/qa/test/script/headconv b/mps/qa/test/script/headconv deleted file mode 100644 index 765de9a3428..00000000000 --- a/mps/qa/test/script/headconv +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/local/bin/perl -w -# $HopeName$ -# -# convert to new-style test header format -# -foreach $file (@ARGV) { - unless (open(IN, $file)) {die $file." not found";} - open(OUT, ">new/$file"); - print $file." --> new/".$file."\n"; - - print OUT "/* TEST_HEADER\n"; - - $_ = ; - s+/\*\s*test + summary = +; - print OUT $_; - - $_ = ; - s/\s*language\s*c/ language = c/; - print OUT $_; - - $_ = ; - if (m/\s*link /) { - s/\s*link / link = /; - print OUT $_; - $_ = ; - } - - if (m+\*/+) { - print OUT "END_HEADER\n"; - print OUT "*/\n"; - } else { - print OUT "OUTPUT_SPEC\n"; - print OUT $_; - $_ = ; - while (!m+\*/+) { - s/\s*/ /; - print OUT $_; - $_ = ; - } - print OUT "END_HEADER\n"; - print OUT "*/\n"; - - } - - while () { - print OUT $_; - } - - close(OUT); - close(IN); - -} - diff --git a/mps/qa/test/script/headread b/mps/qa/test/script/headread deleted file mode 100644 index 5ae9618c84d..00000000000 --- a/mps/qa/test/script/headread +++ /dev/null @@ -1,270 +0,0 @@ -#!/usr/local/bin/perl -# $HopeName: MMQA_harness!script:headread(trunk.18) $ -# -# subroutines to assist in -# 1. reading test headers -# 2. reading test output -# 3. making pass/fail decision -# -# [returns 1 to make perl happy] -1; - -# Example header: -# -# ... TEST_HEADER -# summary=try lots of allocation to provoke errors -# language=c; link=testlib.o -# OUTPUT_SPEC -# alloc=OK -# size1>20 -# END_HEADER ... -# -# information is stored in associative arrays: -# %test_header -# %spec_output -# %spec_rel -# -# analysing results gives -# %real_output, like %spec_output -# -# $test_header{key} = value; -# $spec_output{key} = value; -# $spec_rel{key} = relation; -# -# - -sub readheader { - local($infile, $parms) = @_; - - unless (open(IN, $infile)) { - die "File ".$infile." not found."; - } - - $_ = ""; - while (! /TEST_HEADER/) { - defined($_=) || die "Couldn't find start of test header in $infile.\n"; - } - s/.*TEST_HEADER//; - $line = $_; - while (! /END_HEADER/) { - defined($_=) || die "Couldn't find end of test header in $infile.\n"; - chop; - if ($line =~ /\\$/) { - chop($line); - $line = $line.$_; - } else { - $line = $line."; ".$_; - } - } - $line =~ s/END_HEADER.*//; - - if ($line =~ /OUTPUT_SPEC/) { - $line =~ /(.*)OUTPUT_SPEC(.*)/; - $header = $1; - $outspec = $2; - } else { - &debug("No output specification -- assuming completed=yes required."); - $header = $line; - $outspec = "completed = yes"; - } - - &readvals($header, "="); - %test_header = %keyvalues; - - &readvals($outspec, "=~|<=|>=|=|<|>|P="); - %spec_output = %keyvalues; - %spec_rel = %keyrelations; - - close(IN); - if ($parms) { - &get_parmdefs(); - } - if (! exists $test_header{"id"}) { - $test_header{"id"} = ""; - $testid = "$infile"; - } else { - $testid = $test_header{"id"}; - } - if (! exists $test_header{"harness"}) { - $test_header{"harness"} = "1.0"; - } - if (-w $infile) { - $test_header{"id"} .= " (but the file is writeable)"; - $testid = "$infile (writeable)"; - } -# -# Compatibility with old tests -# -- convert result=pass to completed=yes -# - if (vleq($test_header{"harness"}, "1.0") && exists $spec_output{"result"}) { - if ($spec_output{"result"} eq "pass") { - $spec_output{"completed"} = "yes"; - } elsif ($spec_output{"result"} eq "fail") { - $spec_output{"completed"} = "no"; - } else { - $spec_output{"completed"} = $spec_output{"result"}; - } - $spec_rel{"completed"} = $spec_rel{"result"}; - delete $spec_output{"result"}; - delete $spec_rel{"result"}; - } -} - -sub readvals { - local ($_, $relations) = @_; - - %keyvalues = (); - %keyrelations = (); - - s/([^\\]);/$1;;/g; - - foreach (split(/\s*;;\s*/)) { - s/\\(\\|;)/$1/g; - - if (m/^\W*(\w+)\s*($relations)\s*(.+)\s*/) { - $keyvalues{$1} = $3; - $keyrelations{$1} = $2; - } else { - unless (m/^\W*/) { - print "Bad header item: ".$_." in $infile.\n"; - } - } - } -} - -# -# &read_results reads in a log file and sets up %real_output -# as appropriate -# - -sub read_results { - local ($logfile) = @_; - - &debug("read_results >$logfile<"); - open(LOGFILE, $logfile); - %real_output = ("seconds", $testtotaltime); - $testtimeline = &logtimeline($testtotaltime); - - while () { - &debug($_); - if (/^!/) { -# result variable - if (/^!(\w+)\s*=\s*(.+)\s*/) { - $real_output{$1} = $2 - } else { - die "Badly formatted result line in output:\n$_\n"; - } - } elsif (/^Abort|^abnormal program termination/ ) { -# abort for other reason - $real_output{"abort"} = "true"; - } elsif (/^%/ || /^\s$/) { -# comment or blank line - } else { - die "Unexpected line in output:\n$_\n"; - } - } - close(LOGFILE); -# -# Compatibility with old tests -# -- convert result=pass/fail to completed=yes/no -# - if (vleq($test_header{"harness"}, "1.0") && exists $real_output{"result"}) { - if ($real_output{"result"} eq "pass") { - $real_output{"completed"} = "yes"; - } elsif ($real_output{"result"} eq "fail") { - $real_output{"completed"} = "no"; - } else { - $real_output{"completed"} = $real_output{"result"}; - } - delete $real_output{"result"}; - } -} - - -# -# filenames_differ takes 2 filenames and returns false iff all of the -# first filename matches with the tail components of the second -# filename. All standard directory separators are permitted (\/:) -# - -sub filenames_differ { - local($fname1, $fname2) = @_; - - @f1 = split(m;[/:\\];, $fname1); - @f2 = split(m;[/:\\];, $fname2); - $i1 = $#f1; - $i2 = $#f2; - while ($i1 >= 0 && $i2 >= 0) { - if ($f1[$i1] ne $f2[$i2]) { - # return true if names components don't match - return(1); - } - $i1--; - $i2--; - } - # return true if not all of @f1 has been checked - return($i1 >= 0) -} - -# -# &verdict has the job of setting $testconclusion, $testconcreason -# - -sub verdict { - local ($key, $act, $ope, $spe); - - $testconclusion = "PASS"; - $testconcreason = ""; - - foreach $key (keys %spec_output) { - $ope = $spec_rel{$key}; - $spe = $spec_output{$key}; - if (defined($real_output{$key})) { - $acn = $real_output{$key}; - &debug("require: $key: $acn $ope $spe"); - if ($ope eq "=" && $spe ne $acn - || $ope eq "=~" && $acn !~ /$spe/ - || $ope eq "<" && $spe <= $acn - || $ope eq ">" && $spe >= $acn - || $ope eq "<=" && $spe < $acn - || $ope eq ">=" && $spe > $acn - || $ope eq "P=" && filenames_differ($spe, $acn)) { - $testconclusion = "FAIL"; - $testconcreason = "failed on $key: wanted $ope $spe, was $acn"; - last; - } - } else { - $testconclusion = "FAIL"; - $testconcreason = "failed on $key: wanted $ope $spe, was absent"; - last; - } - } -} - -# -# &get_parmdefs gets parameter definitions from the environment, as -# specified in the test header -# - -sub get_parmdefs { - local ($var, $missing, $val); - $missing = ""; - %parmdefs = (); - if (exists $test_header{"parameters"}) { - foreach (split /\s+/, $test_header{"parameters"}) { - ($_, $val) = split /=/, $_; - $var = getparameter($_); - if (defined $var) { - $parmdefs{$_} = $var; - } elsif (defined $val) { - $parmdefs{$_} = $val; - } else { - $missing .= "\n ".$_.","; - } - } - if ($missing ne "") { - chop $missing; - die "Unspecified test parameters:$missing.\n"; - } - } -} diff --git a/mps/qa/test/script/help/clib b/mps/qa/test/script/help/clib deleted file mode 100644 index b03151c2b3c..00000000000 --- a/mps/qa/test/script/help/clib +++ /dev/null @@ -1,16 +0,0 @@ -compile test libraries -% $HopeName: MMQA_harness!script:help:clib(trunk.4) $ - -Usage: qa clib [] - -'clib' recompiles the test libraries (as listed in testlib:manifest) -This should be done before running tests with 'run'. The harness -will check whether the test libraries are up-to-date when running -tests, and give an error if not. - -Compiled libraries are placed in the obj:: directory. - -In addition to compiling the libraries, 'clib' looks at the mps header -files and the specified link objects, to determine what mps interfaces -are available. This information is recorded in the file 'mmqasym.h'. - diff --git a/mps/qa/test/script/help/index b/mps/qa/test/script/help/index deleted file mode 100644 index 3ac7acc3331..00000000000 --- a/mps/qa/test/script/help/index +++ /dev/null @@ -1,10 +0,0 @@ -list tests in a directory -% $HopeName$ - -Usage: qa index [] - -'index' lists the tests in the directory specified, or the -current directory if none is. For each test, the filename -and test summary are displayed. - - diff --git a/mps/qa/test/script/help/install b/mps/qa/test/script/help/install deleted file mode 100644 index 851230d2c1e..00000000000 --- a/mps/qa/test/script/help/install +++ /dev/null @@ -1,44 +0,0 @@ -installing and invoking the MMQA test harness -% $HopeName: MMQA_harness!script:help:problems(trunk.2) $ - -The MMQA test system consists of the test harness (in hope as MMQA_harness!), -suites of individual tests (MMQA_test_function!, MMQA_test_argerr!, -MMQA_test_conerr!, MMQA_test_misc!), data files (MMQA_data!) and a number of -test sets (MMQA_testsets!). To run tests, you need at least the test harness -and the individual tests you want to run. To checkout everything, use the -hope command: - checkout -recursive -missing-dir create MMQA!(.) - -(There are no useful checkpoints or branches on the MMQA compound.) -This will give you a directory structure as follows: - - mmqa -- MMQA top-level directory, i.e. MMQA! - test -- test harness, i.e. MMQA_harness! - qa -- perl script for compiling and running test &c - script -- perl programs and other files used by 'qa' - testlibs -- test libraries (.c and .h files) - obj -- compiled tests and libraries go in here - report -- test reports (unused) - function -- mps functional tests, i.e. MMQA_test_function! - conerr -- context error tests, i.e. MMQA_test_conerr! - argerr -- argument error tests, i.e. MMQA_test_argerr! - misc -- miscellaneous tests, i.e. MMQA_test_misc! - data -- data files, i.e. MMQA_data! - testsets -- test sets, i.e. MMQA_testsets! - -Actually, it doesn't matter where you put the directories of individual -tests (function, conerr, argerr, misc), but it will be simplest if you -use the structure above. - -All qa commands are invoked by running the perl script in the mmqa/test -directory, as follows: - - perl mmqa/test/qa - -Perl is required: if the above fails, try - - perl5 mmqa/test/qa - -You will probably find it useful to set up an alias, batch file or similar -so that you can just type "qa " to invoke qa commands. - diff --git a/mps/qa/test/script/help/naming b/mps/qa/test/script/help/naming deleted file mode 100644 index 4db680f9d70..00000000000 --- a/mps/qa/test/script/help/naming +++ /dev/null @@ -1,22 +0,0 @@ -Numbering of test programs -% $HopeName$ - -Test program are indentified by their hope names, i.e. by a hope -compound, an exclamation mark, and the test file name. The test -file name will usually be a number followed by .c. - -e.g. test 12.c in directory 'function' is MMQA_test_function!12.c. - -------- - -Some older documents may refer to test programs by codes consisting -of a single letter and some numbers (no leading zeros). The letter -gives the type of test, and where to find it, as follows: - - f -- Functional test MMQA_test_function - a -- Argument violation MMQA_test_argerr - c -- Context violation MMQA_test_conerr - m -- Miscellaneous test MMQA_test_misc - -Please do not use this naming system any more. - diff --git a/mps/qa/test/script/help/options b/mps/qa/test/script/help/options deleted file mode 100644 index 037c63fb382..00000000000 --- a/mps/qa/test/script/help/options +++ /dev/null @@ -1,119 +0,0 @@ -display options and their current values -% $HopeName: MMQA_harness!script:help:options(trunk.6) $ - -Usage: qa options [] - -'options' prints out a table of all options and flags used -by the qa harness. Each may be specified by setting an -environment variable (to "on" or "off" in the case of a flag) -or as a command line option. The current values (i.e. resulting -from defaults, environment variables and any options given -to the 'options' command) are also shown. You can use command- -line options with the 'options' command to check that you're -specifying them correctly, but of course they won't remain -set for future commands. - -In general, if you specify a command-line option or flag, it -will override whatever setting was made with environment variables. -If the option is _cumulative_, however, both will apply. - -What the options mean: - -MMQA_MPS_INCLUDE_DIR / -i - a directory where the MM header files may be found. No default. - -MMQA_MPS_LINK_OBJ / -l - the MM libraries and plinth to link with. Separate multiple files - with spaces. (Spaces in the paths will make the test harness go - wrong, unfortunately.) No default. - -MMQA_MPS_PRODUCT / -prod - You won't normally need to (and shouldn't) set this option, which - will default to "epcore" or "dylan", whichever is appropriate to - the memory manager specified in MMQA_MPS_LINK_OBJ. If however you - want to test a memory manager which predates MPS version - identification, then you must set it manually. - -MMQA_LOG_DIR / -g - the directory in which log files should be saved. Default is - 'log' directory inside the MMQA 'test' directory. - -MMQA_DATA_DIR / -data - the diretory in which MMQA data files may be found. Default is - '../data' from the MMQA 'test' directory. This is used when tests - specify a particular file as their standard input. If you specify - the standard input with MMQA_STDIN, the current directory is used. - -MMQA_PLATFORM / -p - the platform you are running on. This is determined automatically, - and used to specify compiler options and command-line syntax for - running tests. Setting it to a value not appropriate to the - machine you are using will make the test system go wrong. - -MMQA_PARAMETERS / -a (cumulative) - parameter settings to use for a test. These override any parameter - settings specified in the test header. Examples (all equivalent): - - 1) qa run test.c -a DEPTH=10 -a WIDTH=5 - - 2) qa run test.c -a "WIDTH=5 DEPTH=10" - - 3) MMQA_PARAMETERS='DEPTH=10 WIDTH=5' - qa run test.c - - 4) MMQA_PARAMETERS='DEPTH=10' - qa run test.c -a WIDTH=5 - - Parameters may also be specified individually: - - 5) MMQA_PARAM_DEPTH=10 - MMQA_PARAM_WIDTH=5 - qa run test.c - - All these kinds of parameter settings may be combined. In the case - of a clash, the command-line setting takes precedence, then the - setting via MMQA_PARAMETERS. I recommend using command-line settings - only, otherwise there's a risk you'll leave the parameters set and - end up using them by mistake with other tests. - -MMQA_STDIN / -s - allows you to specify what a test will use for its standard - input. If unset, the file specified by the test itself will - be used (from the MMQA_DATA_DIR directory). By setting MMQA_STDIN, - you can use a file of your choosing, or specify "STDIN" if you want - to force input from whatever is the qa harness's standard input - (usually the keyboard). - -MMQA_DEBUG_INFO / -[no]debug - default is 'off'. If you turn this on, qa commands will output - various diagnostic messages, which may or may not be useful in - the event of a problem with the test system. Not recommended. - -MMQA_DANGEROUS / -[no]danger - default is 'off'. With default setting, the harness will refuse - to run a test if it believes the test libraries may not be compatible - with the current settings. Normally you will want to "qa clib" when - this happens, but to force the harness to run the test with the - old libraries (and symbol lists), turn this option on. - -MMQA_MAIL_RESULTS / -[no]mail - If MAIL_RESULTS is on, then MAIL_SUBJECT will be put at the beginning - of the subject header when test logs are mailed out. Default is - "MMQA-log". Don't change this unless you are going to change - MMQA_MAIL_TO, in which case you might want to use it to help you - filter your mail automatically. - -MMQA_MAIL_TO / -m - If MAIL_RESULTS is on, then MAIL_TO is who to mail test logs to. - The default is mm-qa-test-log, which get archived in the - "MM QA Test Log" Notes database. Leave this unchanged, unless for - example you want to mail results (which are more detailed than - those displayed on screen) to yourself. - -MMQA_MAIL_SUBJECT / -subj - If MAIL_RESULTS is on, then MAIL_SUBJECT will be put at the - beginning of the subject header when test logs are mailed out. - Default is "MMQA-log". Don't change this unless you are going to - change MMQA_MAIL_TO, in which case you might want to use it to help - you filter your mail automatically. - diff --git a/mps/qa/test/script/help/output b/mps/qa/test/script/help/output deleted file mode 100644 index 6836169a954..00000000000 --- a/mps/qa/test/script/help/output +++ /dev/null @@ -1,37 +0,0 @@ -Conventions for test output -% $HopeName$ - -Lines beginning with % are comments and will be ignored -in all automatic processing. They'll only be useful -when running test programs manually. - -All other lines will be of the form: - -= - -Where is a string of alphanumerics and blahs, and - is any printable chars up to the end of line. - -The output should begin with identifying lines something -like this: - -test_program= -platform= -product= -version= - -No line should be more than 80 chars long. - -Obviously this isn't the direct output from the test -program. Things like abortion, assertion failure &c &c -will tend to produce other junk in the test output; this -will be processed by a (platform-specific) program to produce -the eventual test output. The processing program will -pass straight through all lines beginning with %, and all -blank lines. It will strip a ! from the beginning of any -line which begins with one (use for !=), -and do platform-speciic stuff on all the remaining lines. -It will complain about (at least) the first line it -doesn't understand. - - diff --git a/mps/qa/test/script/help/problems b/mps/qa/test/script/help/problems deleted file mode 100644 index 973476920ff..00000000000 --- a/mps/qa/test/script/help/problems +++ /dev/null @@ -1,14 +0,0 @@ -known problems and how to report others you may find -% $HopeName$ - -Known problems with this test system: - -- it can't tell whether the libraries are up to date: you - have to keep track of this yourself and use clib if they're not. - -- compiling tests on NT produces nasty warnings from the - compiler. - -If you have a complaint, comment or feature request, -please email it to . - diff --git a/mps/qa/test/script/help/run b/mps/qa/test/script/help/run deleted file mode 100644 index 5929c73bf97..00000000000 --- a/mps/qa/test/script/help/run +++ /dev/null @@ -1,15 +0,0 @@ -run tests, reporting results and verdict -% $HopeName: MMQA_harness!script:help:run(trunk.3) $ - -Usage: qa run [] [ ...] - -'run' runs tests individually. The test libraries should previously -have been compiled with 'clib'; if the harness believes the test -libraries may not be up-to-date, it will give an error and ask -you to run 'clib' first. (You can force the harness to run a test -with potentially out-of-date libraries by specifying the "-danger" -option to 'run'. This is not recommended.) - -'run' shows the test's output as it runs, then when it finishes, -displays test information, results, and the verdict: PASS or FAIL. - diff --git a/mps/qa/test/script/help/runset b/mps/qa/test/script/help/runset deleted file mode 100644 index 2bc3c1c8a2e..00000000000 --- a/mps/qa/test/script/help/runset +++ /dev/null @@ -1,22 +0,0 @@ -run tests from a test-set -% $HopeName: MMQA_harness!script:help:runset(trunk.2) $ - -Usage: qa runset [] - -'runset' compiles the test libraries and then runs all the -tests in a test-set. - -A test-set is a file containing a list of tests, one test -per line. Blank lines or those beginning with % are ignored. -Tests can be specified as absolute files, or relative to the -current directory. - -'runset' runs all the tests, and saves three log files in the -logs directory (see 'qa help options'): - - summ.log -- summary log: one line per test, PASS or FAIL - res.log -- results log: test specifications, results and verdict - full.log -- full log: specifications, results, verdict and transcript - -To run tests individually, use the 'run' command. - diff --git a/mps/qa/test/script/init b/mps/qa/test/script/init deleted file mode 100644 index b57e8c140a8..00000000000 --- a/mps/qa/test/script/init +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/local/perl -# $HopeName: MMQA_harness!script:dirs(trunk.3) $ -# -# harness_init is called from qa after loading everything in, -# but before calling the command -# - -1; - -sub harness_init { - &platform_detect; - &process_options; - &set_dirs; - &platform_settings; - &identify; - &auto_settings; - &platform_settings; -} - diff --git a/mps/qa/test/script/logging b/mps/qa/test/script/logging deleted file mode 100644 index 8bb753a7f5e..00000000000 --- a/mps/qa/test/script/logging +++ /dev/null @@ -1,305 +0,0 @@ -#!/usr/local/perl -# $HopeName: MMQA_harness!script:logging(MMQA_harness_dev.1) $ -# -# provides subroutines to help in creating test logs and -# reports -# - -1; - -$: = " \n-\\/"; - -@LOG_FILES = (STDOUT); - -# -# &describe_settings -# like the first part of verbose_test_report -# used when running a test set, for the summary file -# - -sub describe_settings { - local ($LOGFILE, $oldhandle) = @_; - if ($LOGFILE) { - $oldhandle = select($LOGFILE); - } - %eh = (); - print "\n--- ".$log_test_opts."\n"; - &vdispopts; - print "\n--- ".$log_test_ident."\n"; - &vdispvals(*identify, *eh); - if ($LOGFILE) { - select($oldhandle); - } -} - -# -# &verbose_test_report -# a complete test report, with everything except the transcript, -# in a machine-readable form suitable for later processing. This -# is intended to be mailed to an archive. -# - -sub verbose_test_report { - local ($LOGFILE, $oldhandle) = @_; - if ($LOGFILE) { - $oldhandle = select($LOGFILE); - } - %eh = (); - print "\n--- ".$log_test_head."\n"; - &vdispvals(*test_header, *eh); - print "\n--- ".$log_test_spec."\n"; - &vdispvals(*spec_output, *spec_rel); - print "\n--- ".$log_test_opts."\n"; - &vdispopts; - print "\n--- ".$log_test_ident."\n"; - &vdispvals(*identify, *eh); - print "\n--- ".$log_test_mps."\n"; - &vdispvals(*mpslibvers, *eh); - print "\n--- ".$log_test_params."\n"; - &vdispvals(*parmdefs, *eh); - print "\n--- ".$log_test_res."\n"; - &vdispvals(*real_output, *eh); - print "\n--- ".$log_test_conc."\n"; - %conclusions=("verdict", $testconclusion); - &vdispvals(*conclusions, *eh); - if ($LOGFILE) { - select($oldhandle); - } -} - -sub vdispvals { - local (*vals, *rels, $key, $rel, $val) = @_; - - foreach $key (sort keys %vals) { - $val = $vals{$key}; - $rel = ($rels{$key} || "="); - $val =~ s/\n/\n\\ /g; - print "$key $rel $val\n"; - } -} - -sub vdispopts { - local ($key, $rel, $val); - - foreach $key (sort values %qa_options) { - if (&getoption($key)) { - $val = &getoption($key); - $rel = "="; - print "$key $rel $val\n"; - } - } -} - -# -# &describe_test(report_type) -# -# prints out report on a test. report_type is one of: -# full: everything -# summary: single line, pass/fail -# results: test, spec output, results, conclusion -# verbose: as produced by verbose_test_report above -# - -sub describe_test { - local ($report, $LOGFILE, $oldhandle) = @_; - - if ($report eq "verbose") { - &verbose_test_report($LOGFILE); - return; - } - - if ($LOGFILE) { - $oldhandle = select($LOGFILE); - } - if ($report eq "summary") { - $~ = "LOGSUMM"; - $testconcchar = ($testconclusion eq "PASS") ? " " : "X"; - write; - } else { - $~ = "LOGHEAD"; - write; - %keyvalues = %test_header; - %keyrelations = (); - &dispvals; - %keyvalues = %spec_output; - %keyrelations = %spec_rel; - print $log_test_spec; - &dispvals; - &dispopts; - if (%parmdefs) { - %keyvalues = %parmdefs; - %keyrelations = (); - print $log_test_params; - &dispvals; - } - %keyvalues = %real_output; - %keyrelations = (); - print $log_test_res; - &dispvals; - print $log_test_conc; - $~ = "LOGCONC"; - write; - if ($report eq "full") { - &displog; - } - } - if ($LOGFILE) { - select($oldhandle); - } -} - -sub dispvals { - local ($key, $rel, $val, $line); - - foreach $key (sort keys %keyvalues) { - $val = $keyvalues{$key}; - $rel = ($keyrelations{$key} || "="); - if (length($val) <= 50 && $val !~ /\n/ ) { - $~ = "LOGVALS"; - write; - } else { - $~ = "LOGVALSLONG1"; - write; - $~ = "LOGVALSLONG2"; - foreach $line (split /\n/, $val) { - write; - } - } - } -} - -sub dispopts { - local ($key, $rel, $val); - - $~ = "LOGVALS"; - - print $log_test_opts; - foreach $key (sort values %qa_options) { - if (&getoption($key) && !exists $qa_unlogged_opts{$key}) { - $val = &getoption($key); - $rel = "="; - write; - } - } -} - -sub displog { - open(TESTLOG, $testlogfile); - print $log_test_tran; - while (defined($line = )) { - print $line; - } - print $log_test_end; -} - -sub logcomment { - local ($text, $FILE) = @_; - - foreach $FILE (@LOG_FILES) { - print $FILE "$text\n"; - } -} - -sub logtimeline { - local ($secs, $slen, $slenl, $text, $barn, $barl, $barr) = @_; - -$barn = "***********************************************************>"; - -$barr = " |10s |30s |1min |2min |5min |10min "; -$barl = "*********|10s******|30s******|1min*****|2min*****|5min*****|10min "; - - if ($secs < 10) { - $slen = $secs - } elsif ($secs < 30) { - $slen = ($secs + 10) / 2 - } elsif ($secs < 60) { - $slen = ($secs + 30) / 3 - } elsif ($secs < 120) { - $slen = ($secs + 120) / 6 - } elsif ($secs < 300) { - $slen = ($secs + 600) / 18 - } elsif ($secs < 600) { - $slen = ($secs + 1200) / 30 - } else { - $slen = 60; - } - - if (substr($barl, $slen-1, 1) eq "*") { - $slenl = $slen; - } elsif (substr($barl, $slen-1, 1) eq "|") { - $slenl = $slen - 1; - } else { - $slenl = $slen - ($slen % 10); - } - - $secs = 9-($slen % 10); - - &debug("time line: $slenl, $slen, $secs"); - - $text = substr($barl, 0, $slenl); - $text = substr($barn, $slenl-1, $slen-$slenl); - $text = substr($barr, $slen+$secs, 80-$slen-$secs); - - $text = substr($barl, 0, $slenl) . substr($barn, $slenl, $slen-$slenl) . (" " x $secs) . substr($barr, $slen+$secs, 80-$slen-$secs); - $text =~ s/[^>\*]*$//; - return $text; -} - -# -# what the output looks like: -# - -$log_test_head = "TEST HEADER\n"; -$log_test_spec = "SPECIFIED RESULTS\n"; -$log_test_opts = "MMQA OPTIONS\n"; -$log_test_mps = "MPS LIBRARY VERSION\n"; -$log_test_ident = "SETUP USED\n"; -$log_test_params = "PARAMETER SETTINGS\n"; -$log_test_res = "RESULTS\n"; -$log_test_conc = "CONCLUSION\n"; -$log_test_tran = "TRANSCRIPT\n"; -$log_test_end = "END OF TRANSCRIPT\n\n"; - -format LOGHEAD = ------------------------------------------------------------------------------ -@<< 0) { - if ($missing > 1) { - $pur = "s"; - } - print "Error: $qa_command requires the following option". - $pur.":\n"; - &explainoptions(@missopt); - die "\n"; - } -} - -# -# Only cumulative options can appear twice. -# - -sub parseoptions { - local ($tem); - - @qa_args = (); - - while (defined ($_ = shift(@ARGV))) { - if (/^\-+(.*)$/i) { # allow >1 minus sign before options! - if ($qa_options{$1}) { - $qa_opt_val = shift(@ARGV); - &setonceoption($qa_options{$1}, $qa_opt_val); - } else { - $flag = $1; - if ($1 =~ /^no/) { # prefix "no" negates any flag - $flag =~ s/^no//; - $qa_opt_val = "off"; - } else { - $qa_opt_val = "on"; - } - unless ($qa_flags{$flag}) { - die "Unrecognized option or flag: $flag.\n"; - } - &setonceoption($qa_flags{$flag}, $qa_opt_val); - } - } else { - push(@qa_args, $_); - } - } - @ARGV = @qa_args; -} - -sub getoption { - local ($opt) = @_; - return eval "\$".$opt; -} - -sub setoption { - local ($opt, $val) = @_; - if (defined $val) { - eval "\$".$opt." = \$val"; - } -} - -sub setonceoption { - local ($opt, $val) = @_; - if (defined &getoption($opt) && !exists $qa_cumulative_opts{$opt}) { - die "Non-cumulative option $opt specified twice on command line.\n" - } - if (defined &getoption($opt)) { - $val = &getoption($opt)." ".$val; - } - &setoption($opt, $val); -} - -# -# precedence for parameters is: -# 1. parameter supplied on command line -# 2. parameter supplied in MMQA_PARAMETERS -# 3. parameter supplied as MMQA_PARAM_ -# - -sub getparameter { - local ($par) = @_; - &debug("*>*>*>$PARAMETERS<*<*<*"); - if ($PARAMETERS =~ /(^|.*?\s)$par\s*=\s*(\S+)(\s|$)/) { - return $2; - } else { - return $ENV{"MMQA_PARAM_".$par}; - } -} - -sub flagcode { - local ($opt, $code) = @_; - foreach $code (keys %qa_flags) { - if ($qa_flags{$code} eq $opt) { - return $code - } - } - return 0; -} - -sub optioncode { - local ($opt, $code) = @_; - foreach $code (keys %qa_options) { - if ($qa_options{$code} eq $opt) { - return $code - } - } - return 0; -} - -# -# for cumulative options, command line comes first -# - -sub applydefaults { - local ($opt, $val, %arr); - - %arr = (%qa_options, %qa_flags); - - foreach (keys %arr) { - $opt = $arr{$_}; - $val = &getoption($opt); - $var = $ENV{"MMQA_".$opt}; - $def = $qa_defaults{$opt}; - - if (defined $val) { - if (exists $qa_cumulative_opts{$opt} && defined $var) { - $val .= " ".$var; - } - } else { - if (defined $var) { - $val = $var; - } else { - $val = $def; - } - } - if (! defined $val) { - $val = ""; - } - &setoption($opt, $val); - } -} - -sub explainoptions { - local (@keys) = @_; - local ($optname, $optcode, $optcur); - - $~ = "OPTLIST"; - - $optname = "OPTION"; - $optcode = "CODE"; - $optcur = "CURRENT"; - write; - print "\n"; - - foreach $key (sort @keys) { - $optname = "$key"; - if (&optioncode($key)) { - $optcode = "-".&optioncode($key)." "; - } elsif (&flagcode($key)) { - $optcode = "-[no]".&flagcode($key); - } else { - $optcode = ""; - } - $optcur = (&getoption($key) || ""); - write; - } -} - -sub displayalloptions { - print"------------------------------------------------------------------------ - MMQA harness version $HARNESS_VERSION - -"; - &explainoptions(values %qa_options, values %qa_flags); - print" - (Add MMQA_ to start of option to give environment variable) -"; - print"------------------------------------------------------------------------ -"; -} - -format OPTLIST = - @<<<<<<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<< ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< -$optname, $optcode, $optcur -~~ ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< -$optcur -. - diff --git a/mps/qa/test/script/platform b/mps/qa/test/script/platform deleted file mode 100644 index f9c88eaa81c..00000000000 --- a/mps/qa/test/script/platform +++ /dev/null @@ -1,242 +0,0 @@ -#!/usr/local/perl -# $HopeName$ -# -# Settings that depend on the platform, including C compiler and command syntax -# -# And the %identify hash of useful information -# to record in the test results. -# - -1; - -# -# Set lots of variables correctly, depending on the platform -# (which was determined in 'options') -# -# Currently, it should work correctly on NT, Solaris, Linux, MacOS X. -# - -sub platform_settings { - if ($PLATFORM =~ "^nt_") { - &settings_nt(); - if ($PLATFORM =~ "^nt_x86_cap") { - &settings_nt_cap(); - } elsif ($PLATFORM =~ "^nt_x86_coff") { - &settings_nt_coff(); - } - } elsif ($PLATFORM =~ "^SunOS") { - &settings_unix(); - if ($PLATFORM =~ "sos8gp") { - &settings_gprof(); - } - } elsif ($PLATFORM =~ "^Linux") { - &settings_unix(); - &settings_linux(); - } elsif ($PLATFORM =~ "^Mac_OS_10" || $PLATFORM =~ "^Darwin_") { - &settings_unix(); - &settings_macosx(); - } elsif ($PLATFORM =~ "__unix") { - &logcomment("I don't know anything specific about $PLATFORM --"); - &logcomment("using generic unix/gcc settings."); - &settings_unix(); - } else { - die "Sorry: I don't know how to use ".$PLATFORM."\n"; - } -} - - -sub settings_nt { - $dirsep = "\\"; - $cc_command = "cl"; -# following line used to include /DMMQA_VERS_$MPS_INTERFACE_VERSION - $cc_opts = "/nologo /DWIN32 /D_WINDOWS /W3 /Zi /Oy- /MD /DMMQA_PROD_$MPS_PRODUCT"; - $cc_link = "$obj_dir/platform.obj"; - $cc_link_opts = "/link /NODEFAULTLIB:LIBCMT /NODEFAULTLIB:LIBCMTD /NODEFAULTLIB:LIBC /NODEFAULTLIB:LIBCD /NODEFAULTLIB:MSVCRTD /DEFAULTLIB:MSVCRT /debugtype:both /pdb:none /debug:full"; - $cc_include = "/I$testlib_dir /I$MPS_INCLUDE_DIR /I$obj_dir"; - $cc_def = "/D"; - $cc_defeq = "="; - $cc_preonly = "/EP"; - $cc_conly = "/c"; - $cc_obj = "/Fo"; - $cc_exe = "/Fe"; - $cc_objandexe = 1; - $obj_suffix = ".obj"; - $try_command = ""; - $catcommand = "$script_dir/ntx86bin/cat.exe"; - $comwrap = "\""; - $comwrapend = "\""; - $stdout_red = ">"; - $stdout_dup = "| $script_dir/ntx86bin/tee.exe"; - $stdin_red = "<"; - $stdboth_red = ">%s 2>&1"; - $quotestring = \&nt_quotestring; - $platmailfile = \&nt_mailfile; - $stringscommand = "$script_dir/ntx86bin/strings.exe -20 -c"; - $preprocommand = "$cc_command /nologo $cc_preonly"; - $exesuff = ".exe"; -} - -sub settings_nt_cap { - $cc_opts = "$cc_opts /Gh"; - $cc_link = "$cc_link CAP.lib"; - $cc_link_opts = "/link /NODEFAULTLIB:LIBCMT /NODEFAULTLIB:LIBCMTD /NODEFAULTLIB:LIBC /NODEFAULTLIB:LIBCD /NODEFAULTLIB:MSVCRTD /DEFAULTLIB:MSVCRT /debug:full /debugtype:both /pdb:none"; -} - -sub settings_nt_coff { - $cc_link_opts = "/link /NODEFAULTLIB:LIBCMT /NODEFAULTLIB:LIBCMTD /NODEFAULTLIB:LIBC /NODEFAULTLIB:LIBCD /NODEFAULTLIB:MSVCRTD /DEFAULTLIB:MSVCRT /debugtype:coff /debug:full"; -} - - -sub settings_unix { - $dirsep = "/"; - $cc_link = "$obj_dir/platform.o -lm"; - $cc_link_opts = "-z muldefs"; - $cc_command = "gcc"; - $cc_opts = "-ansi -pedantic -Wall -Wstrict-prototypes ". - "-Winline -Waggregate-return -Wnested-externs -Wcast-qual ". - "-Wshadow -Wmissing-prototypes -Wcast-align ". - "-O -g -ggdb3 ". - "-DMMQA_PROD_$MPS_PRODUCT"; - $cc_include = "-I$testlib_dir -I$MPS_INCLUDE_DIR -I$obj_dir"; - $cc_def = "-D"; - $cc_defeq = "="; - $cc_preonly = "-E"; - $cc_conly = "-c"; - $cc_obj = "-o "; - $cc_exe = "-o "; - $cc_objandexe = 0; - $obj_suffix = ".o"; - $try_command = "sh -c "; - $catcommand = "cat"; - $comwrap = "sh -c \"ulimit -c 0; "; - $comwrapend = "\""; - $stdout_red = ">"; - $stdout_dup = "| tee"; - $stdin_red = "<"; - $stdboth_red = ">%s 2>&1"; - $quotestring = \&unix_quotestring; - $platmailfile = \&unix_mailfile; - $stringscommand = "strings"; - $preprocommand = "$cc_command $cc_preonly"; - $exesuff = ""; -} - - -sub settings_gprof { - $cc_opts = "-pg ".$cc_opts; -} - - -sub settings_linux { - $cc_link = $cc_link . " -lpthread"; -} - - -sub settings_macosx { - $cc_command = "cc"; - $cc_link = "$obj_dir/platform.o"; - $cc_link_opts = "-Xlinker -m"; - # See comments in impl.gmk.xcppgc and impl.h.osxc - $cc_opts =~ s/-Wstrict-prototypes//; - $cc_opts .= " -Wno-unused -Wno-long-long -D__inline__="; - $stdboth_red = ">&%s"; - $preprocommand = "$cc_command $cc_preonly"; -} - - -# -# Wrapping up strings to quote them in system calls -# - -sub nt_quotestring { - return $_[0]; -} - -sub unix_quotestring { - local ($_) = @_; - s/'/'\''/; - return "'".$_."'"; -} - -# -# Subroutines to send email (for archiving test results). -# - -sub nt_mailfile { - local ($file, $to, $subj, $from) = @_; - - if (exists $ENV{"USERNAME"}) { - $from = $ENV{"USERNAME"}; - } else { - $from = "mm-qa"; - } - &mysystem( - "$script_dir/ntx86bin/blat.exe ". - "$file -server mailhost -f $from -t $to -s \"$subj\" -q"); -} - -sub unix_mailfile { - local ($file, $to, $subj) = @_; - - &mysystem( - "{ echo 'To: $to'; echo 'Subject: $subj'; cat $file; } | /usr/lib/sendmail -t"); -} - - -# -# %identify records useful information to present in the test results -# &identify sets it up. -# - -sub identify { - %identify = (); - if ($PLATFORM =~ /^nt/) { - &identify_nt; - } elsif ($PLATFORM =~ /__unix/) { - &identify_unix; - } - $identify{"time"} = localtime; - $identify{"harness_version"} = $HARNESS_VERSION; -} - - -sub envvar { - if (exists $ENV{$_[1]}) { - $identify{$_[0]} = $ENV{$_[1]}; - } -} - -sub comvar { - my ($var, $com, $pat) = @_; - if (open(COM, $com." 2>&1 |")) { - while () { - chop; - if ($pat eq "" || /$pat/) { - $identify{$_[0]} = $_; - last; - } - } - close(COM); - } -} - - -sub identify_nt { - &envvar("machine", "COMPUTERNAME"); - &envvar("user", "USERNAME"); - &envvar("OS", "OS"); - &envvar("arch", "PROCESSOR_ARCHITECTURE"); - &comvar("c_version", "cl /?", ""); -} - - -sub identify_unix { - &comvar("machine", "uname -n", ""); - &comvar("user", "who am i", ""); - if (exists $identify{"user"}) { - $identify{"user"} =~ s/\s.*//; - } - &comvar("c_version", "gcc -v", "version"); - &comvar("OS", "uname", ""); - &comvar("arch", "uname -a", ""); -} diff --git a/mps/qa/test/script/require b/mps/qa/test/script/require deleted file mode 100644 index 4bc5e877ad9..00000000000 --- a/mps/qa/test/script/require +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/local/perl -# $HopeName: MMQA_harness!script:require(trunk.7) $ -# -# require all the qa harness pl files -# -# should have no side effects, except for compiling some functions, -# and setting some base values of variables - -require "version"; -require "useful"; -require "display"; -require "logging"; -require "compile"; -require "headread"; -require "runtest"; -require "clib"; - -require "dirs"; -require "platform"; - -require "optproc"; -require "options"; - -require "init"; - -1; - diff --git a/mps/qa/test/script/runtest b/mps/qa/test/script/runtest deleted file mode 100644 index 161910ad6b3..00000000000 --- a/mps/qa/test/script/runtest +++ /dev/null @@ -1,264 +0,0 @@ -#!/usr/local/perl -# $HopeName: MMQA_harness!script:runtest(trunk.22) $ -# -# provides subroutines to run tests and testsets -# - -1; - -# general routines first - -sub mpslibvers { - local ($exefile) = @_; - - %mpslibvers = ( - "product", "unknown", - "platform", "unknown", - "variety", "unknown", - "compilation", "unknown", - "release", "unknown"); - - $_ = &convdirseps("$stringscommand $exefile|"); - &debug("OPEN >>$_<<"); - - if (open(STRINGS, $_)) { - while () { - if (/HQNMPS/) { - if (/product\.(\w+)/) { $mpslibvers{"product"} = $1; } - if (/variety\.(\w+)/) { $mpslibvers{"variety"} = $1; } - if (/platform\.(\w+)/) { $mpslibvers{"platform"} = $1; } -# the \b in the next line is just to stop hope from expanding the RCS keyword - if (/\$\bHopeName:\s+([^\$]+)\s*\$\s*([^,]+)/) { - $mpslibvers{"hopeversion"} = $1; - $mpslibvers{"release"} = $2; - } - if (/(release\.[A-Za-z0-9_.:-]*\w)/) { $mpslibvers{"release"} = $1; } - if (/compiled on (.+)$/) { $mpslibvers{"compilation"} = $1; } - } - } - close STRINGS; - } -} - -# file, "yes", "result" for try -# file, "no", "full" for run - -sub run_exe { - local ($exefile, $interact, $stdin) = @_; - - $identify{"time"} = localtime; - &mpslibvers($exefile.$exesuff); - &log_system($exefile, $interact, $testlogfile, $stdin); - &read_results($testlogfile); - if ($compoutput) { - $real_output{'cl_out'} = $compoutput; - } - &verdict; -} - -sub setstdin { - local ($stdin); - $stdin = $STDIN; - if (!defined $stdin || $stdin eq "") { - if ($test_header{"stdin"}) { - $stdin = $DATA_DIR."/".$test_header{"stdin"}; - } - } - if (!defined $stdin || $stdin eq "") { - $stdin = "STDIN"; - } - return $stdin; -} - -sub run_test { - local ($testfile, $interact, $report_type, $logfile) = @_; - my $missingSymbols; - - &readheader($testfile, 1); - - unless (vleq($test_header{"harness"}, $HARNESS_VERSION)) { - die "This test requires version $test_header{\"harness\"} or later of the MMQA harness. -(You are using version $HARNESS_VERSION.)\n"; - } - - for $lang ($test_header{"language"}) { - - if ($lang =~ /^c$/) { - unless ($DANGEROUS eq "on") { - $_ = &test_clib(); - if ($_) { - print "Warning: $_\n"; - die "-- recompile test libraries (\"qa clib\") before running tests.\n"; - } - } - $missingSymbols = &missingTestSymbols($testfile); - - if ($DANGEROUS ne "on" && @$missingSymbols) { - my $i; - - %real_output = - ("seconds", 0, - "error", "true", - "errtext", "missing symbols"); - - for ($i = 0; $i < @$missingSymbols; $i++) { - $real_output{"missing".($i+1)} = $$missingSymbols[$i]; - } - - $testtimeline = "*"; - $testconclusion = "FAIL"; - $testconcreason = "missing symbols"; - - } else { - - $stdin = &setstdin; - $linkfiles = $test_header{"link"}; - $objfile = "$obj_dir/tmp_test"; - if (&compile_and_link($testfile, $objfile, $linkfiles)) { - $testlogfile = "$obj_dir/tmp_log.log"; - &run_exe($objfile, $interact, $stdin); - } else { - %real_output = - ("seconds", 0, - "error", "true", - "cl_out", $compoutput, - "errtext", "compilation failed"); - $testtimeline = "*"; - $testconclusion = "FAIL"; - $testconcreason = "compilation failed"; - } - } - - &describe_test($report_type); - open(LOG_RESULTS, ">".$logfile); - &describe_test("verbose", LOG_RESULTS); - close(LOG_RESULTS); - last; - }; - - if ($lang =~ /^english$/) { - print "Manual test -- you'll have to do it yourself.\n\n"; - &display_test_source($testfile, STDOUT, 75); - last; - }; - - die "Don't know how to run tests in the $lang language.\n"; - } -} - -sub run_from_testset { - local ($testfile) = @_; - my $missingSymbols; - - &readheader($testfile, 1); - if ($test_header{"language"} ne "c") { - &logcomment("Skipping test $testfile: don't know how to run it in batch mode."); - $testsetresults{$testfile}="/"; - } elsif (!vleq($test_header{"harness"}, $HARNESS_VERSION)) { - &logcomment("Skipping test $testfile: needs newer harness."); - $testsetresults{$testfile}="/"; - } else { - $missingSymbols = &missingTestSymbols($testfile); - - if ($DANGEROUS ne "on" && @$missingSymbols) { - my $i; - - %real_output = - ("seconds", 0, - "error", "true", - "errtext", "missing symbols"); - - for ($i = 0; $i < @$missingSymbols; $i++) { - $real_output{"missing".($i+1)} = $$missingSymbols[$i]; - } - - $testtimeline = "*"; - $testconclusion = "FAIL"; - $testconcreason = "missing symbols"; - &describe_test("summary"); - &describe_test("summary", LOG_SUMMARY); - &describe_test("results", LOG_RESULTS); - &describe_test("results", LOG_FULL); - } else { - $stdin = &setstdin; - $linkfiles = $test_header{"link"}; - $objfile = "$obj_dir/tmp_test"; - $testlogfile = "$obj_dir/tmp_log.log"; - - if (&compile_and_link($testfile, $objfile, $linkfiles)) { - &run_exe($objfile, "no", $stdin); - &describe_test("summary"); - &describe_test("summary", LOG_SUMMARY); - &describe_test("results", LOG_RESULTS); - &describe_test("full", LOG_FULL); - } else { - %real_output = - ("seconds", 0, - "error", "true", - "cl_out", $compoutput, - "errtext", "compilation failed"); - $testtimeline = "*"; - $testconclusion = "FAIL"; - $testconcreason = "compilation failed"; - &describe_test("summary"); - &describe_test("summary", LOG_SUMMARY); - &describe_test("results", LOG_RESULTS); - &describe_test("results", LOG_FULL); - } - } - if ($testconclusion eq "PASS") { - $testsetresults{$testfile}="."; - } else { - $testsetresults{$testfile}="*"; - } - open(LOG_VERBOSE, ">$LOG_DIR/last.log"); - &describe_test("verbose", LOG_VERBOSE); - close(LOG_VERBOSE); - &mailfile("$LOG_DIR/last.log", - "$MAIL_SUBJECT $testid $testconclusion"); - } -} - -sub run_testset { - local ($testsetfile, $logsummfile, $logresfile, $logfullfile) = @_; - - open(TESTSET, $testsetfile) || - die "Failed to open testset $testsetfile."; - - &ensuredir($LOG_DIR); - - %testsetresults = (); - - open(LOG_SUMMARY, ">".$logsummfile); - open(LOG_RESULTS, ">".$logresfile); - open(LOG_FULL, ">".$logfullfile); - &describe_settings(LOG_SUMMARY); - @LOG_FILES = (STDOUT, LOG_SUMMARY, LOG_RESULTS, LOG_FULL); - &logcomment("Test set $testsetfile"); - &logcomment(""); - - unless (&clib) { - &logcomment("Failed to compile libraries."); - } else { - while () { - unless (/(^%)|(^\s*$)/) { - chop; - &run_from_testset($_); - } - } - } - - close(LOG_SUMMARY); - close(LOG_RESULTS); - close(LOG_FULL); - &mailfile($logsummfile, "$MAIL_SUBJECT summary of test set $testsetfile"); -} - - -sub missingTestSymbols { - my ($testfile) = @_; - - &readSymbols(); - return &missingSymbols(&listFileSymbols($testfile)); -} - diff --git a/mps/qa/test/script/useful b/mps/qa/test/script/useful deleted file mode 100644 index 687ede9ea17..00000000000 --- a/mps/qa/test/script/useful +++ /dev/null @@ -1,53 +0,0 @@ -# $HopeName: MMQA_harness!script:useful(trunk.1) $ -# Various subroutines that the MMQA harness finds useful. -# - -1; - -sub debug { - local ($text) = @_; - if ($DEBUG_INFO eq "on") { - print $text."\n"; - } -} - -sub mysystem { - local ($command) = @_; - $command = &convdirseps($command); - &debug("SYSTEM >>$command<<"); - system($command); -} - -sub convdirseps { - local ($a) = @_; - $a =~ s/(\S)\//$1$dirsep/g; - return $a; -} - -sub mailfile { - local ($file, $subj) = @_; - - if ($MAIL_RESULTS eq "on") { - &$platmailfile($file, $MAIL_TO, $subj); - } -} - -# -# comparison of harness version numbers -# - -sub vleq { - local ($a, $b, @a, @b) = @_; - @a = split /\./, $a; - @b = split /\./, $b; - while (defined $a[0] && defined $b[0]) { - if ($a[0] == $b[0]) { - shift @a; shift @b; - } else { - return ($a[0] < $b[0]); - } - } - if (! defined $a[0]) { $a[0] = -1 } - if (! defined $b[0]) { $b[0] = -1 } - return ($a[0] <= $b[0]); -} diff --git a/mps/qa/test/script/version b/mps/qa/test/script/version deleted file mode 100644 index 16fed7cdd69..00000000000 --- a/mps/qa/test/script/version +++ /dev/null @@ -1,36 +0,0 @@ -# $HopeName: MMQA_harness!script:version(trunk.15) $ -# This file should be updated whenever the test harness changes. -# Edit with care! - -$HARNESS_VERSION="3.5"; - -# Version history: -# [Recorded history begins with version 2.0] -# -# 2.0 -- First numbered harness version. Before this tests didn't -# know what they required. -# 2.1 -- Addition of interface version HU. 1999-02-17 -# 2.2 -- Option display no longer prints "MMQA_" before each, as -# first column was getting too narrow for option names. -# 2.3 -- Changed link settings on Intel NT, to link with MSVCRT and not -# any other defaultlib. -# 2.4 -- Changed to use "/usr/lib/sendmail" on unix platforms. -# Made easy_tramp2 static. -# Added mmqa_arena_create function. -# 2.5 -- Added quoting for -Dparm=value options to compiler. Needed -# because some tests have e.g. value = (size_t)1024. -# 2.6 -- "qa help install" added, after drj asked for it -# -# 3.0 -- scrutinize MPS header files, extracting symbols. Record settings -# and other info at time of clib, and check before running tests. -# INTERFACE_VERSION removed. DANGEROUS added. 1999-05-04 -# 3.1 -- clib now takes notes of compilation failures, and records in -# the record whether it succeeded or not -# 3.2 -- better settings for platform nt_x86_cap -# 3.3 -- interface checks on individual tests (symbols only) -# capture of compiler errors -# improved display of long output and output containing newlines -# 3.3.1: fix bug in reporting compiler errors when compilation -# _succeeds_ -# 3.4 -- Added P= (pathname equality) operator -# 3.5 -- Platform detection based on uname; Linux and Mac OS X stuff diff --git a/mps/qa/test/testlib/arg.h b/mps/qa/test/testlib/arg.h deleted file mode 100644 index ed35120d8a4..00000000000 --- a/mps/qa/test/testlib/arg.h +++ /dev/null @@ -1,36 +0,0 @@ -/* $HopeName: MMQA_harness!testlib:arg.h(trunk.2) $ -arg.h - useful things for arg-err tests -*/ - -#ifndef arg_h -#define arg_h - -#include "testlib.h" - -#define UNALIGNED ((mps_addr_t) (((char *) NULL) + 1)) - -#define MPS_RANK_MIN 0 -#define MPS_RANK_MAX 3 - -#define MPS_RM_MIN 0 -#define MPS_RM_MAX 3 - -#define MPS_ALIGN_MIN 1 - -/* possibly nasty values with high bits set */ - -#define HIGHBIT_CHAR (~(((unsigned char) -1) >> 1)) -#define HIGHBIT_INT (~(((unsigned int) -1) >> 1)) -#define HIGHBIT_SHORT (~(((unsigned short) -1) >> 1)) -#define HIGHBIT_LONG (~(((unsigned long) -1) >> 1)) -#define HIGHBIT_SIZE (~((~ (size_t) 0) >> 1)) - -/* n.b. the last line above will work in ansi C because - size_t is an unsigned type. In sos libs, size_t, however - is a signed type; it still works tho', because in sos, - >> on a negative value is a logical (not arithmetical) shift. -*/ - -#endif - diff --git a/mps/qa/test/testlib/assumed b/mps/qa/test/testlib/assumed deleted file mode 100644 index f824ffdacfe..00000000000 --- a/mps/qa/test/testlib/assumed +++ /dev/null @@ -1,31 +0,0 @@ -% $HopeName: MMQA_harness!testlib:assumed(trunk.2) $ -% -% Symbols listed here will be assumed by the harness to be available for -% tests to use, even if they're not present in mps header files. -% -% If you define macros to cover for symbols that aren't defined, you need -% to list them here -% -mps_space_clamp -mps_arena_clamp -mps_space_release -mps_arena_release -mps_space_collect -mps_arena_collect -mps_space_park -mps_arena_park -mps_space_reserved -mps_arena_reserved -mps_space_committed -mps_arena_committed -mps_space_destroy -mps_arena_destroy -mps_space_t -mps_arena_t -mps_arena_spare_committed -mps_arena_spare_commit_limit -mps_arena_spare_commit_limit_set -mps_gen_param_s -mps_chain_t -mps_chain_create -mps_chain_destroy diff --git a/mps/qa/test/testlib/awlfmt.c b/mps/qa/test/testlib/awlfmt.c deleted file mode 100644 index 9092618959e..00000000000 --- a/mps/qa/test/testlib/awlfmt.c +++ /dev/null @@ -1,566 +0,0 @@ -/* $HopeName: MMQA_harness!testlib:awlfmt.c(trunk.4) $ -awlfmt.c - A format simlar to newfmt, but for the awl pool -*/ - -#include "awlfmt.h" -#include - -/* some options on the format are controlled by global - variables. Of course for efficiency we'd do it in the - pre-processor, but that would require recompilation... - -*/ - -int formatcomments=0; -int checkcomments=0; -int countcomments=1; -int alloccomments=0; -int fixcomments=0; -int deathcomments=1; -int skipcomments=0; -int splurgeassoc=0; /* write madly to associated objects */ - -long int nextid=0x1000000; - -long int checkobjcount=0; - -enum -{ - SCANCALL_COUNT, - SCANOBJ_COUNT, /* = #objects scanned (real ones, that is) */ - SCANPAD_COUNT, /* = #pads scanned */ - SCANHEART_COUNT, - COPY_COUNT, - SKIP_COUNT, - FWD_COUNT, - ISFWD_COUNT, - RESERVE_COUNT, - ALLOC_COUNT, - DYING_REFERENCE_COUNT, - PAD_COUNT /* this one must come last or the arrays will be too small */ -}; - -int counters[PAD_COUNT+1]; -int prevcounters[PAD_COUNT+1]; -int maxcounters[PAD_COUNT+1] = {0}; - -static long int maxcopy = 0; -static int freeze=0; - -/* The AWL pool makes certain assumptions about the object format, - some necessary and some unnecessary but useful for detecting problems - when using fmtdy. We have to ensure that: - - Each objects begins with a pointer to a wrapper. To tag objects, - use non-zero values for the low bits. - The second word in each object is a pointer to the associated object, - usual rules for references apply. - - The wrapper begins with a wrapper-wrapper pointer, and the third word - of the wrapper object has bit 0 set and bit 1 clear and at least one higher - bit also set. The fourth word is the same, to cater for the new Dylan - object format used by honeybee.3 and later releases. - - The wrapper-wrapper's first word points to itself. - - Here I make the wrapper-wrapper equal to the wrapper for all objects, - and use the same wrapper for all objects. -*/ - -struct wrapper { - struct wrapper *ww; - mps_word_t tag; - mps_word_t fixedlen; - mps_word_t newfixedlen; -}; - -struct wrapper wrapobj = { - &wrapobj, - 0x36ABBE6, - 0x5, - 0x5 -}; - -mycell *wrapper = (mycell *) &wrapobj; - -#define INCCOUNT(c) do {if(!freeze) counters[c]+=1;} while (0) -#define INCCOUNTIF(f, c) do {if(f) INCCOUNT(c);} while (0) - -/* a cell can be one of four things, depending on its type: - MCpad - a pad item - MCheart - a broken heart, aka forwarding object - MCdata - a real object -*/ - -/* the scanning function doesn't try to fix null refs -*/ - -static mps_res_t myscan(mps_ss_t ss, mps_addr_t base, mps_addr_t limit); -static mps_addr_t myskip(mps_addr_t object); -static void myfwd(mps_addr_t object, mps_addr_t to); -static mps_addr_t myisfwd(mps_addr_t object); -static void mycopy(mps_addr_t object, mps_addr_t to); -static void mypad(mps_addr_t base, size_t size); - -struct mps_fmt_A_s fmtA = -{ - MPS_PF_ALIGN, - &myscan, - &myskip, - &mycopy, - &myfwd, - &myisfwd, - &mypad -}; - -/* in the following, size is the number of refs you want - the allocated object to have -*/ - -mycell *allocdumb(mps_ap_t ap, size_t size, int countflag) -{ - mps_addr_t p; - mycell *q; - size_t bytes; - size_t alignment; - - bytes = offsetof(struct data, ref) + size; - - alignment = MPS_PF_ALIGN; /* needed to make it as wide as size_t */ - -/* twiddle the value of size to make it aligned */ - bytes = (bytes+alignment-1) & ~(alignment-1); - - do - { - die(mps_reserve(&p, ap, bytes), "Reserve: "); - INCCOUNTIF(countflag, RESERVE_COUNT); - q=p; - q->data.tag = (mps_word_t) wrapper; - q->data.assoc = NULL; - q->data.id = nextid; - q->data.copycount = 0; - q->data.numrefs = 0; - q->data.checkedflag = 0; - q->data.countflag = countflag; - q->data.size = bytes; - } - while (!mps_commit(ap, p, bytes)); - INCCOUNTIF(countflag, ALLOC_COUNT); - commentif(alloccomments, "allocated id %li at %p.", nextid, q); - nextid += 1; - - return q; -} - -mycell *allocone(mps_ap_t ap, int size, int countflag) -{ - mps_addr_t p; - mycell *q; - int i; - size_t bytes; - size_t alignment; - - bytes = offsetof(struct data, ref) + size*sizeof(struct refitem); - - alignment = MPS_PF_ALIGN; /* needed to make it as wide as size_t */ - -/* twiddle the value of size to make it aligned */ - bytes = (bytes+alignment-1) & ~(alignment-1); - - do - { - die(mps_reserve(&p, ap, bytes), "Reserve: "); - INCCOUNTIF(countflag, RESERVE_COUNT); - q=p; - q->data.tag = MCdata + (mps_word_t) wrapper; - q->data.assoc = NULL; - q->data.id = nextid; - q->data.copycount = 0; - q->data.numrefs = size; - q->data.checkedflag = 0; - q->data.countflag = countflag; - q->data.size = bytes; - - for(i=0; idata.ref[i].addr = NULL; - q->data.ref[i].id = 0; - } - } - while (!mps_commit(ap, p, bytes)); - INCCOUNTIF(countflag, ALLOC_COUNT); - commentif(alloccomments, "allocated id %li at %p.", nextid, q); - nextid += 1; - - return q; -} - -static mps_res_t myscan(mps_ss_t ss, mps_addr_t base, mps_addr_t limit) -{ - int i; - - INCCOUNT(SCANCALL_COUNT); - MPS_SCAN_BEGIN(ss) - { - while (base < limit) - { - mycell *obj = base; - mps_res_t res; - mps_addr_t p; - - switch (obj->tag & 0x3) - { - case MCpad: - INCCOUNT(SCANPAD_COUNT); - base = (mps_addr_t) (obj->pad.tag &~ (mps_word_t) 3); - break; - case MCdata: - /* actual scanning is done in here */ - asserts(obj->tag == MCdata + (mps_word_t) wrapper, "scan on bad object"); - asserts(obj->data.id != MCerrorid, "scan on error object"); - INCCOUNTIF(obj->data.countflag, SCANOBJ_COUNT); - commentif(formatcomments, "scan %li at %p.", obj->data.id, base); - - /* make sure to fix the assoc pointer first */ - p = obj->data.assoc; - if (p != NULL) { - commentif(fixcomments, "fix %li[assoc]", obj->data.id); - res = MPS_FIX(ss, (mps_addr_t *) &p); - if (res != MPS_RES_OK) return res; - if (p == NULL) { - commentif(deathcomments, "fixed %li[assoc] to NULL", obj->data.id); - INCCOUNTIF(obj->data.countflag, DYING_REFERENCE_COUNT); - } - obj->data.assoc = p; - } - - for (i=0; i<(obj->data.numrefs); i++) - { - p = obj->data.ref[i].addr; - if (p != NULL) - { - /* copy ref to p for fixing, to avoid a pun (although - the pun would probably work fine almost everywhere) - */ - commentif(fixcomments, "fix %li[%i] -> %li", - obj->data.id, i, obj->data.ref[i].id); - res = MPS_FIX(ss, (mps_addr_t *) &p); - if (p == NULL) { - commentif(deathcomments, "fixed %li[%i] to NULL", obj->data.id, i); - INCCOUNTIF(obj->data.countflag, DYING_REFERENCE_COUNT); - } - if (res != MPS_RES_OK) return res; - obj->data.ref[i].addr = p; - } - } - base = (mps_addr_t) ((char *) obj + (obj->data.size)); - break; - case MCheart: - INCCOUNT(SCANHEART_COUNT); - base = (mps_addr_t) ((char *) obj + (obj->heart.size)); - break; - default: - asserts(0, "scan: bizarre obj tag at %p.", obj); - } - } - } - MPS_SCAN_END(ss); - return MPS_RES_OK; -} - -static mps_addr_t myskip(mps_addr_t object) -{ - mycell *obj = object; - - commentif(skipcomments, "skip %p.", object); - INCCOUNT(SKIP_COUNT); - switch(obj->tag & 0x3) - { - case MCpad: - return (mps_addr_t) (obj->pad.tag &~ (mps_word_t) 0x3); - case MCheart: - return (mps_addr_t) ((char *) obj + (obj->heart.size)); - case MCdata: - asserts(obj->tag == MCdata + (mps_word_t) wrapper, - "skip on bad obj at %p.", obj); - return (mps_addr_t) ((char *) obj + (obj->data.size)); - default: - asserts(0, "skip: bizarre obj tag at %p.", obj); - return 0; /* not reached */ - } -} - -static void mycopy(mps_addr_t object, mps_addr_t to) -{ - mycell *boj = object; - mycell *toj = to; - - asserts(boj->tag == MCdata + (mps_word_t) wrapper, - "copy: non-data object"); - - INCCOUNTIF(boj->data.countflag, COPY_COUNT); - commentif(formatcomments, "copy: %li: %p -> %p\n", - boj->data.id, object, to); - -/* this line would be bad, because the objects might overlap, - and then C doesn't guarantee to do the right thing! - - *toj = *boj; -*/ - - memmove(to, object, boj->data.size); - if (!freeze) - { - toj->data.copycount = (toj->data.copycount)+1; - if (toj->data.copycount > maxcopy) maxcopy = toj->data.copycount; - } -} - -/* pad stores not its size but a pointer to the next object, - because we know we'll never be asked to copy it -*/ - -static void mypad(mps_addr_t base, size_t size) -{ - mycell *obj = base; - - asserts(size >= MPS_PF_ALIGN, "pad: size too small."); - - INCCOUNT(PAD_COUNT); - obj->pad.tag = MCpad + (mps_word_t) ((char *) base + size); -} - -static mps_addr_t myisfwd(mps_addr_t object) -{ - mycell *obj = object; - - INCCOUNT(ISFWD_COUNT); - if ((obj->tag & 3) != MCheart) - { - return NULL; - } - else - { - return obj->heart.obj; - } -} - -static void myfwd(mps_addr_t object, mps_addr_t to) -{ - mycell *obj = object; - size_t size; - - asserts(((obj->tag & 3) == MCdata) || ((obj->tag & 3) == MCheart), - "fwd: unexpected object tag at %p.", obj); - INCCOUNT(FWD_COUNT); - - if ((obj->tag & 3) == MCdata) - { - asserts(obj->tag == MCdata + (mps_word_t) wrapper, - "fwd: bad obj at %p.", obj); - size = obj->data.size; - } - else /* obj->tag == MCheart */ - { - size = obj->heart.size; - } - obj->data.tag = MCheart; - obj->heart.obj = to; - obj->heart.size = size; -} - - -/* --------------------------------------------------------------- - Access methods for mycell objects -*/ - -/* set the nth reference of obj to to (n from 0 to size-1) */ - -void setref(mycell *obj, int n, mycell *to) -{ - asserts(obj->tag == MCdata + (mps_word_t) wrapper, - "setref: from non-data object at %p", obj); - asserts((to==NULL)||((to->tag & 3) == MCdata), - "setref: to non-data object at %p", to); - asserts(obj->data.numrefs > n, "setref: access beyond object size."); - - obj->data.ref[n].addr = to; - obj->data.ref[n].id = (to==NULL ? 0 : to->data.id); -} - -mycell *getref(mycell *obj, int n) -{ - asserts(obj->tag == MCdata + (mps_word_t) wrapper, - "getref: from non-data object."); - asserts(obj->data.numrefs > n, "getref: access beyond object size."); - return obj->data.ref[n].addr; -} - -mps_addr_t getdata(mycell *obj) -{ - return (mps_addr_t) &(obj->data.ref[0]); -} - -long int getid(mycell *obj) -{ - asserts(obj->tag == MCdata + (mps_word_t) wrapper, - "getid: non-data object."); - return obj->data.id; -} - -long int getcopycount(mycell *obj) -{ - asserts(obj->tag == MCdata + (mps_word_t) wrapper, - "getcopycount: non-data object."); - return obj->data.copycount; -} - -long int getsize(mycell *obj) -{ - asserts(obj->tag == MCdata + (mps_word_t) wrapper, - "getsize: non-data object."); - return obj->data.numrefs; -} - -/* --------------------------------------------------------------- - Now the useful things specially for checking the graph -*/ - -/* recursively check the graph, starting at an object. - We do the check twice, so as to restore the - checkflags to zero. -*/ - -static void checkloop(mycell *obj, int dir) -{ - mycell *toj; - int tid; - int i; - - asserts(obj->tag == MCdata + (mps_word_t) wrapper, - "checkfrom: non data object in graph at %p.", obj); - - if (obj->data.checkedflag != dir) - { - commentif(checkcomments, "checking %p = %li", obj, obj->data.id); - - checkobjcount += 1; - - obj->data.checkedflag = dir; - - if (obj->data.assoc != NULL) { - toj = obj->data.assoc; - checkloop(toj, dir); - } - for (i=0; i<(obj->data.numrefs); i+=1) - { - if (obj->data.ref[i].addr != NULL) - { - toj = (obj->data.ref[i].addr); - tid = (obj->data.ref[i].id); - asserts(toj->data.id == tid, - "checkfrom: corrupt graph at %p, %d.", obj, i); - checkloop(toj, dir); - } - } - } -} - -void checkfrom(mycell *obj) -{ - int k; - - freeze = 1; /* suspend counting while checking graph */ - checkobjcount = 0; - checkloop(obj, 1); - comment("checkfrom: %li live objects checked", checkobjcount); - k = checkcomments; - checkcomments = 0; - checkloop(obj, 0); - checkcomments = k; - comment("checkfrom: graph ok from ID: %li.", obj->data.id); - freeze = 0; /* resume counting */ -} - -/* ---------------------------------------------------------- - Now things to reset and display the counters -*/ - -void resetcounters(void) -{ - int i; - for (i=0; i < PAD_COUNT+1; i++) - { - counters[i]=0; - prevcounters[i]=0; - maxcounters[i]=0; - } - maxcopy = 0; -} - -void updatecounters(void) -{ - int i; - for (i=0; i < PAD_COUNT+1; i++) - { - if (counters[i]-prevcounters[i] > maxcounters[i]) - { - maxcounters[i]=counters[i]-prevcounters[i]; - } - prevcounters[i]=counters[i]; - } -} - - -static void d_c(int i, char *name) -{ - comment("%10d %s", counters[i], name); -} - -static void d_mc(int i, char *name) -{ - comment("%10d %s", maxcounters[i], name); -} - -void displaycounters(void) -{ - comment("--------"); - comment("Counters:"); - d_c(SCANCALL_COUNT, "scan calls"); - d_c(SCANOBJ_COUNT, "object scans"); - d_c(SCANHEART_COUNT, "heart scans"); - d_c(SCANPAD_COUNT, "pad scans"); - d_c(COPY_COUNT, "copys"); - d_c(SKIP_COUNT, "skips"); - d_c(FWD_COUNT, "fwds"); - d_c(ISFWD_COUNT, "isfwds"); - d_c(PAD_COUNT, "pads"); - d_c(RESERVE_COUNT, "reserve calls"); - d_c(ALLOC_COUNT, "allocations"); - d_c(DYING_REFERENCE_COUNT, "references fixed to NULL"); - comment("--------"); -} - -void displaymaxcounters(void) -{ - comment("--------"); - comment("Maximum counter values:"); - d_mc(SCANCALL_COUNT, "scan calls"); - d_mc(SCANOBJ_COUNT, "object scans"); - d_mc(SCANHEART_COUNT, "heart scans"); - d_mc(SCANPAD_COUNT, "pad scans"); - d_mc(COPY_COUNT, "copys"); - d_mc(SKIP_COUNT, "skips"); - d_mc(FWD_COUNT, "fwds"); - d_mc(ISFWD_COUNT, "isfwds"); - d_mc(RESERVE_COUNT, "reserve calls"); - d_mc(ALLOC_COUNT, "allocations"); - d_mc(DYING_REFERENCE_COUNT, "references fixed to NULL"); - d_mc(PAD_COUNT, "pads"); - comment("--------"); - comment("max copies of a single object: %li.", maxcopy); - comment("--------"); -} - diff --git a/mps/qa/test/testlib/awlfmt.h b/mps/qa/test/testlib/awlfmt.h deleted file mode 100644 index 7a3c4f40c23..00000000000 --- a/mps/qa/test/testlib/awlfmt.h +++ /dev/null @@ -1,89 +0,0 @@ -/* $HopeName: MMQA_harness!testlib:awlfmt.h(trunk.2) $ -awlfmt.h - A format for the awl pool -*/ - -#ifndef awlfmt_h -#define awlfmt_h - -#include "testlib.h" - -extern int formatcomments; -extern int checkcomments; -extern int countcomments; -extern int alloccomments; -extern int fixcomments; -extern int deathcomments; -extern int skipcomments; -extern int splurgeassoc; /* write to associated objects (but don't change) */ - -/* the object format is visible so tests that want to - can hack around with it -*/ - -#define MAXSIZE 10000 - -enum {MCpad=(int) 0x1, MCheart=(int) 0x2, MCdata=(int) 0x0}; - -enum {MCerrorid=(int) 0xE6606}; - -/* n.b. MCerrorid < 0x1000000 so it won't clash with id of - any ordinary object -*/ - -typedef union mycell mycell; - -typedef mps_word_t tag; - -struct pad {tag tag;}; - -struct heart {tag tag; mps_addr_t obj; size_t size;}; - -struct data -{ - tag tag; - mycell *assoc; - size_t size; - long int id; - long int copycount; - long int numrefs; - int checkedflag; - int countflag; - struct refitem {mycell *addr; long int id;} ref[MAXSIZE]; -}; - -union mycell -{ - tag tag; - struct pad pad; - struct heart heart; - struct data data; -}; - -extern struct mps_fmt_A_s fmtA; - -mycell *allocone(mps_ap_t ap, int size, int countflag); -mycell *allocdumb(mps_ap_t ap, size_t bytes, int countflag); - -mps_addr_t getdata(mycell *obj); -void setref(mycell *obj, int n, mycell *to); -mycell *getref(mycell *obj, int n); - -long int getid(mycell *obj); -long int getcopycount(mycell *obj); -long int getsize(mycell *obj); - -void checkfrom(mycell *obj); - -#define RC resetcounters() -#define UC updatecounters() -#define DC displaycounters() -#define DMC displaymaxcounters() - -void resetcounters(void); -void updatecounters(void); -void displaycounters(void); -void displaymaxcounters(void); - -#endif - diff --git a/mps/qa/test/testlib/epvmfmt.c b/mps/qa/test/testlib/epvmfmt.c deleted file mode 100644 index 66601ec57f1..00000000000 --- a/mps/qa/test/testlib/epvmfmt.c +++ /dev/null @@ -1,141 +0,0 @@ -/* $HopeName: MMQA_harness!testlib:epvmfmt.c(trunk.6) $ -*/ - -#include "epvmfmt.h" -#include - -int alloccomments = 0; - -/* the scanning function doesn't try to fix null refs -*/ - -static mps_res_t epvmscan(mps_ss_t ss, mps_addr_t base, mps_addr_t limit); -static mps_addr_t epvmskip(mps_addr_t object); -static void epvmfwd(mps_addr_t object, mps_addr_t to); -static mps_addr_t epvmisfwd(mps_addr_t object); -static void epvmcopy(mps_addr_t object, mps_addr_t to); -static void epvmpad(mps_addr_t base, size_t size); - -static mps_res_t epvmscan(mps_ss_t ss, mps_addr_t base, mps_addr_t limit); - -mps_addr_t epvmskip(mps_addr_t object) { -/* error("skip called on EPVM object: %p", object); -*/ - asserts(((unsigned long) object & 7) == 0, - "epvmskip called on unaligned object %p", object); - return (mps_addr_t) ((char *)object + 8); -} - -void epvmfwd(mps_addr_t object, mps_addr_t to) { - error("fwd called on EPVM object: %p -> %p", object, to); -} - -mps_addr_t epvmisfwd(mps_addr_t object) { - error("isfwd called on EPVM object: %p", object); - return NULL; -} - -void epvmcopy(mps_addr_t object, mps_addr_t to) { - error("copy called on EPVM object: %p -> %p", object, to); -} - -void epvmpad(mps_addr_t base, size_t size) { - error("pad called in EPVM: %p, %u", base, size); -} - -struct mps_fmt_A_s fmtepvm = -{ - (mps_align_t) 8, - &epvmscan, - &epvmskip, - &epvmcopy, - &epvmfwd, - &epvmisfwd, - &epvmpad -}; - -/* in the following, size is the number of words you want - to allocate -*/ - -psobj *allocepvm(mps_ap_t ap, int size) { - psobj *a; - die(allocrepvm(&a, ap, size), "Reserve: "); - return a; -} - -mps_res_t allocrepvm(psobj **q, mps_ap_t ap, int size) { - mps_addr_t p; - int i; - size_t bytes; - mps_res_t res; - - asserts(sizeof(struct psobj) == 8, "Aaarg! How can EPVM pools possibly work"); - bytes = size*8; - - asserts(size > 0, "allocepvm with zero size"); - - do - { - res = mps_reserve(&p, ap, bytes); - if (res != MPS_RES_OK) { - return res; - } - *q=p; - - for(i=0; iobj = NULL; - (*q+i)->size = 0; - } - } - while (!mps_commit(ap, p, bytes)); - commentif(alloccomments, "allocated %p.", q); - - return MPS_RES_OK; -} - -void splatepvm(psobj *obj) { - obj->size = 0; -} - -mps_bool_t issplatepvm(psobj *obj) { - return (obj->size == 0); -} - -static mps_res_t epvmscan(mps_ss_t ss, mps_addr_t base, mps_addr_t limit) -{ - unsigned int i; - - MPS_SCAN_BEGIN(ss) - { - while (base < limit) - { - psobj *obj = base; - mps_res_t res; - mps_addr_t p; - - commentif(alloccomments, "scan %p", base); - - asserts(obj->size > 0, "scan on splatted object at %p", obj); - - p = obj->obj; - asserts(p != NULL, "NULL pointer in EPVM obj at %p", obj); - res = MPS_FIX(ss, (mps_addr_t *) &p); /* A ghastly PUN! */ - if (res != MPS_RES_OK) return res; - asserts(p != NULL, "reference in EPVM fixed to NULL at %p", obj); - obj->obj = p; - - for (i=1; isize; i++) { - p = obj->obj + i; - res = MPS_FIX(ss, (mps_addr_t *) &p); - if (res != MPS_RES_OK) return res; - asserts(p == obj->obj+i, "reference in EPVM changed at %p", obj); - } - base = (char *) base + 8; - } - } - MPS_SCAN_END(ss); - return MPS_RES_OK; -} - diff --git a/mps/qa/test/testlib/epvmfmt.h b/mps/qa/test/testlib/epvmfmt.h deleted file mode 100644 index 893227e4100..00000000000 --- a/mps/qa/test/testlib/epvmfmt.h +++ /dev/null @@ -1,40 +0,0 @@ -/* $HopeName: MMQA_harness!testlib:epvmfmt.h(trunk.4) $ -epvmfmt.h - Format for objects in the EPVM pool. -*/ - -#ifndef epvmfmt_h -#define epvmfmt_h - -#include "testlib.h" - -extern int alloccomments; - -/* the counters are visible so that I can check whether things - get moved etc -*/ - -/* the object format is visible so tests that want to - can hack around with it -*/ - - -typedef struct psobj psobj; - -struct psobj { - psobj *obj; - mps_word_t size; -}; - -extern struct mps_fmt_A_s fmtepvm; - -psobj *allocepvm(mps_ap_t ap, int words); - -mps_res_t allocrepvm(psobj **, mps_ap_t ap, int words); - -void splatepvm(psobj *obj); - -mps_bool_t issplatepvm(psobj *obj); - -#endif - diff --git a/mps/qa/test/testlib/exfmt.c b/mps/qa/test/testlib/exfmt.c deleted file mode 100644 index f073fa22461..00000000000 --- a/mps/qa/test/testlib/exfmt.c +++ /dev/null @@ -1,553 +0,0 @@ -/* $HopeName: MMQA_harness!testlib:exfmt.c(trunk.4) $ -exfmt.c - A format for the awl and amc pools which can cope with exact references - See comments in header file for usage. -*/ - -#include "exfmt.h" -#include - -/* some options on the format are controlled by global - variables. Of course for efficiency we'd do it in the - pre-processor, but that would require recompilation... - -*/ - -int formatcomments=0; -int checkcomments=0; -int countcomments=1; -int alloccomments=0; -int fixcomments=0; -int deathcomments=1; -int skipcomments=0; -int splurgeassoc=0; /* write madly to associated objects */ - -long int nextid=0x1000000; - -long int checkobjcount=0; - -mps_addr_t exfmt_root=NULL; - -int counters[PAD_COUNT+1] = {0}; -int prevcounters[PAD_COUNT+1] = {0}; -int maxcounters[PAD_COUNT+1] = {0}; - -long int maxcopy = 0; -int freeze=0; - -/* The AWL pool makes certain assumptions about the object format, - some necessary and some unnecessary but useful for detecting problems - when using fmtdy. We have to ensure that: - - Each objects begins with a pointer to a wrapper. To tag objects, - use non-zero values for the low bits. - The second word in each object is a pointer to the associated object, - usual rules for references apply. - - The wrapper begins with a wrapper-wrapper pointer, and the third word - of the wrapper object has bit 0 set and bit 1 clear and at least one higher - bit also set. The fourth word is the same, to cater for the new Dylan - object format used by honeybee.3 and later releases. - - The wrapper-wrapper's first word points to itself. - - Here I make the wrapper-wrapper equal to the wrapper for all objects, - and use the same wrapper for all objects. - - The other pools don't care about the wrapper, of course. -*/ - -struct wrapper { - struct wrapper *ww; - mps_word_t tag; - mps_word_t fixedlen; - mps_word_t newfixedlen; -}; - -struct wrapper wrapobj = { - &wrapobj, - 0x36ABBE6, - 0x5, - 0x5 -}; - -mycell *wrapper = (mycell *) &wrapobj; - -#define INCCOUNT(c) do {if(!freeze) counters[c]+=1;} while (0) -#define INCCOUNTIF(f, c) do {if(f) INCCOUNT(c);} while (0) - -/* a cell can be one of four things, depending on its type: - MCpad - a pad item - MCheart - a broken heart, aka forwarding object - MCdata - a real object -*/ - -/* the scanning function doesn't try to fix null refs -*/ - -static mps_res_t myscan(mps_ss_t ss, mps_addr_t base, mps_addr_t limit); -static mps_addr_t myskip(mps_addr_t object); -static void myfwd(mps_addr_t object, mps_addr_t to); -static mps_addr_t myisfwd(mps_addr_t object); -static void mycopy(mps_addr_t object, mps_addr_t to); -static void mypad(mps_addr_t base, size_t size); - -struct mps_fmt_A_s fmtA = -{ - MPS_PF_ALIGN, - &myscan, - &myskip, - &mycopy, - &myfwd, - &myisfwd, - &mypad -}; - -/* in the following, size is the number of refs you want - the allocated object to have -*/ - -mycell *allocdumb(mps_ap_t ap, size_t size, int countflag) -{ - mycell *q; - size_t bytes; - size_t alignment; - - bytes = offsetof(struct data, ref) + size; - - alignment = MPS_PF_ALIGN; /* needed to make it as wide as size_t */ - -/* twiddle the value of size to make it aligned */ - bytes = (bytes+alignment-1) & ~(alignment-1); - - do - { - die(mps_reserve(&exfmt_root, ap, bytes), "Reserve: "); - INCCOUNTIF(countflag, RESERVE_COUNT); - q=exfmt_root; - q->data.tag = (mps_word_t) wrapper; - q->data.assoc = NULL; - q->data.id = nextid; - q->data.copycount = 0; - q->data.numrefs = 0; - q->data.checkedflag = 0; - q->data.countflag = countflag; - q->data.size = bytes; - } - while (!mps_commit(ap, exfmt_root, bytes)); - INCCOUNTIF(countflag, ALLOC_COUNT); - commentif(alloccomments, "allocated id %li at %p.", nextid, q); - nextid += 1; - - return q; -} - -mycell *allocone(mps_ap_t ap, int size, int countflag) -{ - mycell *q; - int i; - size_t bytes; - size_t alignment; - - bytes = offsetof(struct data, ref) + size*sizeof(struct refitem); - - alignment = MPS_PF_ALIGN; /* needed to make it as wide as size_t */ - -/* twiddle the value of size to make it aligned */ - bytes = (bytes+alignment-1) & ~(alignment-1); - - do - { - die(mps_reserve(&exfmt_root, ap, bytes), "Reserve: "); - INCCOUNTIF(countflag, RESERVE_COUNT); - q=exfmt_root; - q->data.tag = MCdata + (mps_word_t) wrapper; - q->data.assoc = NULL; - q->data.id = nextid; - q->data.copycount = 0; - q->data.numrefs = size; - q->data.checkedflag = 0; - q->data.countflag = countflag; - q->data.size = bytes; - - for(i=0; idata.ref[i].addr = NULL; - q->data.ref[i].id = 0; - } - } - while (!mps_commit(ap, exfmt_root, bytes)); - INCCOUNTIF(countflag, ALLOC_COUNT); - commentif(alloccomments, "allocated id %li at %p.", nextid, q); - nextid += 1; - - return q; -} - -static mps_res_t myscan(mps_ss_t ss, mps_addr_t base, mps_addr_t limit) -{ - int i; - - INCCOUNT(SCANCALL_COUNT); - MPS_SCAN_BEGIN(ss) - { - while (base < limit) - { - mycell *obj = base; - mps_res_t res; - mps_addr_t p; - - switch (obj->tag & 0x3) - { - case MCpad: - INCCOUNT(SCANPAD_COUNT); - base = (mps_addr_t) (obj->pad.tag &~ (mps_word_t) 3); - break; - case MCdata: - /* actual scanning is done in here */ - asserts(obj->tag == MCdata + (mps_word_t) wrapper, "scan on bad object"); - asserts(obj->data.id != MCerrorid, "scan on error object"); - INCCOUNTIF(obj->data.countflag, SCANOBJ_COUNT); - commentif(formatcomments, "scan %li at %p.", obj->data.id, base); - - /* make sure to fix the assoc pointer first */ - p = obj->data.assoc; - if (p != NULL) { - commentif(fixcomments, "fix %li[assoc]", obj->data.id); - res = MPS_FIX(ss, (mps_addr_t *) &p); - if (res != MPS_RES_OK) return res; - if (p == NULL) { - commentif(deathcomments, "fixed %li[assoc] to NULL", obj->data.id); - INCCOUNTIF(obj->data.countflag, DYING_REFERENCE_COUNT); - } - obj->data.assoc = p; - } - - for (i=0; i<(obj->data.numrefs); i++) - { - p = obj->data.ref[i].addr; - if (p != NULL) - { - /* copy ref to p for fixing, to avoid a pun (although - the pun would probably work fine almost everywhere) - */ - commentif(fixcomments, "fix %li[%i] -> %li", - obj->data.id, i, obj->data.ref[i].id); - res = MPS_FIX(ss, (mps_addr_t *) &p); - if (p == NULL) { - commentif(deathcomments, "fixed %li[%i] to NULL", obj->data.id, i); - INCCOUNTIF(obj->data.countflag, DYING_REFERENCE_COUNT); - } - if (res != MPS_RES_OK) return res; - obj->data.ref[i].addr = p; - } - } - base = (mps_addr_t) ((char *) obj + (obj->data.size)); - break; - case MCheart: - INCCOUNT(SCANHEART_COUNT); - base = (mps_addr_t) ((char *) obj + (obj->heart.size)); - break; - default: - asserts(0, "scan: bizarre obj tag at %p.", obj); - } - } - } - MPS_SCAN_END(ss); - return MPS_RES_OK; -} - -static mps_addr_t myskip(mps_addr_t object) -{ - mycell *obj = object; - - commentif(skipcomments, "skip %p.", object); - INCCOUNT(SKIP_COUNT); - switch(obj->tag & 0x3) - { - case MCpad: - return (mps_addr_t) (obj->pad.tag &~ (mps_word_t) 0x3); - case MCheart: - return (mps_addr_t) ((char *) obj + (obj->heart.size)); - case MCdata: - asserts(obj->tag == MCdata + (mps_word_t) wrapper, - "skip on bad obj at %p.", obj); - return (mps_addr_t) ((char *) obj + (obj->data.size)); - default: - asserts(0, "skip: bizarre obj tag at %p.", obj); - return 0; /* not reached */ - } -} - -static void mycopy(mps_addr_t object, mps_addr_t to) -{ - mycell *boj = object; - mycell *toj = to; - - asserts(boj->tag == MCdata + (mps_word_t) wrapper, - "copy: non-data object"); - - INCCOUNTIF(boj->data.countflag, COPY_COUNT); - commentif(formatcomments, "copy: %li: %p -> %p\n", - boj->data.id, object, to); - -/* this line would be bad, because the objects might overlap, - and then C doesn't guarantee to do the right thing! - - *toj = *boj; -*/ - - memmove(to, object, boj->data.size); - if (!freeze) - { - toj->data.copycount = (toj->data.copycount)+1; - if (toj->data.copycount > maxcopy) maxcopy = toj->data.copycount; - } -} - -/* pad stores not its size but a pointer to the next object, - because we know we'll never be asked to copy it -*/ - -static void mypad(mps_addr_t base, size_t size) -{ - mycell *obj = base; - - asserts(size >= MPS_PF_ALIGN, "pad: size too small."); - - INCCOUNT(PAD_COUNT); - obj->pad.tag = MCpad + (mps_word_t) ((char *) base + size); -} - -static mps_addr_t myisfwd(mps_addr_t object) -{ - mycell *obj = object; - - INCCOUNT(ISFWD_COUNT); - if ((obj->tag & 3) != MCheart) - { - return NULL; - } - else - { - return obj->heart.obj; - } -} - -static void myfwd(mps_addr_t object, mps_addr_t to) -{ - mycell *obj = object; - size_t size; - - asserts(((obj->tag & 3) == MCdata) || ((obj->tag & 3) == MCheart), - "fwd: unexpected object tag at %p.", obj); - INCCOUNT(FWD_COUNT); - - if ((obj->tag & 3) == MCdata) - { - asserts(obj->tag == MCdata + (mps_word_t) wrapper, - "fwd: bad obj at %p.", obj); - size = obj->data.size; - } - else /* obj->tag == MCheart */ - { - size = obj->heart.size; - } - obj->data.tag = MCheart; - obj->heart.obj = to; - obj->heart.size = size; -} - - -/* --------------------------------------------------------------- - Access methods for mycell objects -*/ - -/* set the nth reference of obj to to (n from 0 to size-1) */ - -void setref(mycell *obj, int n, mycell *to) -{ - asserts(obj->tag == MCdata + (mps_word_t) wrapper, - "setref: from non-data object at %p", obj); - asserts((to==NULL)||((to->tag & 3) == MCdata), - "setref: to non-data object at %p", to); - asserts(obj->data.numrefs > n, "setref: access beyond object size."); - - obj->data.ref[n].addr = to; - obj->data.ref[n].id = (to==NULL ? 0 : to->data.id); -} - -mycell *getref(mycell *obj, int n) -{ - asserts(obj->tag == MCdata + (mps_word_t) wrapper, - "getref: from non-data object."); - asserts(obj->data.numrefs > n, "getref: access beyond object size."); - return obj->data.ref[n].addr; -} - -mps_addr_t getdata(mycell *obj) -{ - return (mps_addr_t) &(obj->data.ref[0]); -} - -long int getid(mycell *obj) -{ - asserts(obj->tag == MCdata + (mps_word_t) wrapper, - "getid: non-data object."); - return obj->data.id; -} - -long int getcopycount(mycell *obj) -{ - asserts(obj->tag == MCdata + (mps_word_t) wrapper, - "getcopycount: non-data object."); - return obj->data.copycount; -} - -long int getsize(mycell *obj) -{ - asserts(obj->tag == MCdata + (mps_word_t) wrapper, - "getsize: non-data object."); - return obj->data.numrefs; -} - -/* --------------------------------------------------------------- - Now the useful things specially for checking the graph -*/ - -/* recursively check the graph, starting at an object. - We do the check twice, so as to restore the - checkflags to zero. -*/ - -static void checkloop(mycell *obj, int dir) -{ - mycell *toj; - int tid; - int i; - - asserts(obj->tag == MCdata + (mps_word_t) wrapper, - "checkfrom: non data object in graph at %p.", obj); - - if (obj->data.checkedflag != dir) - { - commentif(checkcomments, "checking %p = %li", obj, obj->data.id); - - checkobjcount += 1; - - obj->data.checkedflag = dir; - - if (obj->data.assoc != NULL) { - toj = obj->data.assoc; - checkloop(toj, dir); - } - for (i=0; i<(obj->data.numrefs); i+=1) - { - if (obj->data.ref[i].addr != NULL) - { - toj = (obj->data.ref[i].addr); - tid = (obj->data.ref[i].id); - asserts(toj->data.id == tid, - "checkfrom: corrupt graph at %p, %d.", obj, i); - checkloop(toj, dir); - } - } - } -} - -void checkfrom(mycell *obj) -{ - int k; - - freeze = 1; /* suspend counting while checking graph */ - checkobjcount = 0; - checkloop(obj, 1); - comment("checkfrom: %li live objects checked", checkobjcount); - k = checkcomments; - checkcomments = 0; - checkloop(obj, 0); - checkcomments = k; - comment("checkfrom: graph ok from ID: %li.", obj->data.id); - freeze = 0; /* resume counting */ -} - -/* ---------------------------------------------------------- - Now things to reset and display the counters -*/ - -void resetcounters(void) -{ - int i; - for (i=0; i < PAD_COUNT+1; i++) - { - counters[i]=0; - prevcounters[i]=0; - maxcounters[i]=0; - } - maxcopy = 0; -} - -void updatecounters(void) -{ - int i; - for (i=0; i < PAD_COUNT+1; i++) - { - if (counters[i]-prevcounters[i] > maxcounters[i]) - { - maxcounters[i]=counters[i]-prevcounters[i]; - } - prevcounters[i]=counters[i]; - } -} - - -static void d_c(int i, char *name) -{ - comment("%10d %s", counters[i], name); -} - -static void d_mc(int i, char *name) -{ - comment("%10d %s", maxcounters[i], name); -} - -void displaycounters(void) -{ - comment("--------"); - comment("Counters:"); - d_c(SCANCALL_COUNT, "scan calls"); - d_c(SCANOBJ_COUNT, "object scans"); - d_c(SCANHEART_COUNT, "heart scans"); - d_c(SCANPAD_COUNT, "pad scans"); - d_c(COPY_COUNT, "copys"); - d_c(SKIP_COUNT, "skips"); - d_c(FWD_COUNT, "fwds"); - d_c(ISFWD_COUNT, "isfwds"); - d_c(PAD_COUNT, "pads"); - d_c(RESERVE_COUNT, "reserve calls"); - d_c(ALLOC_COUNT, "allocations"); - d_c(DYING_REFERENCE_COUNT, "references fixed to NULL"); - comment("--------"); -} - -void displaymaxcounters(void) -{ - comment("--------"); - comment("Maximum counter values:"); - d_mc(SCANCALL_COUNT, "scan calls"); - d_mc(SCANOBJ_COUNT, "object scans"); - d_mc(SCANHEART_COUNT, "heart scans"); - d_mc(SCANPAD_COUNT, "pad scans"); - d_mc(COPY_COUNT, "copys"); - d_mc(SKIP_COUNT, "skips"); - d_mc(FWD_COUNT, "fwds"); - d_mc(ISFWD_COUNT, "isfwds"); - d_mc(RESERVE_COUNT, "reserve calls"); - d_mc(ALLOC_COUNT, "allocations"); - d_mc(DYING_REFERENCE_COUNT, "references fixed to NULL"); - d_mc(PAD_COUNT, "pads"); - comment("--------"); - comment("max copies of a single object: %li.", maxcopy); - comment("--------"); -} - diff --git a/mps/qa/test/testlib/exfmt.h b/mps/qa/test/testlib/exfmt.h deleted file mode 100644 index 3c1a69ac725..00000000000 --- a/mps/qa/test/testlib/exfmt.h +++ /dev/null @@ -1,126 +0,0 @@ -/* $HopeName: MMQA_harness!testlib:exfmt.h(trunk.3) $ -exfmt.h - A format for the awl and amc pools, which will work without - register roots. To use it, you must take precautions. You must - register exfmt_root as a root, and unless you register the - registers and stack, you must register it as ambiguous (or - it might change before you can write the address of a newly - allocated object into another root). When you call getref or - setref, you must make sure that the objects concerned are - referenced ambiguously somewhere (this guarantees that they - won't move -- I asked richard and drj). - -*/ - -#ifndef exfmt_h -#define exfmt_h - -#include "testlib.h" - -extern int formatcomments; -extern int checkcomments; -extern int countcomments; -extern int alloccomments; -extern int fixcomments; -extern int deathcomments; -extern int skipcomments; -extern int splurgeassoc; /* write to associated objects (but don't change) */ - -extern mps_addr_t exfmt_root; - -/* the counters are visible so that I can check whether things - get moved etc -*/ - -enum { - SCANCALL_COUNT, - SCANOBJ_COUNT, /* = read objects scanned */ - SCANPAD_COUNT, /* = pads scanned */ - SCANHEART_COUNT, /* = hearts scanned */ - COPY_COUNT, - SKIP_COUNT, - FWD_COUNT, - ISFWD_COUNT, - RESERVE_COUNT, - ALLOC_COUNT, - DYING_REFERENCE_COUNT, - PAD_COUNT /* must come last or array sizes will be too small */ -}; - -extern int counters[PAD_COUNT+1]; -extern int prevcounters[PAD_COUNT+1]; -extern int maxcounters[PAD_COUNT+1]; - -long int maxcopy; -int freeze; - -/* the object format is visible so tests that want to - can hack around with it -*/ - -#define MAXSIZE 10000 - -enum {MCpad=(int) 0x1, MCheart=(int) 0x2, MCdata=(int) 0x0}; - -enum {MCerrorid=(int) 0xE6606}; - -/* n.b. MCerrorid < 0x1000000 so it won't clash with id of - any ordinary object -*/ - -typedef union mycell mycell; - -typedef mps_word_t tag; - -struct pad {tag tag;}; - -struct heart {tag tag; mps_addr_t obj; size_t size;}; - -struct data -{ - tag tag; - mycell *assoc; - size_t size; - long int id; - long int copycount; - long int numrefs; - int checkedflag; - int countflag; - struct refitem {mycell *addr; long int id;} ref[MAXSIZE]; -}; - -union mycell -{ - tag tag; - struct pad pad; - struct heart heart; - struct data data; -}; - -extern struct mps_fmt_A_s fmtA; - -mycell *allocone(mps_ap_t ap, int size, int countflag); -mycell *allocdumb(mps_ap_t ap, size_t bytes, int countflag); - -mps_addr_t getdata(mycell *obj); -void setref(mycell *obj, int n, mycell *to); -mycell *getref(mycell *obj, int n); - -long int getid(mycell *obj); -long int getcopycount(mycell *obj); -long int getsize(mycell *obj); - -void checkfrom(mycell *obj); - -#define RC resetcounters() -#define UC updatecounters() -#define DC displaycounters() -#define DMC displaymaxcounters() - -void resetcounters(void); -void updatecounters(void); -void displaycounters(void); -void displaymaxcounters(void); - -#endif - diff --git a/mps/qa/test/testlib/fastfmt.c b/mps/qa/test/testlib/fastfmt.c deleted file mode 100644 index 908c5ecca93..00000000000 --- a/mps/qa/test/testlib/fastfmt.c +++ /dev/null @@ -1,349 +0,0 @@ -/* $HopeName: MMQA_harness!testlib:fastfmt.c(trunk.3) $ -fastfmt.c - See comments in header file for usage. -*/ - -#include "fastfmt.h" -#include - -long int nextid=0x1000000; -long int checkobjcount=0; - -mps_addr_t exfmt_root=NULL; - -struct wrapper { - struct wrapper *ww; - mps_word_t tag; - mps_word_t fixedlen; - mps_word_t newfixedlen; -}; - -struct wrapper wrapobj = { - &wrapobj, - 0x36ABBE6, - 0x5, - 0x5 -}; - -mycell *wrapper = (mycell *) &wrapobj; - -/* a cell can be one of four things, depending on its type: - MCpad - a pad item - MCheart - a broken heart, aka forwarding object - MCdata - a real object -*/ - -/* the scanning function doesn't try to fix null refs -*/ - -static mps_res_t myscan(mps_ss_t ss, mps_addr_t base, mps_addr_t limit); -static mps_addr_t myskip(mps_addr_t object); -static void myfwd(mps_addr_t object, mps_addr_t to); -static mps_addr_t myisfwd(mps_addr_t object); -static void mycopy(mps_addr_t object, mps_addr_t to); -static void mypad(mps_addr_t base, size_t size); - -struct mps_fmt_A_s fmtA = -{ - MPS_PF_ALIGN, - &myscan, - &myskip, - &mycopy, - &myfwd, - &myisfwd, - &mypad -}; - -/* in the following, size is the number of refs you want - the allocated object to have -*/ - -mycell *allocdumb(mps_ap_t ap, size_t size, mps_rank_t rank) -{ - mycell *q; - size_t bytes; - size_t alignment; - - bytes = offsetof(struct data, ref) + size; - - alignment = MPS_PF_ALIGN; /* needed to make it as wide as size_t */ - -/* twiddle the value of size to make it aligned */ - bytes = (bytes+alignment-1) & ~(alignment-1); - - do - { - die(mps_reserve(&exfmt_root, ap, bytes), "Reserve: "); - q=exfmt_root; - q->data.tag = (mps_word_t) wrapper; - q->data.assoc = NULL; - q->data.id = nextid; - q->data.copycount = 0; - q->data.numrefs = 0; - q->data.checkedflag = 0; - q->data.rank = rank; - q->data.size = bytes; - } - while (!mps_commit(ap, exfmt_root, bytes)); - nextid += 1; - - return q; -} - -mycell *allocone(mps_ap_t ap, int size, mps_rank_t rank) -{ - mycell *q; - int i; - size_t bytes; - size_t alignment; - - bytes = offsetof(struct data, ref) + size*sizeof(struct refitem); - - alignment = MPS_PF_ALIGN; /* needed to make it as wide as size_t */ - -/* twiddle the value of size to make it aligned */ - bytes = (bytes+alignment-1) & ~(alignment-1); - - do - { - die(mps_reserve(&exfmt_root, ap, bytes), "Reserve: "); - q=exfmt_root; - q->data.tag = MCdata + (mps_word_t) wrapper; - q->data.assoc = NULL; - q->data.id = nextid; - q->data.copycount = 0; - q->data.numrefs = size; - q->data.checkedflag = 0; - q->data.rank = rank; - q->data.size = bytes; - - for(i=0; idata.ref[i].addr = NULL; - q->data.ref[i].id = 0; - } - } - while (!mps_commit(ap, exfmt_root, bytes)); - nextid += 1; - - return q; -} - -static mps_res_t myscan(mps_ss_t ss, mps_addr_t base, mps_addr_t limit) -{ - int i; - - MPS_SCAN_BEGIN(ss) - { - while (base < limit) - { - mycell *obj = base; - mps_res_t res; - mps_addr_t p, q; - - switch (obj->tag & 0x3) - { - case MCpad: - base = (mps_addr_t) (obj->pad.tag &~ (mps_word_t) 3); - break; - case MCdata: - /* actual scanning is done in here */ - /* make sure to fix the assoc pointer first */ - p = obj->data.assoc; - if (p != NULL) { - q = p; - res = MPS_FIX(ss, (mps_addr_t *) &p); - if (res != MPS_RES_OK) return res; - obj->data.assoc = p; - } - - for (i=0; i<(obj->data.numrefs); i++) - { - p = obj->data.ref[i].addr; - if (p != NULL) - { - q = p; - res = MPS_FIX(ss, (mps_addr_t *) &p); - if (res != MPS_RES_OK) return res; - obj->data.ref[i].addr = p; - } - } - base = (mps_addr_t) ((char *) obj + (obj->data.size)); - break; - case MCheart: - base = (mps_addr_t) ((char *) obj + (obj->heart.size)); - break; - default: - asserts(0, "scan: bizarre obj tag at %p.", obj); - } - } - } - MPS_SCAN_END(ss); - return MPS_RES_OK; -} - -static mps_addr_t myskip(mps_addr_t object) -{ - mycell *obj = object; - - switch(obj->tag & 0x3) - { - case MCpad: - return (mps_addr_t) (obj->pad.tag &~ (mps_word_t) 0x3); - case MCheart: - return (mps_addr_t) ((char *) obj + (obj->heart.size)); - case MCdata: - return (mps_addr_t) ((char *) obj + (obj->data.size)); - default: - asserts(0, "skip: bizarre obj tag at %p.", obj); - return 0; /* not reached */ - } -} - -static void mycopy(mps_addr_t object, mps_addr_t to) -{ - mycell *boj = object; - - memmove(to, object, boj->data.size); -} - -/* pad stores not its size but a pointer to the next object, - because we know we'll never be asked to copy it -*/ - -static void mypad(mps_addr_t base, size_t size) -{ - mycell *obj = base; - - obj->pad.tag = MCpad + (mps_word_t) ((char *) base + size); -} - -static mps_addr_t myisfwd(mps_addr_t object) -{ - mycell *obj = object; - - if ((obj->tag & 3) != MCheart) - { - return NULL; - } - else - { - return obj->heart.obj; - } -} - -static void myfwd(mps_addr_t object, mps_addr_t to) -{ - mycell *obj = object; - size_t size; - - if ((obj->tag & 3) == MCdata) - { - size = obj->data.size; - } - else /* obj->tag == MCheart */ - { - size = obj->heart.size; - } - obj->data.tag = MCheart; - obj->heart.obj = to; - obj->heart.size = size; -} - - -/* --------------------------------------------------------------- - Access methods for mycell objects -*/ - -/* set the nth reference of obj to to (n from 0 to size-1) */ - -void setref(mycell *obj, int n, mycell *to) -{ - asserts(obj->tag == MCdata + (mps_word_t) wrapper, - "setref: from non-data object at %p", obj); - asserts((to==NULL)||((to->tag & 3) == MCdata), - "setref: to non-data object at %p", to); - asserts(obj->data.numrefs > n, "setref: access beyond object size."); - - obj->data.ref[n].addr = to; - obj->data.ref[n].id = (to==NULL ? 0 : to->data.id); -} - -mycell *getref(mycell *obj, int n) -{ - asserts(obj->tag == MCdata + (mps_word_t) wrapper, - "getref: from non-data object."); - asserts(obj->data.numrefs > n, "getref: access beyond object size."); - return obj->data.ref[n].addr; -} - -mps_addr_t getdata(mycell *obj) -{ - return (mps_addr_t) &(obj->data.ref[0]); -} - -long int getid(mycell *obj) -{ - asserts(obj->tag == MCdata + (mps_word_t) wrapper, - "getid: non-data object."); - return obj->data.id; -} - -long int getsize(mycell *obj) -{ - asserts(obj->tag == MCdata + (mps_word_t) wrapper, - "getsize: non-data object."); - return obj->data.numrefs; -} - -/* --------------------------------------------------------------- - Now the useful things specially for checking the graph -*/ - -/* recursively check the graph, starting at an object. - We do the check twice, so as to restore the - checkflags to zero. -*/ - -static void checkloop(mycell *obj, int dir) -{ - mycell *toj; - int tid; - int i; - - asserts(obj->tag == MCdata + (mps_word_t) wrapper, - "checkfrom: non data object in graph at %p.", obj); - - if (obj->data.checkedflag != dir) - { - checkobjcount += 1; - - obj->data.checkedflag = dir; - - if (obj->data.assoc != NULL) { - toj = obj->data.assoc; - checkloop(toj, dir); - } - for (i=0; i<(obj->data.numrefs); i+=1) - { - if (obj->data.ref[i].addr != NULL) - { - toj = (obj->data.ref[i].addr); - tid = (obj->data.ref[i].id); - asserts(toj->data.id == tid, - "checkfrom: corrupt graph at %p, %d.", obj, i); - checkloop(toj, dir); - } - } - } -} - -void checkfrom(mycell *obj) -{ - checkobjcount = 0; - checkloop(obj, 1); - comment("checkfrom: %li live objects checked", checkobjcount); - checkloop(obj, 0); - comment("checkfrom: graph ok from ID: %li.", obj->data.id); -} - diff --git a/mps/qa/test/testlib/fastfmt.h b/mps/qa/test/testlib/fastfmt.h deleted file mode 100644 index 85112f21ba0..00000000000 --- a/mps/qa/test/testlib/fastfmt.h +++ /dev/null @@ -1,73 +0,0 @@ -/* $HopeName: MMQA_harness!testlib:fastfmt.h(trunk.2) $ -fastfmt.h - Format like rankfmt (see rankfmt.h) and with same object - structure, but with no checking or comments. - Use for performance testing only. -*/ - -#ifndef fastfmt_h -#define fastfmt_h - -#include "testlib.h" - -extern mps_addr_t exfmt_root; - -/* the object format is visible so tests that want to - can hack around with it -*/ - -#define MAXSIZE 10000 - -enum {MCpad=(int) 0x1, MCheart=(int) 0x2, MCdata=(int) 0x0}; - -enum {MCerrorid=(int) 0xE6606}; - -/* n.b. MCerrorid < 0x1000000 so it won't clash with id of - any ordinary object -*/ - -typedef union mycell mycell; - -typedef mps_word_t tag; - -struct pad {tag tag;}; - -struct heart {tag tag; mps_addr_t obj; size_t size;}; - -struct data -{ - tag tag; - mycell *assoc; - size_t size; - long int id; - long int copycount; - long int numrefs; - int checkedflag; - mps_rank_t rank; - struct refitem {mycell *addr; long int id;} ref[MAXSIZE]; -}; - -union mycell -{ - tag tag; - struct pad pad; - struct heart heart; - struct data data; -}; - -extern struct mps_fmt_A_s fmtA; - -mycell *allocone(mps_ap_t ap, int size, mps_rank_t rank); -mycell *allocdumb(mps_ap_t ap, size_t bytes, mps_rank_t rank); - -mps_addr_t getdata(mycell *obj); -void setref(mycell *obj, int n, mycell *to); -mycell *getref(mycell *obj, int n); - -long int getid(mycell *obj); -long int getsize(mycell *obj); - -void checkfrom(mycell *obj); - -#endif - diff --git a/mps/qa/test/testlib/lofmt.c b/mps/qa/test/testlib/lofmt.c deleted file mode 100644 index 1fac9ed5a03..00000000000 --- a/mps/qa/test/testlib/lofmt.c +++ /dev/null @@ -1,194 +0,0 @@ -/* $HopeName: MMQA_harness!testlib:lofmt.c(trunk.3) $ -lofmt.c - A format for pool class LO -*/ - -#include "lofmt.h" -#include - -/* some options on the format are controlled by global - variables. Of course for efficiency we'd do it in the - pre-processor, but that would require recompilation... - - variable default function - - alloclocomments comment on allocation (0) - allowlocopies allow objects to be copied (1) -*/ - -int alloclocomments=0; -int allowlocopies=1; - -long int nextid=0x2000000; - -/* a cell can be one of four things, depending on its type: - LOpadsingle - a single pad item, MPS_PF_ALIGN in size - LOpadmulti - a longer pad item, at least 2*MPS_PF_ALIGN in size - LOheart - a broken heart, aka forwarding object - LOdata - a real object -*/ - -static mps_res_t myscan(mps_ss_t ss, mps_addr_t base, mps_addr_t limit); -static mps_addr_t myskip(mps_addr_t object); -static void myfwd(mps_addr_t object, mps_addr_t to); -static mps_addr_t myisfwd(mps_addr_t object); -static void mycopy(mps_addr_t object, mps_addr_t to); -static void mypad(mps_addr_t base, size_t size); - -struct mps_fmt_A_s fmtLO = -{ - MPS_PF_ALIGN, - &myscan, - &myskip, - &mycopy, - &myfwd, - &myisfwd, - &mypad -}; - -/* in the following, size is the size_t of the data element - of the lodata structure you want the object to have; i.e. - the number of bytes of storage you get in the object on top - of the headers. -*/ - -locell *alloclo(mps_ap_t ap, size_t size) { - mps_addr_t p; - locell *q; - size_t bytes; - size_t alignment; - - bytes = offsetof(struct lodata, data) + size; - - alignment = MPS_PF_ALIGN; /* needed to make it as wide as size_t */ - -/* twiddle the value of size to make it aligned */ - bytes = (bytes+alignment-1) & ~(alignment-1); - - do { - die(mps_reserve(&p, ap, bytes), "Reserve: "); - q=p; - q->data.tag = LOdata; - q->data.id = nextid; - q->data.copycount = 0; - q->data.size = bytes; - } - while (!mps_commit(ap, p, bytes)); - commentif(alloclocomments, "allocated id %li at %p.", nextid, q); - nextid += 1; - - return q; -} - -static mps_res_t myscan(mps_ss_t ss, mps_addr_t b, mps_addr_t l) { - error("Scan method in LO format called!"); - return MPS_RES_OK; -} - -static mps_addr_t myskip(mps_addr_t object) { - locell *obj = object; - - switch(obj->tag) - { - case LOpadsingle: - return (mps_addr_t) ((char *) obj + MPS_PF_ALIGN); - case LOpadmany: - return obj->padmulti.next; - case LOheart: - return (mps_addr_t) ((char *) obj + (obj->heart.size)); - case LOdata: - return (mps_addr_t) ((char *) obj + (obj->data.size)); - default: - asserts(0, "loskip: bizarre obj tag at %p.", obj); - return 0; /* not reached */ - } -} - -static void mycopy(mps_addr_t object, mps_addr_t to) -{ - locell *boj = object; - locell *toj = to; - - asserts(allowlocopies, "locopy on LO object"); - asserts(boj->tag == LOdata, "locopy: non-data object"); - - memmove(to, object, boj->data.size); - toj->data.copycount = (toj->data.copycount)+1; -} - -/* pad stores not its size but a pointer to the next object, - because we know we'll never be asked to copy it -*/ - -static void mypad(mps_addr_t base, size_t size) -{ - locell *obj = base; - - asserts(size >= MPS_PF_ALIGN, "pad: size too small."); - - if (size == MPS_PF_ALIGN) - { - asserts(sizeof(obj->padsingle) <= MPS_PF_ALIGN, "impossible pad"); - obj->padsingle.tag = LOpadsingle; - } - else - { - asserts(size >= sizeof(struct lopadmulti), "pad: awkward size."); - obj->padmulti.tag = LOpadmany; - obj->padmulti.next = (mps_addr_t) ((char *) base + size); - } -} - -static mps_addr_t myisfwd(mps_addr_t object) -{ - locell *obj = object; - - if (obj->tag != LOheart) - { - return NULL; - } - else - { - return obj->heart.obj; - } -} - -static void myfwd(mps_addr_t object, mps_addr_t to) -{ - locell *obj = object; - size_t size; - - asserts(obj->tag == LOdata || obj->tag == LOheart, - "lofwd: unexpected object tag at %p.", obj); - - if (obj->tag == LOdata) - { - size = obj->data.size; - } - else /* obj->tag == LOheart */ - { - size = obj->heart.size; - } - obj->data.tag = LOheart; - obj->heart.obj = to; - obj->heart.size = size; -} - -long int getloid(locell *obj) -{ - asserts(obj->tag == LOdata, "getloid: non-data object."); - return obj->data.id; -} - -long int getlocopycount(locell *obj) -{ - asserts(obj->tag == LOdata, "getlocopycount: non-data object."); - return obj->data.copycount; -} - -long int getlosize(locell *obj) -{ - asserts(obj->tag == LOdata, "getlosize: non-data object."); - return obj->data.size - offsetof(struct lodata, data); -} - diff --git a/mps/qa/test/testlib/lofmt.h b/mps/qa/test/testlib/lofmt.h deleted file mode 100644 index 2663b43884c..00000000000 --- a/mps/qa/test/testlib/lofmt.h +++ /dev/null @@ -1,62 +0,0 @@ -/* $HopeName: MMQA_harness!testlib:lofmt.h(trunk.2) $ -lofmt.h - A format for the LO pool class. We have to allow for copying - and forwarding, but scan should never be called. -*/ - -#ifndef lofmt_h -#define lofmt_h - -#include "testlib.h" - -extern int alloclocomments; -extern int allowlocopies; - -/* the object format is visible so tests that want to - can hack around with it -*/ - -#define MAXSIZE 10000 - -enum {LOpadsingle=(int) 0xBAD51497, LOpadmany=(int) 0xBAD3A41, - LOheart=(int) 0x8EA62, LOdata=(int) 0x7EAFDA2A}; - -typedef union locell locell; - -typedef int tag; - -struct lopadsingle {tag tag;}; - -struct lopadmulti {tag tag; mps_addr_t next;}; - -struct loheart {tag tag; size_t size; mps_addr_t obj;}; - -struct lodata -{ - tag tag; - size_t size; - long int id; - long int copycount; - size_t len; - char data[MAXSIZE]; -}; - -union locell -{ - tag tag; - struct lopadsingle padsingle; - struct lopadmulti padmulti; - struct loheart heart; - struct lodata data; -}; - -extern struct mps_fmt_A_s fmtLO; - -locell *alloclo(mps_ap_t ap, size_t bytes); - -long int getloid(locell *obj); -long int getlocopycount(locell *obj); -long int getlosize(locell *obj); - -#endif - diff --git a/mps/qa/test/testlib/manifest b/mps/qa/test/testlib/manifest deleted file mode 100644 index 80f7e3db0ea..00000000000 --- a/mps/qa/test/testlib/manifest +++ /dev/null @@ -1,12 +0,0 @@ -% $HopeName$ -% -rankfmt.c -fastfmt.c -awlfmt.c -exfmt.c -lofmt.c -myfmt.c -newfmt.c -platform.c -testlib.c -epvmfmt.c diff --git a/mps/qa/test/testlib/myfmt.c b/mps/qa/test/testlib/myfmt.c deleted file mode 100644 index 44ac5df2581..00000000000 --- a/mps/qa/test/testlib/myfmt.c +++ /dev/null @@ -1,219 +0,0 @@ -/* $HopeName: MMQA_harness!testlib:myfmt.c(trunk.2) $ -myfmt.c - a format for scannable objects -*/ - -#include "myfmt.h" -#include -#include - -enum {MCpadsingle, MCpadmany, MCheart, MCdata}; - -/* some options on the format are controlled by global - variables. Of course for efficiency we'd do it in the - pre-processor, but that would require recompilation... - - variable default function - - formatcomments 1 print comments on scanning, fixing, copying - copysurplus 1 copy the surplus space in objects when moving - -*/ - -int formatcomments=1; -int copysurplus=1; - -/* we don't have a separate type for leaf nodes; - instead the scanning function doesn't fix null refs - - the words after ref[1] are copied by mycopy, - (so you can use them to store data) as long as copysurplus=1 -*/ - -static mps_res_t myscan(mps_ss_t ss, mps_addr_t base, mps_addr_t limit); -static mps_addr_t myskip(mps_addr_t object); -static void myfwd(mps_addr_t object, mps_addr_t to); -static mps_addr_t myisfwd(mps_addr_t object); -static void mycopy(mps_addr_t object, mps_addr_t to); -static void mypad(mps_addr_t base, size_t size); - -struct mps_fmt_A_s fmtA = -{ - MPS_PF_ALIGN, - &myscan, - &myskip, - &mycopy, - &myfwd, - &myisfwd, - &mypad -}; - -mycell *allocone(mps_ap_t ap, mps_word_t data, - mycell *ref0, mycell *ref1, size_t size) -{ - mps_addr_t p; - mycell *q; - size_t align; - - align = MPS_PF_ALIGN; /* makes it long enough for ~ to work */ - - if (size < sizeof(mycell)) - { - error("Tried to allocate too small an object."); - } - -/* twiddle the value of size to make it aligned */ - size = (size+align-1) & ~(align-1); - - do - { - die(mps_reserve(&p, ap, size), "Reserve: "); - q=p; - q->tag = MCdata; - q->data = data; - q->size = size; - q->ref[0] = ref0; - q->ref[1] = ref1; - } - while (!mps_commit(ap, p, size)); - return q; -} - -mps_res_t myscan(mps_ss_t ss, mps_addr_t base, mps_addr_t limit) -{ - MPS_SCAN_BEGIN(ss) - { - while (base < limit) - { - mycell *obj = base; - mps_res_t res; - - if (formatcomments) printf("Scan %p.\n", (void *)base); - switch (obj->tag) - { - case MCpadsingle: - base = (mps_addr_t) ((mps_word_t) obj + MPS_PF_ALIGN); - break; - case MCpadmany: - base = (mps_addr_t) (obj->data); - break; - case MCdata: - /* actual scanning is done in here */ - - if (obj->ref[0] != NULL) - { - if (formatcomments) printf("Fix: %x.\n", (int) &(obj->ref[0])); - res = MPS_FIX(ss, (mps_addr_t *) &(obj->ref[0])); /* pun! */ - if (res != MPS_RES_OK) - { - return res; - } - } - if (obj->ref[1] != NULL) - { - if (formatcomments) printf("Fix: %x.\n", (int) &(obj->ref[1])); - res = MPS_FIX(ss, (mps_addr_t *) &(obj->ref[1])); /* pun! */ - if (res != MPS_RES_OK) - { - return res; - } - } - /* \/ fall through \/ */ - - case MCheart: - base = (mps_addr_t) ((char *) obj + (obj->size)); - } - } - asserts(base == limit, "base <> limit in scan!"); - } - MPS_SCAN_END(ss); - return MPS_RES_OK; -} - -mps_addr_t myskip(mps_addr_t object) -{ - mycell *obj = object; - - switch(obj->tag) - { - case MCpadsingle: - return (mps_addr_t) ((mps_word_t) obj+MPS_PF_ALIGN); - case MCpadmany: - return (mps_addr_t) (obj->data); - case MCheart: case MCdata: - return (mps_addr_t) ((char *) obj + (obj->size)); - default: - asserts(0, "skip: bizarre obj tag at %p.", obj); - return 0; /* just to satisfy the compiler! */ - } -} - -void mycopy(mps_addr_t object, mps_addr_t to) -{ - mycell *boj = object; -/* mycell *toj = to; -*/ - - if (formatcomments) printf("copy! %x -> %x\n", (int) object, (int) to); - -/* this line is bad, because the objects might overlap, - and then C doesn't guarantee to do the right thing! - - *toj = *boj; -*/ - - asserts(boj->tag == MCdata, "Bad object tag in copy"); - - if (copysurplus) - { - memmove(to, object, boj->size); - } - else - { - memmove(to, object, sizeof(mycell)); - } - -/* it's guaranteed that we won't have to copy a pad, so we - don't have to worry about fiddling the pointer -*/ - -} - -void mypad(mps_addr_t base, size_t size) -{ - mycell *obj = base; - - asserts(size >= MPS_PF_ALIGN, "size too small for pad"); - if (size == MPS_PF_ALIGN) - { - obj->tag = MCpadsingle; - } - else - { - obj->tag = MCpadmany; - obj->data = ((mps_word_t) base) + size; - } -} - -mps_addr_t myisfwd(mps_addr_t object) -{ - mycell *obj = object; - - if (obj->tag != MCheart) - { - return NULL; - } - else - { - return (mps_addr_t) obj->data; - } -} - -void myfwd(mps_addr_t object, mps_addr_t to) -{ - mycell *obj = object; - - obj->tag = MCheart; - obj->data = (mps_word_t) to; -} - diff --git a/mps/qa/test/testlib/myfmt.h b/mps/qa/test/testlib/myfmt.h deleted file mode 100644 index 9f8fddf69c8..00000000000 --- a/mps/qa/test/testlib/myfmt.h +++ /dev/null @@ -1,46 +0,0 @@ -/* $HopeName: MMQA_harness!testlib:myfmt.h(trunk.2) $ -myfmt.h - a format for scannable objects -*/ - -#ifndef myfmt_h -#define myfmt_h - -#include "testlib.h" - -/* some options on the format are controlled by global - variables. Of course for efficiency we'd do it in the - pre-processor, but that would require recompilation... - - variable default function - - formatcomments 1 print comments on scanning, fixing, copying - copysurplus 1 copy the surplus space in objects when moving - -*/ - -extern int formatcomments; -extern int copysurplus; - -typedef struct mycell - { - mps_word_t tag; - mps_word_t data; - mps_word_t size; - struct mycell *ref[2]; - } mycell; - -/* we don't have a separate type for leaf nodes; - instead the scanning function doesn't fix null refs - - the words after ref[1] are copied by mycopy, - (so you can use them to store data) as long as copysurplus=1 -*/ - -extern struct mps_fmt_A_s fmtA; - -mycell *allocone(mps_ap_t ap, mps_word_t data, - mycell *ref0, mycell *ref1, size_t size); - -#endif - diff --git a/mps/qa/test/testlib/newfmt.c b/mps/qa/test/testlib/newfmt.c deleted file mode 100644 index 30bdd779f1f..00000000000 --- a/mps/qa/test/testlib/newfmt.c +++ /dev/null @@ -1,525 +0,0 @@ -/* $HopeName: MMQA_harness!testlib:newfmt.c(trunk.3) $ -newfmt.c - My attempt to write a format using unions &c to avoid - nasty casting all over the place -*/ - -#include "newfmt.h" -#include - -/* some options on the format are controlled by global - variables. Of course for efficiency we'd do it in the - pre-processor, but that would require recompilation... - - variable default function - - formatcomments 1 print comments on scanning, fixing, copying - checkcomments 1 print comments on checking - -*/ - -int formatcomments=0; -int checkcomments=0; -int countcomments=1; -int alloccomments=0; -int fixcomments=0; - -long int nextid=0x1000000; - -long int checkobjcount=0; - -enum -{ - SCANCALL_COUNT, - SCANOBJ_COUNT, /* = #objects scanned (real ones, that is) */ - SCANPS_COUNT, /* = #pad singles scanned */ - SCANPM_COUNT, /* etc ... */ - SCANHEART_COUNT, - COPY_COUNT, - SKIP_COUNT, - FWD_COUNT, - ISFWD_COUNT, - RESERVE_COUNT, - ALLOC_COUNT, - PAD_SINGLE_COUNT, - PAD_MULTI_COUNT -}; - -int counters[PAD_MULTI_COUNT+1]; -int prevcounters[PAD_MULTI_COUNT+1]; -int maxcounters[PAD_MULTI_COUNT+1] = {0}; - -static long int maxcopy = 0; -static int freeze=0; - -#define INCCOUNT(c) do {if(!freeze) counters[c]+=1;} while (0) - -/* a cell can be one of four things, depending on its type: - MCpadsingle - a single pad item, MPS_PF_ALIGN in size - MCpadmulti - a longer pad item, at least 2*MPS_PF_ALIGN in size - MCheart - a broken heart, aka forwarding object - MCdata - a real object -*/ - -/* the scanning function doesn't try to fix null refs - - size is the total size of the object in bytes - every other word from ref onwards, including the word - at ref, is a reference; after each one comes the id - of the object referenced, so we can check the graph is - correct later! - -nb: This way of doing things is not really guaranteed to work - on all systems. It would be more correct to use an array - of structures, or an array of unions. -*/ - -static mps_res_t myscan(mps_ss_t ss, mps_addr_t base, mps_addr_t limit); -static mps_addr_t myskip(mps_addr_t object); -static void myfwd(mps_addr_t object, mps_addr_t to); -static mps_addr_t myisfwd(mps_addr_t object); -static void mycopy(mps_addr_t object, mps_addr_t to); -static void mypad(mps_addr_t base, size_t size); - -struct mps_fmt_A_s fmtA = -{ - MPS_PF_ALIGN, - &myscan, - &myskip, - &mycopy, - &myfwd, - &myisfwd, - &mypad -}; - -/* in the following, size is the number of refs you want - the allocated object to have -*/ - -mycell *allocdumb(mps_ap_t ap, size_t size) -{ - mps_addr_t p; - mycell *q; - size_t bytes; - size_t alignment; - - bytes = offsetof(struct data, ref) + size; - - alignment = MPS_PF_ALIGN; /* needed to make it as wide as size_t */ - -/* twiddle the value of size to make it aligned */ - bytes = (bytes+alignment-1) & ~(alignment-1); - - do - { - die(mps_reserve(&p, ap, bytes), "Reserve: "); - INCCOUNT(RESERVE_COUNT); - q=p; - q->data.tag = MCdata; - q->data.id = nextid; - q->data.copycount = 0; - q->data.numrefs = 0; - q->data.checkedflag = 0; - q->data.size = bytes; - } - while (!mps_commit(ap, p, bytes)); - INCCOUNT(ALLOC_COUNT); - commentif(alloccomments, "allocated id %li at %p.", nextid, q); - nextid += 1; - - return q; -} - -mycell *allocone(mps_ap_t ap, int size) -{ - mps_addr_t p; - mycell *q; - int i; - size_t bytes; - size_t alignment; - - bytes = offsetof(struct data, ref) + size*sizeof(struct refitem); - - alignment = MPS_PF_ALIGN; /* needed to make it as wide as size_t */ - -/* twiddle the value of size to make it aligned */ - bytes = (bytes+alignment-1) & ~(alignment-1); - - do - { - die(mps_reserve(&p, ap, bytes), "Reserve: "); - INCCOUNT(RESERVE_COUNT); - q=p; - q->data.tag = MCdata; - q->data.id = nextid; - q->data.copycount = 0; - q->data.numrefs = size; - q->data.checkedflag = 0; - q->data.size = bytes; - - for(i=0; idata.ref[i].addr = NULL; - q->data.ref[i].id = 0; - } - } - while (!mps_commit(ap, p, bytes)); - INCCOUNT(ALLOC_COUNT); - commentif(alloccomments, "allocated id %li at %p.", nextid, q); - nextid += 1; - - return q; -} - -static mps_res_t myscan(mps_ss_t ss, mps_addr_t base, mps_addr_t limit) -{ - int i; - - INCCOUNT(SCANCALL_COUNT); - MPS_SCAN_BEGIN(ss) - { - while (base < limit) - { - mycell *obj = base; - mps_res_t res; - mps_addr_t p; - - switch (obj->tag) - { - case MCpadsingle: - INCCOUNT(SCANPS_COUNT); - base = (mps_addr_t) ((char *) obj + MPS_PF_ALIGN); - break; - case MCpadmany: - INCCOUNT(SCANPM_COUNT); - base = (obj->padmulti.next); - break; - case MCdata: - INCCOUNT(SCANOBJ_COUNT); - /* actual scanning is done in here */ - - asserts(obj->data.id != MCerrorid, "scan on error object"); - commentif(formatcomments, "scan %li at %p.", obj->data.id, base); - for (i=0; i<(obj->data.numrefs); i++) - { - p = obj->data.ref[i].addr; - if (p != NULL) - { - /* copy ref to p for fixing, to avoid a pun (although - the pun would probably work fine almost everywhere) - */ - commentif(fixcomments, "fix %li[%i] -> %li", - obj->data.id, i, obj->data.ref[i].id); - res = MPS_FIX(ss, (mps_addr_t *) &p); - if (res != MPS_RES_OK) return res; - obj->data.ref[i].addr = p; - } - } - base = (mps_addr_t) ((char *) obj + (obj->data.size)); - break; - case MCheart: - INCCOUNT(SCANHEART_COUNT); - base = (mps_addr_t) ((char *) obj + (obj->heart.size)); - break; - default: - asserts(0, "scan: bizarre obj tag at %p.", obj); - } - } - } - MPS_SCAN_END(ss); - return MPS_RES_OK; -} - -static mps_addr_t myskip(mps_addr_t object) -{ - mycell *obj = object; - - INCCOUNT(SKIP_COUNT); - switch(obj->tag) - { - case MCpadsingle: - return (mps_addr_t) ((char *) obj + MPS_PF_ALIGN); - case MCpadmany: - return obj->padmulti.next; - case MCheart: - return (mps_addr_t) ((char *) obj + (obj->heart.size)); - case MCdata: - return (mps_addr_t) ((char *) obj + (obj->data.size)); - default: - asserts(0, "skip: bizarre obj tag at %p.", obj); - return 0; /* not reached */ - } -} - -static void mycopy(mps_addr_t object, mps_addr_t to) -{ - mycell *boj = object; - mycell *toj = to; - - asserts(boj->tag == MCdata, "copy: non-data object"); - - INCCOUNT(COPY_COUNT); - commentif(formatcomments, "copy: %li: %p -> %p\n", - boj->data.id, object, to); - -/* this line would be bad, because the objects might overlap, - and then C doesn't guarantee to do the right thing! - - *toj = *boj; -*/ - - memmove(to, object, boj->data.size); - if (!freeze) - { - toj->data.copycount = (toj->data.copycount)+1; - if (toj->data.copycount > maxcopy) maxcopy = toj->data.copycount; - } -} - -/* pad stores not its size but a pointer to the next object, - because we know we'll never be asked to copy it -*/ - -static void mypad(mps_addr_t base, size_t size) -{ - mycell *obj = base; - - asserts(size >= MPS_PF_ALIGN, "pad: size too small."); - - if (size == MPS_PF_ALIGN) - { - INCCOUNT(PAD_SINGLE_COUNT); - asserts(sizeof(obj->padsingle) <= MPS_PF_ALIGN, "impossible pad"); - obj->padsingle.tag = MCpadsingle; - } - else - { - asserts(size >= sizeof(struct padmulti), "pad: awkward size."); - INCCOUNT(PAD_MULTI_COUNT); - obj->padmulti.tag = MCpadmany; - obj->padmulti.next = (mps_addr_t) ((char *) base + size); - } -} - -static mps_addr_t myisfwd(mps_addr_t object) -{ - mycell *obj = object; - - INCCOUNT(ISFWD_COUNT); - if (obj->tag != MCheart) - { - return NULL; - } - else - { - return obj->heart.obj; - } -} - -static void myfwd(mps_addr_t object, mps_addr_t to) -{ - mycell *obj = object; - size_t size; - - asserts(obj->tag == MCdata || obj->tag == MCheart, - "fwd: unexpected object tag at %p.", obj); - INCCOUNT(FWD_COUNT); - - if (obj->tag == MCdata) - { - size = obj->data.size; - } - else /* obj->tag == MCheart */ - { - size = obj->heart.size; - } - obj->data.tag = MCheart; - obj->heart.obj = to; - obj->heart.size = size; -} - - -/* --------------------------------------------------------------- - Access methods for mycell objects -*/ - -/* set the nth reference of obj to to (n from 0 to size-1) */ - -void setref(mycell *obj, int n, mycell *to) -{ - asserts(obj->tag == MCdata, "setref: from non-data object."); - asserts((to==NULL)||(to->tag == MCdata), "setref: to non-data object."); - asserts(obj->data.numrefs > n, "setref: access beyond object size."); - - obj->data.ref[n].addr = to; - obj->data.ref[n].id = (to==NULL ? 0 : to->data.id); -} - -mycell *getref(mycell *obj, int n) -{ - asserts(obj->tag == MCdata, "getref: from non-data object."); - asserts(obj->data.numrefs > n, "getref: access beyond object size."); - return obj->data.ref[n].addr; -} - -mps_addr_t getdata(mycell *obj) -{ - return (mps_addr_t) &(obj->data.ref[0]); -} - -long int getid(mycell *obj) -{ - asserts(obj->tag == MCdata, "getid: non-data object."); - return obj->data.id; -} - -long int getcopycount(mycell *obj) -{ - asserts(obj->tag == MCdata, "getcopycount: non-data object."); - return obj->data.copycount; -} - -long int getsize(mycell *obj) -{ - asserts(obj->tag == MCdata, "getsize: non-data object."); - return obj->data.numrefs; -} - -/* --------------------------------------------------------------- - Now the useful things specially for checking the graph -*/ - -/* recursively check the graph, starting at an object. - We do the check twice, so as to restore the - checkflags to zero. -*/ - -static void checkloop(mycell *obj, int dir) -{ - mycell *toj; - int tid; - int i; - - asserts(obj->tag == MCdata, - "checkfrom: non data object in graph at %p.", obj); - - if (obj->data.checkedflag != dir) - { - commentif(checkcomments, "checking %p = %li", obj, obj->data.id); - - checkobjcount += 1; - - obj->data.checkedflag = dir; - - for (i=0; i<(obj->data.numrefs); i+=1) - { - if (obj->data.ref[i].addr != NULL) - { - toj = (obj->data.ref[i].addr); - tid = (obj->data.ref[i].id); - asserts(toj->data.id == tid, - "checkfrom: corrupt graph at %p, %d.", obj, i); - checkloop(toj, dir); - } - } - } -} - -void checkfrom(mycell *obj) -{ - int k; - - freeze = 1; /* suspend counting while checking graph */ - checkobjcount = 0; - checkloop(obj, 1); - comment("checkfrom: %li live objects checked", checkobjcount); - k = checkcomments; - checkcomments = 0; - checkloop(obj, 0); - checkcomments = k; - comment("checkfrom: graph ok from ID: %li.", obj->data.id); - freeze = 0; /* resume counting */ -} - -/* ---------------------------------------------------------- - Now things to reset and display the counters -*/ - -void resetcounters(void) -{ - int i; - for (i=0; i < PAD_MULTI_COUNT+1; i++) - { - counters[i]=0; - prevcounters[i]=0; - maxcounters[i]=0; - } - maxcopy = 0; -} - -void updatecounters(void) -{ - int i; - for (i=0; i < PAD_MULTI_COUNT+1; i++) - { - if (counters[i]-prevcounters[i] > maxcounters[i]) - { - maxcounters[i]=counters[i]-prevcounters[i]; - } - prevcounters[i]=counters[i]; - } -} - - -static void d_c(int i, char *name) -{ - comment("%10d %s", counters[i], name); -} - -static void d_mc(int i, char *name) -{ - comment("%10d %s", maxcounters[i], name); -} - -void displaycounters(void) -{ - comment("--------"); - comment("Counters:"); - d_c(SCANCALL_COUNT, "scan calls"); - d_c(SCANOBJ_COUNT, "object scans"); - d_c(SCANHEART_COUNT, "heart scans"); - d_c(SCANPS_COUNT, "pad scans (single word)"); - d_c(SCANPM_COUNT, "pad scans (multi word)"); - d_c(COPY_COUNT, "copys"); - d_c(SKIP_COUNT, "skips"); - d_c(FWD_COUNT, "fwds"); - d_c(ISFWD_COUNT, "isfwds"); - d_c(PAD_SINGLE_COUNT, "pads (single word)"); - d_c(PAD_MULTI_COUNT, "pads (multi word)"); - d_c(RESERVE_COUNT, "reserve calls"); - d_c(ALLOC_COUNT, "allocations"); - comment("--------"); -} - -void displaymaxcounters(void) -{ - comment("--------"); - comment("Maximum counter values:"); - d_mc(SCANCALL_COUNT, "scan calls"); - d_mc(SCANOBJ_COUNT, "object scans"); - d_mc(SCANHEART_COUNT, "heart scans"); - d_mc(SCANPS_COUNT, "pad scans (single word)"); - d_mc(SCANPM_COUNT, "pad scans (multi word)"); - d_mc(COPY_COUNT, "copys"); - d_mc(SKIP_COUNT, "skips"); - d_mc(FWD_COUNT, "fwds"); - d_mc(ISFWD_COUNT, "isfwds"); - d_mc(RESERVE_COUNT, "reserve calls"); - d_mc(ALLOC_COUNT, "allocations"); - d_mc(PAD_SINGLE_COUNT, "pads (single word)"); - d_mc(PAD_MULTI_COUNT, "pads (multi word)"); - comment("--------"); - comment("max copies of a single object: %li.", maxcopy); - comment("--------"); -} - diff --git a/mps/qa/test/testlib/newfmt.h b/mps/qa/test/testlib/newfmt.h deleted file mode 100644 index c79b84d5dfc..00000000000 --- a/mps/qa/test/testlib/newfmt.h +++ /dev/null @@ -1,88 +0,0 @@ -/* $HopeName: MMQA_harness!testlib:newfmt.h(trunk.2) $ -newfmt.h - A nice format with graph checking and statistics -*/ - -#ifndef newfmt_h -#define newfmt_h - -#include "testlib.h" - -extern int formatcomments; -extern int checkcomments; -extern int countcomments; -extern int alloccomments; -extern int fixcomments; - -/* the object format is visible so tests that want to - can hack around with it -*/ - -#define MAXSIZE 10000 - -enum {MCpadsingle=(int) 0xBAD51497, MCpadmany=(int) 0xBAD3A41, - MCheart=(int) 0x8EA62, MCdata=(int) 0xDA2A}; - -enum {MCerrorid=(int) 0xE660E}; - -/* n.b. MCerrorid < 0x1000000 so it won't clash with id of - any ordinary object -*/ - -typedef union mycell mycell; - -typedef int tag; - -struct padsingle {tag tag;}; - -struct padmulti {tag tag; mps_addr_t next;}; - -struct heart {tag tag; size_t size; mps_addr_t obj;}; - -struct data -{ - tag tag; - size_t size; - long int id; - long int copycount; - long int numrefs; - int checkedflag; - struct refitem {mycell *addr; long int id;} ref[MAXSIZE]; -}; - -union mycell -{ - tag tag; - struct padsingle padsingle; - struct padmulti padmulti; - struct heart heart; - struct data data; -}; - -extern struct mps_fmt_A_s fmtA; - -mycell *allocone(mps_ap_t ap, int size); -mycell *allocdumb(mps_ap_t ap, size_t bytes); - -mps_addr_t getdata(mycell *obj); -void setref(mycell *obj, int n, mycell *to); -mycell *getref(mycell *obj, int n); - -long int getid(mycell *obj); -long int getcopycount(mycell *obj); -long int getsize(mycell *obj); - -void checkfrom(mycell *obj); - -#define RC resetcounters() -#define UC updatecounters() -#define DC displaycounters() -#define DMC displaymaxcounters() - -void resetcounters(void); -void updatecounters(void); -void displaycounters(void); -void displaymaxcounters(void); - -#endif - diff --git a/mps/qa/test/testlib/ossu.h b/mps/qa/test/testlib/ossu.h deleted file mode 100644 index f447ec278a1..00000000000 --- a/mps/qa/test/testlib/ossu.h +++ /dev/null @@ -1,79 +0,0 @@ -/* $HopeName$ - ==== SUNOS ANSI COMPATABILITY HEADER ==== - * - * $HopeName: MMQA_harness!testlib:ossu.h(trunk.1) $ - * - * Copyright (C) 1994,1995 Harlequin Group, all rights reserved - * - * This header defines some things which are part of the ANSI standard but - * missing from the C compiler / environment. - * - * See also syscalls.h, which contains prototypes for system calls - * which are not prototyped in include files - * - * This header was imported from the MLWorks runtime system, when it - * had the following id: - * src:OS:SunOS:ansi.h,v 1.2 1994/06/09 14:24:35 nickh - */ - -#ifndef ansi_h -#define ansi_h - -#include -#include -#include -#include - -/* on the Suns, the include files in /usr/include do not include -declarations for a large number of ANSI functions. We remedy that -here. */ - -/* stdio.h things */ - -extern int fclose (FILE *stream); -extern int fflush (FILE *stream); -extern int fgetc (FILE *stream); -extern int ungetc (int c, FILE *stram); -extern int fputc (int c, FILE *stream); -extern int printf (const char *format, ...); -extern int fprintf (FILE *stream, const char *format, ...); -extern int vfprintf (FILE *stream, const char *format, va_list arg); -extern int vsprintf (char *s, const char *format, va_list arg); -extern int fputs (const char *s, FILE *stream); -extern int fscanf (FILE *stream, const char *format, ...); -extern int sscanf (const char *s, const char *format, ...); -extern int fseek (FILE *stream, long int offset, int whence); -extern size_t fread (void *ptr, size_t size, size_t nmemb, FILE *stream); -extern size_t fwrite (const void *ptr, size_t size, size_t nmemb, - FILE *stream); - -/* these functions are used in the macro definitions of putc and getc -but not declared in stdio.h */ - -extern int _filbuf(FILE *stream); - -#ifdef __GNUC__ -extern int _flsbuf(unsigned char c, FILE *stream); -#else -extern int _flsbuf(FILE *stream); -#endif - -/* time.h things */ - -#ifndef __GNUC__ -typedef long clock_t; -#endif -extern size_t strftime (char *s, size_t maxsize, const char *format, - const struct tm *timeptr); -extern time_t time (time_t *timer); -extern clock_t clock(void); - -/* stdlib.h things */ - -extern int system(const char *string); - -/* string.h things */ - -extern void *memset(void *, int, size_t); - -#endif diff --git a/mps/qa/test/testlib/platform.c b/mps/qa/test/testlib/platform.c deleted file mode 100644 index 70721ee8d1b..00000000000 --- a/mps/qa/test/testlib/platform.c +++ /dev/null @@ -1,43 +0,0 @@ -/* $HopeName: MMQA_harness!testlib:platform.c(trunk.3) $ -*/ - -#include "testlib.h" -/* that includes platform.h, so we don't need to */ - -#ifdef MPS_OS_SU - -void *memmove(void *to, void *from, size_t bytes) -{ - bcopy((char *)from, (char *)to, (int)bytes); - return to; -} - -#endif - -#ifdef MPS_OS_W3 - -LONG mySEHFilter(LPEXCEPTION_POINTERS info) { - LPEXCEPTION_RECORD er; - int write; - unsigned long address; - - er = info->ExceptionRecord; - - if (er->ExceptionCode == EXCEPTION_ACCESS_VIOLATION) { - write = er->ExceptionInformation[0]; - address = er->ExceptionInformation[1]; - report("memoryerror", "true"); - if (write == 1) { - report("memoryop", "write"); - } else { /* write == 0 */ - report("memoryop", "read"); - } - report("memoryaddr", "%ld", address); - myabort(); - } - - /* otherwise don't interfere */ - return EXCEPTION_CONTINUE_SEARCH; -} - -#endif diff --git a/mps/qa/test/testlib/platform.h b/mps/qa/test/testlib/platform.h deleted file mode 100644 index 4ab7d33995a..00000000000 --- a/mps/qa/test/testlib/platform.h +++ /dev/null @@ -1,34 +0,0 @@ -/* $HopeName: MMQA_harness!testlib:platform.h(trunk.6) $ - load appropriate header files to do platform-specific - stuff. -*/ - -#ifdef MPS_OS_SU - -/* SunOS (4) doesn't have memmove, which would be handy for - writing copy functions in formats. So... -*/ - -/* (I copied ossu.h from the mps header files for - thursday afternoon) -*/ - -#include "ossu.h" -#define EXIT_FAILURE 1 -#define EXIT_SUCCESS 0 -#define CLOCKS_PER_SEC 1000000 -int scanf(const char *format, ...); -void bcopy(char* from, char* to, int bytes); -void *memmove(void *to, void *from, size_t bytes); -#endif - -#ifdef MPS_OS_W3 -#ifdef MMQA_HEADER_mpsw3 -/* we may be required to include mpsw3.h on windows platforms */ -#include "mpsw3.h" -#endif -/* to trap access violations in the test harness */ -LONG mySEHFilter(LPEXCEPTION_POINTERS); -#endif - - diff --git a/mps/qa/test/testlib/postBQ.h b/mps/qa/test/testlib/postBQ.h deleted file mode 100644 index 084a5ce5f22..00000000000 --- a/mps/qa/test/testlib/postBQ.h +++ /dev/null @@ -1,7 +0,0 @@ -/* $HopeName: $ -In baroque interface - - no change (necessary to include mpsw3; done in platform.h) -*/ - -#include "postGR.h" - diff --git a/mps/qa/test/testlib/postGR.h b/mps/qa/test/testlib/postGR.h deleted file mode 100644 index 183dcd67993..00000000000 --- a/mps/qa/test/testlib/postGR.h +++ /dev/null @@ -1,29 +0,0 @@ -/* $HopeName: $ -In grotesq interface - - "space" becomes "arena" -*/ - -#include "postMO.h" - -#define mps_space_clamp(a) \ - mps_arena_clamp(a) - -#define mps_space_release(a) \ - mps_arena_release(a) - -#define mps_space_park(a) \ - mps_arena_park(a) - -#define mps_space_collect(a) \ - mps_arena_collect(a) - -#define mps_space_destroy(a) \ - mps_arena_destroy(a) - -#define mps_space_reserved(a) \ - mps_arena_reserved(a) - -#define mps_space_committed(a) \ - mps_arena_committed(a) - - diff --git a/mps/qa/test/testlib/postHU.h b/mps/qa/test/testlib/postHU.h deleted file mode 100644 index 3dea70ff839..00000000000 --- a/mps/qa/test/testlib/postHU.h +++ /dev/null @@ -1,7 +0,0 @@ -/* $HopeName: $ -In humanist interface - - no change -*/ - -#include "postBQ.h" - diff --git a/mps/qa/test/testlib/postMO.h b/mps/qa/test/testlib/postMO.h deleted file mode 100644 index f15d6a6cdf0..00000000000 --- a/mps/qa/test/testlib/postMO.h +++ /dev/null @@ -1,5 +0,0 @@ -/* $HopeName: $ -In modern interface - - nothing new -*/ - diff --git a/mps/qa/test/testlib/preBQ.h b/mps/qa/test/testlib/preBQ.h deleted file mode 100644 index 70d9485be92..00000000000 --- a/mps/qa/test/testlib/preBQ.h +++ /dev/null @@ -1,6 +0,0 @@ -/* $HopeName: $ -Before baroque interface; - - nothing was different. Only change in BQ is inclusing of mpsw3.h. -*/ - -#include "preHU.h" diff --git a/mps/qa/test/testlib/preGR.h b/mps/qa/test/testlib/preGR.h deleted file mode 100644 index 195e6b326c2..00000000000 --- a/mps/qa/test/testlib/preGR.h +++ /dev/null @@ -1,29 +0,0 @@ -/* $HopeName: $ -Before grotesque interface; - - "arena" was called "space" in several functions -*/ - - -#define mps_arena_clamp(a) \ - mps_space_clamp(a) - -#define mps_arena_release(a) \ - mps_space_release(a) - -#define mps_arena_park(a) \ - mps_space_park(a) - -#define mps_arena_collect(a) \ - mps_space_collect(a) - -#define mps_arena_destroy(a) \ - mps_space_destroy(a) - -#define mps_arena_reserved(a) \ - mps_space_reserved(a) - -#define mps_arena_committed(a) \ - mps_space_committed(a) - - -#include "preBQ.h" diff --git a/mps/qa/test/testlib/preHU.h b/mps/qa/test/testlib/preHU.h deleted file mode 100644 index 0895952ee82..00000000000 --- a/mps/qa/test/testlib/preHU.h +++ /dev/null @@ -1,14 +0,0 @@ -/* $HopeName: $ -Before humanist interface; - -- there was no spare committed fund -*/ - -#define mps_arena_spare_committed(a) ((size_t) 0) -#define mps_arena_spare_commit_limit(a) ((size_t) 0) -#define mps_arena_spare_commit_limit_set(a, l) \ - asserts(0, \ - "MPS interface versions before HU do not support the spare committed fund") - - -/* #include "preXX.h" -- the next interface version, when there is one */ - diff --git a/mps/qa/test/testlib/preMO.h b/mps/qa/test/testlib/preMO.h deleted file mode 100644 index 8a428e1d638..00000000000 --- a/mps/qa/test/testlib/preMO.h +++ /dev/null @@ -1,14 +0,0 @@ -/* $HopeName: $ -Before modern interface; - - no closure arguments for mps_root_create_reg - - no rank argument for mps_ap_create (ever) -*/ - -#define mps_root_create_reg(ro, sp, ra, rm, thr, scan, p, _s) \ - (mps_root_create_reg)(ro, sp, ra, rm, thr, scan, p) - -#define mps_ap_create(a, p, _r) \ - (mps_ap_create)(a, p) - - -#include "preGR.h" diff --git a/mps/qa/test/testlib/rankfmt.c b/mps/qa/test/testlib/rankfmt.c deleted file mode 100644 index db8feea2a64..00000000000 --- a/mps/qa/test/testlib/rankfmt.c +++ /dev/null @@ -1,725 +0,0 @@ -/* $HopeName: MMQA_harness!testlib:rankfmt.c(trunk.6) $ -rankfmt.c - See comments in header file for usage. -*/ - -#include "rankfmt.h" -#include - - -/* some options on the format are controlled by global - variables. Of course for efficiency we'd do it in the - pre-processor, but that would require recompilation... -*/ - -int formatcomments=0; -int checkcomments=0; -int countcomments=1; -int alloccomments=0; -int fixcomments=0; -int deathcomments=0; -int skipcomments=0; -int splurgeassoc=0; /* write madly to associated objects */ - - -long int nextid=0x1000000; - -long int checkobjcount=0; - -mycell *exfmt_root = NULL; - -int counters[PAD_COUNT+1] = {0}; -int prevcounters[PAD_COUNT+1] = {0}; -int maxcounters[PAD_COUNT+1] = {0}; - -long int maxcopy = 0; -int freeze=0; - - -/* The AWL pool makes certain assumptions about the object format, - some necessary and some unnecessary but useful for detecting problems - when using fmtdy. We have to ensure that: - - Each objects begins with a pointer to a wrapper. To tag objects, - use non-zero values for the low bits. - The second word in each object is a pointer to the associated object, - usual rules for references apply. - - The wrapper begins with a wrapper-wrapper pointer, and the third word - of the wrapper object has bit 0 set and bit 1 clear and at least one higher - bit also set. The fourth word is the same, to cater for the new Dylan - object format used by honeybee.3 and later releases. - - The wrapper-wrapper's first word points to itself. - - Here I make the wrapper-wrapper equal to the wrapper for all objects, - and use the same wrapper for all objects. - - The other pools don't care about the wrapper, of course. -*/ - -struct wrapper { - struct wrapper *ww; - mps_word_t tag; - mps_word_t fixedlen; - mps_word_t newfixedlen; -}; - -struct wrapper wrapobj = { - &wrapobj, - 0x36ABBE6, - 0x5, - 0x5 -}; - -mycell *wrapper = (mycell *) &wrapobj; - - -#define INCCOUNT(c) do {if(!freeze) counters[c]+=1;} while (0) -#define INCCOUNTIF(f, c) do {if(f) INCCOUNT(c);} while (0) - - -/* a cell can be one of four things, depending on its type: - MCpad - a pad item - MCheart - a broken heart, aka forwarding object - MCdata - a real object -*/ - - -/* the scanning function doesn't try to fix null refs -*/ - -static mps_res_t myscan(mps_ss_t ss, mps_addr_t base, mps_addr_t limit); -static mps_addr_t myskip(mps_addr_t object); -static void myfwd(mps_addr_t object, mps_addr_t to); -static mps_addr_t myisfwd(mps_addr_t object); -static void mycopy(mps_addr_t object, mps_addr_t to); -static void mypad(mps_addr_t base, size_t size); - - -struct mps_fmt_A_s fmtA = -{ - MPS_PF_ALIGN, - &myscan, - &myskip, - &mycopy, - &myfwd, - &myisfwd, - &mypad -}; - - -/* in the following, size is the number of refs you want - the allocated object to have -*/ - -mps_res_t allocrdumb(mycell **rvar, mps_ap_t ap, - size_t size, mps_rank_t rank) { - mps_addr_t addr; - mycell *q; - size_t bytes; - mps_res_t res; - size_t alignment; - - bytes = offsetof(struct data, ref) + size; - - alignment = MPS_PF_ALIGN; /* needed to make it as wide as size_t */ - - /* twiddle the value of size to make it aligned */ - bytes = (bytes+alignment-1) & ~(alignment-1); - - do - { - res = mps_reserve(&addr, ap, bytes); - if (res) goto Finish; - INCCOUNT(RESERVE_COUNT); - q = (mycell *)addr; - q->data.tag = (mps_word_t) wrapper; - q->data.assoc = NULL; - q->data.id = nextid; - q->data.copycount = 0; - q->data.numrefs = 0; - q->data.checkedflag = 0; - q->data.rank = rank; - q->data.size = bytes; - } - while (!mps_commit(ap, addr, bytes)); - INCCOUNT(ALLOC_COUNT); - commentif(alloccomments, "allocated id %li at %p.", nextid, q); - nextid += 1; - *rvar = q; - -Finish: - return res; -} - - -mycell *allocdumb(mps_ap_t ap, size_t size, mps_rank_t rank) { - mycell *q; - - die(allocrdumb(&exfmt_root, ap, size, rank), "Reserve: "); - q = exfmt_root; - return q; -} - - -mps_res_t allocrone(mycell **rvar, mps_ap_t ap, int size, mps_rank_t rank) { - mps_addr_t addr; - mycell *q; - int i; - size_t bytes; - size_t alignment; - mps_res_t res; - - bytes = offsetof(struct data, ref) + size*sizeof(struct refitem); - - alignment = MPS_PF_ALIGN; /* needed to make it as wide as size_t */ - - /* twiddle the value of size to make it aligned */ - bytes = (bytes+alignment-1) & ~(alignment-1); - - do - { - res = mps_reserve(&addr, ap, bytes); - if (res) goto Finish; - INCCOUNT(RESERVE_COUNT); - q = (mycell *)addr; - q->data.tag = MCdata + (mps_word_t) wrapper; - q->data.assoc = NULL; - q->data.id = nextid; - q->data.copycount = 0; - q->data.numrefs = size; - q->data.checkedflag = 0; - q->data.rank = rank; - q->data.size = bytes; - - for(i=0; idata.ref[i].addr = NULL; - q->data.ref[i].id = 0; - } - } - while (!mps_commit(ap, addr, bytes)); - INCCOUNT(ALLOC_COUNT); - commentif(alloccomments, "allocated id %li at %p.", nextid, q); - nextid += 1; - *rvar = q; - -Finish: - return res; -} - - -mycell *allocone(mps_ap_t ap, int size, mps_rank_t rank) { - mycell *q; - - die(allocrone(&exfmt_root, ap, size, rank), "Reserve: "); - q = exfmt_root; - return q; -} - - -mps_res_t reservoir_allocrdumb(mycell **rvar, mps_ap_t ap, - size_t size, mps_rank_t rank) { - mps_addr_t addr; - mycell *q; - size_t bytes; - mps_res_t res; - size_t alignment; - - bytes = offsetof(struct data, ref) + size; - - alignment = MPS_PF_ALIGN; /* needed to make it as wide as size_t */ - - /* twiddle the value of size to make it aligned */ - bytes = (bytes+alignment-1) & ~(alignment-1); - - do - { - res = mps_reserve_with_reservoir_permit(&addr, ap, bytes); - if (res) goto Finish; - INCCOUNT(RESERVE_COUNT); - q = (mycell *)addr; - q->data.tag = (mps_word_t) wrapper; - q->data.assoc = NULL; - q->data.id = nextid; - q->data.copycount = 0; - q->data.numrefs = 0; - q->data.checkedflag = 0; - q->data.rank = rank; - q->data.size = bytes; - } - while (!mps_commit(ap, addr, bytes)); - INCCOUNT(ALLOC_COUNT); - commentif(alloccomments, "allocated id %li at %p.", nextid, q); - nextid += 1; - *rvar = q; - -Finish: - return res; -} - - -mycell *reservoir_allocdumb(mps_ap_t ap, size_t size, mps_rank_t rank) { - mycell *q; - - die(reservoir_allocrdumb(&exfmt_root, ap, size, rank), "Reserve: "); - q = exfmt_root; - return q; -} - - -mps_res_t reservoir_allocrone(mycell **rvar, mps_ap_t ap, - int size, mps_rank_t rank) { - mps_addr_t addr; - mycell *q; - int i; - size_t bytes; - size_t alignment; - mps_res_t res; - - bytes = offsetof(struct data, ref) + size*sizeof(struct refitem); - - alignment = MPS_PF_ALIGN; /* needed to make it as wide as size_t */ - - /* twiddle the value of size to make it aligned */ - bytes = (bytes+alignment-1) & ~(alignment-1); - - do - { - res = mps_reserve_with_reservoir_permit(&addr, ap, bytes); - if (res) goto Finish; - INCCOUNT(RESERVE_COUNT); - q = (mycell *)addr; - q->data.tag = MCdata + (mps_word_t) wrapper; - q->data.assoc = NULL; - q->data.id = nextid; - q->data.copycount = 0; - q->data.numrefs = size; - q->data.checkedflag = 0; - q->data.rank = rank; - q->data.size = bytes; - - for(i=0; idata.ref[i].addr = NULL; - q->data.ref[i].id = 0; - } - } - while (!mps_commit(ap, addr, bytes)); - INCCOUNT(ALLOC_COUNT); - commentif(alloccomments, "allocated id %li at %p.", nextid, q); - nextid += 1; - *rvar = q; - -Finish: - return res; -} - - -mycell *reservoir_allocone(mps_ap_t ap, int size, mps_rank_t rank) { - mycell *q; - - die(reservoir_allocrone(&exfmt_root, ap, size, rank), "Reserve: "); - q = exfmt_root; - return q; -} - - -static mps_res_t myscan(mps_ss_t ss, mps_addr_t base, mps_addr_t limit) -{ - int i; - - INCCOUNT(SCANCALL_COUNT); - MPS_SCAN_BEGIN(ss) - { - while (base < limit) - { - mycell *obj = base; - mps_res_t res; - mps_addr_t p, q; - mps_rank_t rank; - - switch (obj->tag & 0x3) - { - case MCpad: - INCCOUNT(SCANPAD_COUNT); - base = (mps_addr_t) (obj->pad.tag &~ (mps_word_t) 3); - break; - case MCdata: - /* actual scanning is done in here */ - asserts(obj->tag == MCdata + (mps_word_t) wrapper, "scan on bad object"); - asserts(obj->data.id != MCerrorid, "scan on error object"); - rank = obj->data.rank; - INCCOUNT(SCANOBJ_COUNT); - commentif(formatcomments, "scan %li at %p.", obj->data.id, base); - - /* make sure to fix the assoc pointer first */ - p = obj->data.assoc; - if (p != NULL) { - commentif(fixcomments, "fix %li[assoc]", obj->data.id); - q = p; - res = MPS_FIX(ss, (mps_addr_t *) &p); - if (res != MPS_RES_OK) return res; - if (p == NULL) { - asserts(rank == MPS_RANK_WEAK, - "non-weak reference fixed to NULL at %p[assoc]", obj); - commentif(deathcomments, "fixed %p[assoc] to NULL", obj->data.id); - INCCOUNT(DYING_REFERENCE_COUNT); - } else if (p != q) { - asserts(rank != MPS_RANK_AMBIG, - "ambiguous reference changed by fix at %p[assoc]", obj); - } - obj->data.assoc = p; - } - - for (i=0; i<(obj->data.numrefs); i++) - { - p = obj->data.ref[i].addr; - if (p != NULL) - { - /* copy ref to p for fixing, to avoid a pun (although - the pun would probably work fine almost everywhere) - */ - commentif(fixcomments, "fix %li[%i] -> %li", - obj->data.id, i, obj->data.ref[i].id); - q = p; - res = MPS_FIX(ss, (mps_addr_t *) &p); - if (p == NULL) { - asserts(rank == MPS_RANK_WEAK, - "non-weak reference fixed to NULL at %p[i]", obj); - commentif(deathcomments, "fixed %li[%i] to NULL", obj->data.id, i); - INCCOUNT(DYING_REFERENCE_COUNT); - } else if (p != q) { - asserts(rank != MPS_RANK_AMBIG, - "ambiguous reference changed by fix at %p[i]", obj); - } - if (res != MPS_RES_OK) return res; - obj->data.ref[i].addr = p; - } - } - base = (mps_addr_t) ((char *) obj + (obj->data.size)); - break; - case MCheart: - INCCOUNT(SCANHEART_COUNT); - base = (mps_addr_t) ((char *) obj + (obj->heart.size)); - break; - default: - asserts(0, "scan: bizarre obj tag at %p.", obj); - } - } - } - MPS_SCAN_END(ss); - return MPS_RES_OK; -} - - -static mps_addr_t myskip(mps_addr_t object) -{ - mycell *obj = object; - - commentif(skipcomments, "skip %p.", object); - INCCOUNT(SKIP_COUNT); - switch(obj->tag & 0x3) - { - case MCpad: - return (mps_addr_t) (obj->pad.tag &~ (mps_word_t) 0x3); - case MCheart: - return (mps_addr_t) ((char *) obj + (obj->heart.size)); - case MCdata: - asserts(obj->tag == MCdata + (mps_word_t) wrapper, - "skip on bad obj at %p.", obj); - return (mps_addr_t) ((char *) obj + (obj->data.size)); - default: - asserts(0, "skip: bizarre obj tag at %p.", obj); - return 0; /* not reached */ - } -} - - -static void mycopy(mps_addr_t object, mps_addr_t to) -{ - mycell *boj = object; - mycell *toj = to; - - asserts(boj->tag == MCdata + (mps_word_t) wrapper, - "copy: non-data object"); - - INCCOUNT(COPY_COUNT); - commentif(formatcomments, "copy: %li: %p -> %p\n", - boj->data.id, object, to); - - /* this line would be bad, because the objects might overlap, - and then C doesn't guarantee to do the right thing! - - *toj = *boj; - */ - - memmove(to, object, boj->data.size); - if (!freeze) - { - toj->data.copycount = (toj->data.copycount)+1; - if (toj->data.copycount > maxcopy) maxcopy = toj->data.copycount; - } -} - - -/* pad stores not its size but a pointer to the next object, - because we know we'll never be asked to copy it -*/ - -static void mypad(mps_addr_t base, size_t size) -{ - mycell *obj = base; - - asserts(size >= MPS_PF_ALIGN, "pad: size too small."); - - INCCOUNT(PAD_COUNT); - obj->pad.tag = MCpad + (mps_word_t) ((char *) base + size); -} - - -static mps_addr_t myisfwd(mps_addr_t object) -{ - mycell *obj = object; - - INCCOUNT(ISFWD_COUNT); - if ((obj->tag & 3) != MCheart) - { - return NULL; - } - else - { - return obj->heart.obj; - } -} - - -static void myfwd(mps_addr_t object, mps_addr_t to) -{ - mycell *obj = object; - size_t size; - - asserts(((obj->tag & 3) == MCdata) || ((obj->tag & 3) == MCheart), - "fwd: unexpected object tag at %p.", obj); - INCCOUNT(FWD_COUNT); - - if ((obj->tag & 3) == MCdata) - { - asserts(obj->tag == MCdata + (mps_word_t) wrapper, - "fwd: bad obj at %p.", obj); - size = obj->data.size; - } - else /* obj->tag == MCheart */ - { - size = obj->heart.size; - } - obj->data.tag = MCheart; - obj->heart.obj = to; - obj->heart.size = size; -} - - -/* --------------------------------------------------------------- - Access methods for mycell objects -*/ - -/* set the nth reference of obj to to (n from 0 to size-1) */ - -void setref(mycell *obj, int n, mycell *to) -{ - asserts(obj->tag == MCdata + (mps_word_t) wrapper, - "setref: from non-data object at %p", obj); - asserts((to==NULL)||((to->tag & 3) == MCdata), - "setref: to non-data object at %p", to); - asserts(obj->data.numrefs > n, "setref: access beyond object size."); - - obj->data.ref[n].addr = to; - obj->data.ref[n].id = (to==NULL ? 0 : to->data.id); -} - - -mycell *getref(mycell *obj, int n) -{ - asserts(obj->tag == MCdata + (mps_word_t) wrapper, - "getref: from non-data object."); - asserts(obj->data.numrefs > n, "getref: access beyond object size."); - return obj->data.ref[n].addr; -} - - -mps_addr_t getdata(mycell *obj) -{ - return (mps_addr_t) &(obj->data.ref[0]); -} - - -long int getid(mycell *obj) -{ - asserts(obj->tag == MCdata + (mps_word_t) wrapper, - "getid: non-data object."); - return obj->data.id; -} - - -long int getcopycount(mycell *obj) -{ - asserts(obj->tag == MCdata + (mps_word_t) wrapper, - "getcopycount: non-data object."); - return obj->data.copycount; -} - - -long int getsize(mycell *obj) -{ - asserts(obj->tag == MCdata + (mps_word_t) wrapper, - "getsize: non-data object."); - return obj->data.numrefs; -} - - -/* --------------------------------------------------------------- - Now the useful things specially for checking the graph -*/ - -/* recursively check the graph, starting at an object. - We do the check twice, so as to restore the - checkflags to zero. -*/ - -static void checkloop(mycell *obj, int dir) -{ - mycell *toj; - int tid; - int i; - - asserts(obj->tag == MCdata + (mps_word_t) wrapper, - "checkfrom: non data object in graph at %p.", obj); - - if (obj->data.checkedflag != dir) - { - commentif(checkcomments, "checking %p = %li", obj, obj->data.id); - - checkobjcount += 1; - - obj->data.checkedflag = dir; - - if (obj->data.assoc != NULL) { - toj = obj->data.assoc; - checkloop(toj, dir); - } - for (i=0; i<(obj->data.numrefs); i+=1) - { - if (obj->data.ref[i].addr != NULL) - { - toj = (obj->data.ref[i].addr); - tid = (obj->data.ref[i].id); - asserts(toj->data.id == tid, - "checkfrom: corrupt graph at %p, %d.", obj, i); - checkloop(toj, dir); - } - } - } -} - - -void checkfrom(mycell *obj) -{ - int k; - - freeze = 1; /* suspend counting while checking graph */ - checkobjcount = 0; - checkloop(obj, 1); - comment("checkfrom: %li live objects checked", checkobjcount); - k = checkcomments; - checkcomments = 0; - checkloop(obj, 0); - checkcomments = k; - comment("checkfrom: graph ok from ID: %li.", obj->data.id); - freeze = 0; /* resume counting */ -} - - -/* ---------------------------------------------------------- - Now things to reset and display the counters -*/ - -void resetcounters(void) -{ - int i; - for (i=0; i < PAD_COUNT+1; i++) - { - counters[i]=0; - prevcounters[i]=0; - maxcounters[i]=0; - } - maxcopy = 0; -} - - -void updatecounters(void) -{ - int i; - for (i=0; i < PAD_COUNT+1; i++) - { - if (counters[i]-prevcounters[i] > maxcounters[i]) - { - maxcounters[i]=counters[i]-prevcounters[i]; - } - prevcounters[i]=counters[i]; - } -} - - -static void d_c(int i, char *name) -{ - comment("%10d %s", counters[i], name); -} - - -static void d_mc(int i, char *name) -{ - comment("%10d %s", maxcounters[i], name); -} - - -void displaycounters(void) -{ - comment("--------"); - comment("Counters:"); - d_c(SCANCALL_COUNT, "scan calls"); - d_c(SCANOBJ_COUNT, "object scans"); - d_c(SCANHEART_COUNT, "heart scans"); - d_c(SCANPAD_COUNT, "pad scans"); - d_c(COPY_COUNT, "copys"); - d_c(SKIP_COUNT, "skips"); - d_c(FWD_COUNT, "fwds"); - d_c(ISFWD_COUNT, "isfwds"); - d_c(PAD_COUNT, "pads"); - d_c(RESERVE_COUNT, "reserve calls"); - d_c(ALLOC_COUNT, "allocations"); - d_c(DYING_REFERENCE_COUNT, "references fixed to NULL"); - comment("--------"); -} - - -void displaymaxcounters(void) -{ - comment("--------"); - comment("Maximum counter values:"); - d_mc(SCANCALL_COUNT, "scan calls"); - d_mc(SCANOBJ_COUNT, "object scans"); - d_mc(SCANHEART_COUNT, "heart scans"); - d_mc(SCANPAD_COUNT, "pad scans"); - d_mc(COPY_COUNT, "copys"); - d_mc(SKIP_COUNT, "skips"); - d_mc(FWD_COUNT, "fwds"); - d_mc(ISFWD_COUNT, "isfwds"); - d_mc(RESERVE_COUNT, "reserve calls"); - d_mc(ALLOC_COUNT, "allocations"); - d_mc(DYING_REFERENCE_COUNT, "references fixed to NULL"); - d_mc(PAD_COUNT, "pads"); - comment("--------"); - comment("max copies of a single object: %li.", maxcopy); - comment("--------"); -} diff --git a/mps/qa/test/testlib/rankfmt.h b/mps/qa/test/testlib/rankfmt.h deleted file mode 100644 index cb39815409d..00000000000 --- a/mps/qa/test/testlib/rankfmt.h +++ /dev/null @@ -1,155 +0,0 @@ -/* $HopeName: MMQA_harness!testlib:rankfmt.h(trunk.6) $ - - Format like exfmt but with rank-checking built in. - - This format will work without register roots, but to use it, you must - take precautions. You must register exfmt_root as a root, and unless - you register the registers and stack, you must register it as - ambiguous (or it might change before you can write the address of a - newly allocated object into another root). When you call getref or - setref, you must make sure that the objects concerned are referenced - ambiguously somewhere (this guarantees that they won't move -- I - asked richard and drj). -*/ - -#ifndef rankfmt_h -#define rankfmt_h - - -#include "testlib.h" - - -extern int formatcomments; -extern int checkcomments; -extern int countcomments; -extern int alloccomments; -extern int fixcomments; -extern int deathcomments; -extern int skipcomments; -extern int splurgeassoc; /* write to associated objects (but don't change) */ - - -/* the counters are visible so that I can check whether things - get moved etc -*/ - -enum { - SCANCALL_COUNT, - SCANOBJ_COUNT, /* = read objects scanned */ - SCANPAD_COUNT, /* = pads scanned */ - SCANHEART_COUNT, /* = hearts scanned */ - COPY_COUNT, - SKIP_COUNT, - FWD_COUNT, - ISFWD_COUNT, - RESERVE_COUNT, - ALLOC_COUNT, - DYING_REFERENCE_COUNT, - PAD_COUNT /* must come last or array sizes will be too small */ -}; - -extern int counters[PAD_COUNT+1]; -extern int prevcounters[PAD_COUNT+1]; -extern int maxcounters[PAD_COUNT+1]; - - -long int maxcopy; -int freeze; - - -/* the object format is visible so tests that want to - can hack around with it -*/ - -#define MAXSIZE 10000 - -enum {MCpad=(int) 0x1, MCheart=(int) 0x2, MCdata=(int) 0x0}; - -enum {MCerrorid=(int) 0xE6606}; - - -/* n.b. MCerrorid < 0x1000000 so it won't clash with id of - any ordinary object -*/ - -typedef union mycell mycell; - - -typedef mps_word_t tag; - - -struct pad {tag tag;}; - - -struct heart {tag tag; mps_addr_t obj; size_t size;}; - - -struct data -{ - tag tag; - mycell *assoc; - size_t size; - long int id; - long int copycount; - long int numrefs; - int checkedflag; - mps_rank_t rank; - struct refitem {mycell *addr; long int id;} ref[MAXSIZE]; -}; - - -union mycell -{ - tag tag; - struct pad pad; - struct heart heart; - struct data data; -}; - - -extern struct mps_fmt_A_s fmtA; - - -mycell *allocone(mps_ap_t ap, int size, mps_rank_t rank); -mycell *allocdumb(mps_ap_t ap, size_t bytes, mps_rank_t rank); - -mps_res_t allocrone(mycell **rvar, mps_ap_t ap, int size, mps_rank_t rank); -mps_res_t allocrdumb(mycell **rvar, mps_ap_t ap, size_t bytes, mps_rank_t rank); - -mycell *reservoir_allocone(mps_ap_t ap, int size, mps_rank_t rank); -mycell *reservoir_allocdumb(mps_ap_t ap, size_t bytes, mps_rank_t rank); - -mps_res_t reservoir_allocrone(mycell **rvar, mps_ap_t ap, int size, - mps_rank_t rank); -mps_res_t reservoir_allocrdumb(mycell **rvar, mps_ap_t ap, size_t bytes, - mps_rank_t rank); - - -mps_addr_t getdata(mycell *obj); - -void setref(mycell *obj, int n, mycell *to); -mycell *getref(mycell *obj, int n); - -long int getid(mycell *obj); -long int getcopycount(mycell *obj); -long int getsize(mycell *obj); - - -void checkfrom(mycell *obj); - - -#define RC resetcounters() -#define UC updatecounters() -#define DC displaycounters() -#define DMC displaymaxcounters() - -void resetcounters(void); -void updatecounters(void); -void displaycounters(void); -void displaymaxcounters(void); - - -extern mycell *exfmt_root; - - -#endif diff --git a/mps/qa/test/testlib/testlib.c b/mps/qa/test/testlib/testlib.c deleted file mode 100644 index 156eeb1c01a..00000000000 --- a/mps/qa/test/testlib/testlib.c +++ /dev/null @@ -1,573 +0,0 @@ -/* $HopeName: MMQA_harness!testlib:testlib.c(trunk.23) $ -some useful functions for testing the MPS */ - -#include -#include -#include -#include -#include -#include "testlib.h" - -#ifdef MMQA_HEADER_mpsacl -#include "mpsacl.h" -#endif -#ifdef MMQA_HEADER_mpsavm -#include "mpsavm.h" -#endif - - -/* err_text - mps_res_t -> textual description - uses case rather than array lookup 'cos we don't want to - rely on the representation, which might change -*/ - -constant_string_t err_text(mps_res_t err) -{ - switch (err) { - case MPS_RES_OK: return "OK"; - case MPS_RES_FAIL: return "FAIL"; - case MPS_RES_RESOURCE: return "RESOURCE"; - case MPS_RES_MEMORY: return "MEMORY"; - case MPS_RES_LIMIT: return "LIMIT"; - case MPS_RES_UNIMPL: return "UNIMPL"; - case MPS_RES_IO: return "IO"; -#ifdef MMQA_SYMBOL_MPS_RES_COMMIT_LIMIT - case MPS_RES_COMMIT_LIMIT: return "COMMIT_LIMIT"; -#endif -#ifdef MMQA_SYMBOL_MPS_RES_PARAM - case MPS_RES_PARAM: return "PARAMETER"; -#endif - } - asserts(0, "Unknown result code"); - return "*** Unknown result code ***"; -} - - -/* finish, pass - report completed=yes and exit(0) -*/ - -void finish(void) -{ - report("completed", "yes"); - exit(0); -} - - -void pass(void) -{ - finish(); -} - - -/* fail - report completed=no and exit(1) -*/ - -void fail(void) -{ - report("completed", "no"); - exit(1); -} - -/* report - write a var=value line on stdout -*/ - - -void report_res(const char *str, mps_res_t res) -{ - report(str, err_text(res)); -} - - -void report(const char *str, const char *format, ...) -{ - va_list args; - - va_start(args, format); - vreport(str, format, args); - va_end(args); -} - - -void vreport(const char *str, const char *format, va_list args) -{ - fprintf(stdout, "!%s=", str); - vfprintf(stdout, format, args); - fprintf(stdout, "\n"); - fflush(stdout); -} - - -/* cdie - report mps result code, and exit if it's not ok -*/ - -void cdie(mps_res_t err, const char *str) -{ - if (err != MPS_RES_OK) { - error("%s: %s\n", str, err_text(err)); - } - else comment("%s: OK", str); -} - - -/* die - check mps result code it ok; it not, report and exit -*/ - -void die(mps_res_t err, const char *str) -{ - if (err != MPS_RES_OK) { - error("%s: %s\n", str, err_text(err)); - } -} - - -/* adie - report mps result code as error, whatever it is -*/ - -void adie(mps_res_t err, const char *str) -{ - error("%s: %s\n", str, err_text(err)); -} - - -/* comment - print comment on stdout -*/ - -void comment(const char *format, ...) -{ - va_list args; - - va_start(args, format); - vcomment(format, args); - va_end(args); -} - - -void vcomment(const char *format, va_list args) -{ - fprintf(stdout, "%% "); - vfprintf(stdout, format, args); - fprintf(stdout, "\n"); - fflush(stdout); -} - - -/* commentif(boolean, "comment") -*/ - -void commentif(int cond, const char *format, ...) -{ - va_list args; - - if (cond) { - va_start(args, format); - vcomment(format, args); - va_end(args); - } -} - - -/* error - print error on stdout and exit -*/ - -void error(const char *format, ...) -{ - va_list args; - - va_start(args, format); - verror(format, args); - va_end(args); -} - - -void myabort(void) { - exit(EXIT_FAILURE); -} - - -void verror(const char *format, va_list args) -{ - fprintf(stdout, "%% ERROR \n!error=true\n"); - fprintf(stdout, "!errtext="); - vfprintf(stdout, format, args); - fprintf(stdout, "\n"); - fflush(stdout); - myabort(); -} - - -/* asserts(1<0, "Axiom violation."); - assert, with textual message instead of expr printed -*/ - -void asserts(int expr, const char *format, ...) -{ - va_list args; - - if (!expr) { - va_start(args, format); - fprintf(stdout, "%% ASSERTION FAILED \n!assert=true\n"); - fprintf(stdout, "!asserttext="); - vfprintf(stdout, format, args); - fprintf(stdout, "\n"); - fflush(stdout); - va_end(args); - myabort(); - } -} - - -/* routines for easy use of the MPS */ - - -/* my own assertion handler, insalled by easy_tramp -*/ - -static void my_assert_handler(const char *cond, const char *id, - const char *file, unsigned line) -{ - if (line == 0) { -/* assertion condition contains condition, file, line, separated - by newline characters -*/ - const char *val; - - comment("MPS ASSERTION FAILURE"); - report("assert", "true"); - report("assertid", ""); - - fprintf(stdout, "!assertcond="); - val = cond; - while (*val != '\n') { - fputc(*val, stdout); - val++; - } - fputc('\n', stdout); - val++; - fprintf(stdout, "!assertfile="); - while (*val != '\n') { - fputc(*val, stdout); - val++; - } - fputc('\n', stdout); - val++; - report("assertline", val); - fflush(stdout); - } else { - comment("MPS ASSERTION FAILURE"); - report("assert", "true"); - report("assertid", id); - report("assertfile", file); - report("assertline", "%u", line); - report("assertcond", cond); - } - myabort(); -} - - -/* easy_tramp - simplified trampoline, for those who don't want to - pass anything into or out of it -- it takes - a function with no arguments returning nothing -*/ - -static void *call_f(void *p, size_t s) -{ - void (**f)(void) = p; - - mps_assert_install(my_assert_handler); - - (**f)(); - return NULL; -} - - -#if defined(MMQA_PROD_epcore) - -static void easy_tramp2(void (*f)(void)) -{ - call_f(&f, (size_t) 0); -} - -#else - -static void easy_tramp2(void (*f)(void)) -{ - void *result; - - mps_tramp(&result, call_f, &f, (size_t)0); -} - -#endif - - -#ifdef MPS_OS_W3 - -void easy_tramp(void (*f)(void)) -{ - __try { - easy_tramp2(f); - } __except(mySEHFilter(GetExceptionInformation())) { - error("Exception handler messed up."); - } -} - -#else - -void easy_tramp(void (*f)(void)) -{ - easy_tramp2(f); -} - -#endif - - -/* mmqa_pause(n) waits for n seconds -*/ - -void mmqa_pause(unsigned long sec) -{ - clock_t c; - - c = clock(); - if (c != -1) { - c = c + sec*CLOCKS_PER_SEC; - while (clock() < c); - } -} - - -/* nabbed from "ML for the Working Programmer" - * Originally from: - * Stephen K Park & Keith W Miller (1988). Random number generators: - * good ones are to find. Communications of the ACM, 31:1192-1201 - */ - -static unsigned long rnd(void) -{ - static unsigned long seed = 1; - double s; - s = seed; - s *= 16807.0; - s = fmod(s, 2147483647.0); /* 2^31 - 1 */ - seed = (unsigned long)s; - return seed; -} - -unsigned long ranint(unsigned long x) -{ - unsigned long y; - unsigned long max; - - asserts(x>0, "ranint needs positive parameter"); - - if (x==1) return 0; - - max = (2147483647/x)*x; - - do y = rnd(); - while (y>max-1); - - return y%x; -} - - -unsigned long ranrange(unsigned long min, unsigned long max) -{ - return min+ranint(max-min); -} - - -/* Event log running - - Event logs contain lines of the form - A -- alloc - F -- free -*/ - -int read_event(log_event* event) -{ - int r; - unsigned long a, b; - r = scanf("A%lu%lu\n", &a, &b); - if (r == EOF) { - return 0; - } else if (r > 0) { -/* comment("A %lu %lu", a, b); -*/ - asserts(r == 2, "bad alloc event"); - event->type = EVENT_ALLOC; - event->alloc.id = a; - event->alloc.size = b; - return 1; - } - r = scanf("F%lu\n", &a); - if (r == EOF) { - return 0; - } else if (r > 0) { -/* - comment("F %lu", a); -*/ - asserts(r == 1, "bad free event"); - event->type = EVENT_FREE; - event->free.id = a; - return 1; - } else { - comment("unknown event: "); - for (r = 0; r < 5; r++) { - comment("%d", getchar()); - } - error("unknown event"); - } - /* to make compiler happy */ - return 0; -} - - -/* A useful function the MPS doesn't provide */ - -size_t arena_committed_and_used(mps_arena_t arena) -{ - return mps_arena_committed(arena)-mps_arena_spare_committed(arena); -} - - -/* A function to make it easy to parameterise tests by arena - class -*/ - -#ifdef MMQA_SYMBOL_mps_arena_t - -mps_res_t mmqa_arena_create(mps_arena_t *arena_p, - mps_arena_class_t arena_class, - size_t chunk_size, size_t limit_size) -{ - mps_res_t res; - mps_arena_t arena; - if ( 0 -#ifdef MMQA_DEFINED_mps_arena_class_cl - || arena_class == mps_arena_class_cl() -#endif - ) { - void *block; - block = malloc(limit_size); - if(block == NULL) { - return MPS_RES_MEMORY; - } - res = mps_arena_create(&arena, arena_class, limit_size, block); - } else if ( 0 -#ifdef MMQA_DEFINED_mps_arena_class_vm - || arena_class == mps_arena_class_vm() -#endif -#ifdef MMQA_DEFINED_mps_arena_class_vmnz - || arena_class == mps_arena_class_vmnz() -#endif - ) { - res = mps_arena_create(&arena, arena_class, chunk_size); - if (res != MPS_RES_OK) { - return res; - } -#ifdef MMQA_DEFINED_mps_arena_commit_limit_set - res = mps_arena_commit_limit_set(arena, limit_size); - if (res != MPS_RES_OK) { - mps_arena_destroy(arena); - } -#endif - } else { - error("Unknown arena class."); - res = MPS_RES_OK; - } - if (res == MPS_RES_OK) { - *arena_p = arena; - } - return res; -} - -#endif - - -/* TimeQueue - s are implemented as heaps, stored in arrays. First array element - used to keep track of size, how much used, &c. Rest of elements are - entries. -*/ - -void TQInit(TimeQueue TQ, TQElt* element, long int size) -{ - TQ->size = size; - TQ->used = 0; - TQ->element = element; -} - -unsigned long TQSize(TimeQueue TQ) -{ - return TQ->size; -} - -unsigned long TQCount(TimeQueue TQ) -{ - return TQ->used; -} - -int TQEmpty(TimeQueue TQ) -{ - return (TQ->used == 0); -} - -int TQFull(TimeQueue TQ) -{ - return (TQ->used == TQ->size); -} - -unsigned long TQTime(TimeQueue TQ) -{ - asserts(!TQEmpty(TQ), "TQTime called on empty TimeQueue"); - return (TQ->element[0].time); -} - -void *TQElement(TimeQueue TQ) -{ - asserts(!TQEmpty(TQ), "TQElement called on empty TimeQueue"); - return (TQ->element[0].ref); -} - - -void *TQPop(TimeQueue TQ) -{ - void *ref; - void *nref; - unsigned long ntime; - unsigned long i, c, s; - - asserts(!TQEmpty(TQ), "TQPop called on empty TimeQueue"); - - ref = TQ->element[0].ref; - TQ->used -= 1; - s = TQ->used; - ntime = TQ->element[s].time; - nref = TQ->element[s].ref; - i = 0; - while (1) { - c = (2*i)+1; - if (c >= s-1) break; - if (TQ->element[c].time > TQ->element[c+1].time) { - c+=1; - } - if (TQ->element[c].time < i) { - TQ->element[i].time = TQ->element[c].time; - TQ->element[i].ref = TQ->element[c].ref; - i = c; - } else { - break; - } - } - return NULL; -} diff --git a/mps/qa/test/testlib/testlib.h b/mps/qa/test/testlib/testlib.h deleted file mode 100644 index c79559a979b..00000000000 --- a/mps/qa/test/testlib/testlib.h +++ /dev/null @@ -1,177 +0,0 @@ -/* $HopeName: MMQA_harness!testlib:testlib.h(trunk.15) $ -test_lib.h - various handy things for running tests, reporting errors &c. -*/ - -#ifndef testlib_h -#define testlib_h - -#include "mmqasym.h" -#ifndef MMQA_HEADER_mps -#error Header file mps.h not found -#endif -#include "mps.h" -#include "versind.h" -#include "platform.h" - - -/* Give textual description of mps error code */ - -/* Need typedef to avoid bug in MacOS X Public Beta */ -typedef const char *constant_string_t; -constant_string_t err_text(mps_res_t err); - - -/* finish, fail: write completed=yes/no to stdout and - exit (0 or 1 as appropriate). - pass is provided for compatibility with old tests, and is - a synonym for finish. -*/ - -void pass(void); -void finish(void); -void fail(void); - - -/* report: print variable and value to stdout -*/ - -void report_res(const char *str, mps_res_t res); -void report(const char *str, const char *format, ...); -void vreport(const char *str, const char *format, va_list args); - - -/* adie: print text and err code to stdout by calling error - die: as above, but if err is MPS_RES_OK do nothing - cdie: print text and err code to stdout as comment, or as error - if err isn't MPS_RES_OK -*/ - -void cdie(mps_res_t err, const char *str); -void die(mps_res_t err, const char *str); -void adie(mps_res_t err, const char *str); - - -/* Prints text to stdout */ - -void comment(const char *format, ...); -void vcomment(const char *format, va_list args); - - -/* Prints text to stdout if cond is true */ - -void commentif(int cond, const char *format, ...); - - -/* Prints text to stdout and aborts */ - -void error(const char *format, ...); -void verror(const char *format, va_list args); - - -/* If exp is false, prints text to stdout and aborts */ - -void asserts(int expr, const char *format, ...); - - -/* Abort. Tests should use error rather than this. */ - -void myabort(void); - - -/* Easy way of entering the trampoline, for when you don't - want to pass any information in or out. If you have a - function void foo(void), just go easy_tramp(foo). -*/ - -void easy_tramp(void (*f)(void)); - - -/* Pause for n seconds -*/ - -void mmqa_pause(unsigned long); - - -/* Random number from 0 to x-1 -*/ - -unsigned long ranint(unsigned long limit); -unsigned long ranrange(unsigned long min, unsigned long max); - - -/* stuff for running event logs -*/ - -typedef union log_event log_event; - -typedef int event_type; - -enum {EVENT_ALLOC, EVENT_FREE}; - -struct event_alloc { - event_type type; - unsigned int id; - size_t size; -}; - -struct event_free { - event_type type; - unsigned int id; -}; - -union log_event { - event_type type; - struct event_alloc alloc; - struct event_free free; -}; - -int read_event(log_event*); - - -/* The MPS doesn't provide this useful function -*/ - -size_t arena_committed_and_used(mps_arena_t); - - -#ifdef MMQA_SYMBOL_mps_arena_t - -mps_res_t mmqa_arena_create(mps_arena_t *arena_p, - mps_arena_class_t arena_class, size_t chunk_size, size_t limit_size); - -#endif - - -/* time-based queue - (use for killing objects at the right time) -*/ - -typedef struct { - unsigned long time; - void *ref; -} TQElt; - -typedef struct { - unsigned long size; - unsigned long used; - TQElt *element; -}* TimeQueue; - -void TQInit(TimeQueue, TQElt*, long int); - -unsigned long TQSize(TimeQueue); -unsigned long TQCount(TimeQueue); -int TQEmpty(TimeQueue); -int TQFull(TimeQueue); - -unsigned long TQTime(TimeQueue); -void *TQElement(TimeQueue); - -void *TQPop(TimeQueue); -void TQAdd(TimeQueue, void *, unsigned long); - -void TQWarp(TimeQueue, unsigned long); - - -#endif /* testlib_h */ diff --git a/mps/qa/test/testlib/versind.h b/mps/qa/test/testlib/versind.h deleted file mode 100644 index f68c3da0f71..00000000000 --- a/mps/qa/test/testlib/versind.h +++ /dev/null @@ -1,120 +0,0 @@ -/* $HopeName: MMQA_harness!testlib:versind.h(trunk.11) $ - * - * If you define mps_ symbols here, you also need to list them in - * MMQA_harness!testlib:assumed. - */ - - -/* In release.dylan.honeybee, space was renamed arena in lots of functions - We'll use the "destroy" functions to test which versions are available -*/ - -#define mmqaArenaSIZE ((size_t)1<<30) - -#ifdef MMQA_DEFINED_mps_arena_destroy - -#ifdef MMQA_DEFINED_mps_space_destroy - -/* bizarrely, both versions seem to be present! */ - -#else - -/* need to define "space" variants */ -#define mps_space_clamp(a) mps_arena_clamp(a) -#define mps_space_release(a) mps_arena_release(a) -#define mps_space_park(a) mps_arena_park(a) -#define mps_space_collect(a) mps_arena_collect(a) -#define mps_space_destroy(a) mps_arena_destroy(a) -#define mps_space_reserved(a) mps_arena_reserved(a) -#define mps_space_committed(a) mps_arena_committed(a) -#define mps_space_t mps_arena_t -#include "mpsavm.h" -#define mps_space_create(space) \ - mps_arena_create(space, mps_arena_class_vm(), mmqaArenaSIZE) - -#endif - -#else - -#ifdef MMQA_DEFINED_mps_space_destroy - -/* need to define "arena" variants */ -#define mps_arena_clamp(a) mps_space_clamp(a) -#define mps_arena_release(a) mps_space_release(a) -#define mps_arena_park(a) mps_space_park(a) -#define mps_arena_collect(a) mps_space_collect(a) -#define mps_arena_destroy(a) mps_space_destroy(a) -#define mps_arena_reserved(a) mps_space_reserved(a) -#define mps_arena_committed(a) mps_space_committed(a) -#define mps_arena_t mps_space_t - -#else - -/* Neither exists -- error! */ -#error Could find either mps_arena_destroy or mps_space_destroy - -#endif - -#endif - - -/* Before release.epcore.brisling / release.dylan.kinglet - there was no spare committed fund -*/ - -#ifndef MMQA_DEFINED_mps_arena_spare_committed -#define mps_arena_spare_committed(a) ((size_t) 0) -#endif - -#ifndef MMQA_DEFINED_mps_arena_spare_commit_limit -#define mps_arena_spare_commit_limit(a) ((size_t) 0) -#endif - -#ifndef MMQA_DEFINED_mps_arena_spare_commit_limit_set -#define mps_arena_spare_commit_limit_set(a, l) \ - asserts(0, \ - "MPS interface versions before HU do not support the spare committed fund") -#endif - - -/* - The following defs can't be done automatically. I don't think - this is a problem, but here they are just in case. - - Before modern interface; - - no closure arguments for mps_root_create_reg - - no rank argument for mps_ap_create (ever) - - #define mps_root_create_reg(ro, sp, ra, rm, thr, scan, p, _s) \ - (mps_root_create_reg)(ro, sp, ra, rm, thr, scan, p) - - #define mps_ap_create(a, p, _r) \ - (mps_ap_create)(a, p) -*/ - - -#ifndef MMQA_DEFINED_mps_chain_create - - -#define mps_chain_t void* - -typedef struct mps_gen_param_s { - size_t mps_capacity; - double mps_mortality; -} mps_gen_param_s; - -#define mps_chain_create(p, a, s, par) (*(p) = NULL, (void)(par), MPS_RES_OK) -#define mps_chain_destroy(p) do {} while(0) - -#define mmqa_pool_create_chain(pool_o, arena, class, format, chain) \ - mps_pool_create(pool_o, arena, class, format) - - -#else - - -#define mmqa_pool_create_chain(pool_o, arena, class, format, chain) \ - mps_pool_create(pool_o, arena, class, format, chain) - - -#endif diff --git a/mps/qa/testsets/daily b/mps/qa/testsets/daily deleted file mode 100644 index 9391ef9b266..00000000000 --- a/mps/qa/testsets/daily +++ /dev/null @@ -1,90 +0,0 @@ -% test set for daily tests of MPS on PC -% $HopeName: MMQA_testsets!daily(trunk.6) $ - -function/0.c -function/1.c -function/5.c -function/6.c -function/9.c -function/11.c -function/12.c -function/14.c -function/15.c -function/16.c -function/17.c -function/18.c -function/19.c -function/20.c -function/23.c -function/25.c -function/26.c -function/27.c -function/28.c -function/29.c -function/35.c -function/37.c -function/39.c -function/40.c -function/45.c -function/52.c -function/53.c -function/55.c -function/56.c -function/57.c -function/61.c -function/62.c -function/63.c -function/64.c -function/65.c -function/69.c -function/70.c -function/71.c -function/74.c -function/78.c -function/79.c -function/80.c -function/81.c -function/96.c -function/98.c -function/99.c -function/103.c -function/106.c -function/107.c -function/108.c -function/112.c -function/117.c -function/118.c -function/119.c -function/120.c -function/121.c -function/125.c -function/126.c -function/130.c -function/131.c -function/132.c -function/133.c -function/135.c -function/136.c -function/137.c -function/138.c -function/139.c -function/140.c -function/144.c -function/147.c -function/149.c -function/151.c -function/152.c -function/153.c -function/158.c -function/159.c -function/160.c -function/161.c -function/162.c -function/163.c -function/164.c -function/165.c -function/166.c -function/167.c -function/168.c -function/170.c -function/172.c diff --git a/mps/qa/testsets/dailydw b/mps/qa/testsets/dailydw deleted file mode 100644 index a665197fad1..00000000000 --- a/mps/qa/testsets/dailydw +++ /dev/null @@ -1,96 +0,0 @@ -% test set for daily tests of Dylan on Unix -% $HopeName: MMQA_testsets!dailydw(trunk.4) $ - -function/0.c -function/1.c -function/5.c -function/6.c -function/9.c -function/11.c -function/12.c -function/14.c -function/15.c -function/16.c -function/17.c -function/18.c -function/19.c -function/20.c -function/25.c -function/26.c -function/27.c -function/28.c -function/29.c -function/30.c -function/31.c -function/32.c -function/33.c -function/34.c -function/35.c -function/36.c -function/37.c -function/38.c -function/39.c -function/40.c -function/41.c -function/42.c -function/43.c -function/44.c -function/47.c -function/48.c -function/49.c -function/50.c -function/51.c -function/52.c -function/53.c -function/54.c -function/55.c -function/56.c -function/57.c -function/61.c -function/62.c -function/63.c -function/64.c -function/65.c -function/67.c -function/69.c -function/70.c -function/71.c -function/73.c -function/74.c -function/75.c -function/76.c -function/77.c -function/78.c -function/79.c -function/80.c -function/81.c -function/83.c -function/98.c -function/99.c -function/105.c -function/106.c -function/107.c -function/108.c -function/109.c -function/110.c -function/111.c -function/112.c -function/114.c -function/117.c -function/118.c -function/119.c -function/122.c -function/125.c -function/126.c -function/130.c -function/131.c -function/132.c -function/135.c -function/138.c -function/147.c -function/148.c -function/149.c -function/150.c -function/151.c -function/152.c -function/153.c diff --git a/mps/qa/testsets/dailysw b/mps/qa/testsets/dailysw deleted file mode 100644 index 7fee58de85d..00000000000 --- a/mps/qa/testsets/dailysw +++ /dev/null @@ -1,36 +0,0 @@ -% testset for daily builds of mmsw on the PC -% (functional testing) -% - -function/82.c -function/84.c -function/85.c -function/86.c -function/87.c -function/88.c -function/91.c -function/92.c -function/93.c -function/94.c -function/136.c -function/137.c -function/139.c -function/140.c -function/141.c -function/143.c -function/145.c -function/146.c -function/154.c -function/155.c -function/157.c -function/159.c -function/160.c -function/162.c -function/163.c -function/164.c -function/165.c -function/166.c -function/167.c -function/168.c -function/169.c -function/170.c diff --git a/mps/qa/testsets/dailyswa b/mps/qa/testsets/dailyswa deleted file mode 100644 index 6dfb4278164..00000000000 --- a/mps/qa/testsets/dailyswa +++ /dev/null @@ -1,8 +0,0 @@ -% testset for daily builds of mmsw -% (functional testing, expecting assertions) -% - -function/142.c -function/156.c -function/158.c -function/161.c diff --git a/mps/qa/testsets/dylan1 b/mps/qa/testsets/dylan1 deleted file mode 100644 index d9afba2bbba..00000000000 --- a/mps/qa/testsets/dylan1 +++ /dev/null @@ -1,78 +0,0 @@ -% $HopeName$ -% test set for release.dylan.cottonwood -% - -function\0.c -function\1.c -function\5.c -function\6.c -function\7.c -function\8.c -function\9.c -function\10.c -function\11.c -function\12.c -function\14.c -function\15.c -function\16.c -function\17.c -function\18.c -function\19.c -function\20.c -function\23.c -function\25.c -function\26.c -function\27.c -function\28.c -function\29.c -function\30.c -function\31.c -function\32.c -function\33.c -function\34.c -function\35.c -function\36.c -function\37.c -function\38.c -function\39.c -function\40.c -function\41.c -function\42.c -function\43.c -function\44.c -function\45.c -function\46.c -function\47.c -function\48.c -function\49.c -function\50.c -function\51.c -function\52.c -function\53.c -function\54.c -function\55.c -function\56.c -function\57.c -function\61.c -function\62.c -function\63.c -function\64.c -function\65.c -function\66.c -function\67.c -function\69.c -function\70.c -function\71.c -function\72.c -function\73.c -function\74.c -function\75.c -function\76.c -function\77.c -function\78.c -function\79.c -function\80.c -function\81.c -function\83.c -function\96.c -function\98.c diff --git a/mps/qa/testsets/perfsw b/mps/qa/testsets/perfsw deleted file mode 100644 index 2ddf45f2202..00000000000 --- a/mps/qa/testsets/perfsw +++ /dev/null @@ -1,6 +0,0 @@ -% testset for SW performance measurement -% (rather small at the moment) - -function/210.c -function/211.c -function/212.c diff --git a/mps/src/mpstd.h b/mps/src/mpstd.h deleted file mode 100644 index 2365ceb1a3f..00000000000 --- a/mps/src/mpstd.h +++ /dev/null @@ -1,299 +0,0 @@ -/* impl.h.mpstd: HARLEQUIN MEMORY POOL SYSTEM TARGET DETECTION - * - * $HopeName: MMsrc!mpstd.h(trunk.27) $ - * Copyright (C) 2000 Harlequin Limited. All rights reserved. - * - * Detect the target platform using predefined preprocessor symbols - * defined by the build environment. The symbols are derived from the - * documentation, or, in the case of GCC, from the compiler itself. - * References to the documentation appear above each detection line. - * - * .macos.ppc.align: MacOS / PowerPC requires 8 bytes alignment (in - * general). See "Mac OS Runtime Architecture", table 4-2. - */ - -#ifndef mpstd_h -#define mpstd_h - - -/* Irix 5/6 man cc and man abi. We can't check for _ABIO32 (see - * os.i5), as we have to support Irix 5.2, which doesn't define it. We - * check the value of _MIPS_FPSET, as it is defined across all Irix 5 - * and 6 platforms, and on Irix 6 distinguishes O32 from the other two - * ABIs. When we support the other ABIs, we need a new OS name for - * them. Alignment from testing. - */ - -#if defined(__sgi) && defined(__unix) && defined(__mips) \ - && defined(_SYSTYPE_SVR4) && (_MIPS_FPSET == 16) -#define MPS_PF_I5M2CC -#define MPS_PF_STRING "i5m2cc" -#define MPS_OS_I5 -#define MPS_ARCH_M2 -#define MPS_BUILD_CC -#define MPS_T_WORD unsigned long -#define MPS_WORD_WIDTH 32 -#define MPS_WORD_SHIFT 5 -#define MPS_PF_ALIGN 8 - -/* See above. Alignment from testing. */ - -#elif defined(__sgi) && defined(__unix) && defined(__mips) \ - && defined(_SYSTYPE_SVR4) && defined(_ABIN32) -#define MPS_PF_IAM4CC -#define MPS_PF_STRING "iam4cc" -#define MPS_OS_IA -#define MPS_ARCH_M4 -#define MPS_BUILD_CC -#define MPS_T_WORD unsigned long -#define MPS_WORD_WIDTH 32 -#define MPS_WORD_SHIFT 5 -#define MPS_PF_ALIGN 8 - -/* winnt.h from MS VC 2.0 */ - -#elif defined(_MSC_VER) && defined(_WIN32) && defined(_M_ALPHA) -#define MPS_PF_W3ALMV -#define MPS_PF_STRING "w3almv" -#define MPS_OS_W3 -#define MPS_ARCH_AL -#define MPS_BUILD_MV -#define MPS_T_WORD unsigned long -#define MPS_WORD_WIDTH 32 -#define MPS_WORD_SHIFT 5 -#define MPS_PF_ALIGN 4 - -/* winnt.h from MS VC 2.0 */ - -#elif defined(_MSC_VER) && defined(_WIN32) && defined(_M_PPC) -#define MPS_PF_W3PPMV -#define MPS_PF_STRING "w3ppmv" -#define MPS_OS_W3 -#define MPS_ARCH_PP -#define MPS_BUILD_MV -#define MPS_T_WORD unsigned long -#define MPS_WORD_WIDTH 32 -#define MPS_WORD_SHIFT 5 -#define MPS_PF_ALIGN 4 - -/* Visual C++ 2.0, Books Online, C/C++ Book, Preprocessor Reference, - * Chapter 1: The Preprocessor, Macros, Predefined Macros. - * Alignment of 4 would work, but the MS library uses 8 bytes for - * doubles and __int64, so we choose that. The actual granularity of - * VC malloc is 16! - */ - -#elif defined(_MSC_VER) && defined(_WIN32) && defined(_M_IX86) -#define MPS_PF_W3I3MV -#define MPS_PF_STRING "w3i3mv" -#define MPS_OS_W3 -#define MPS_ARCH_I3 -#define MPS_BUILD_MV -#define MPS_T_WORD unsigned long -#define MPS_WORD_WIDTH 32 -#define MPS_WORD_SHIFT 5 -#define MPS_PF_ALIGN 8 - -/* MW C/C++/ASM Lang Ref (CW9), pp. 184-186. Metrowerks does not document - * a way to determine the OS -- we assume MacOS 7. - */ - -#elif defined(__MWERKS__) && __MC68K__ == 1 -#define MPS_PF_S760MW -#define MPS_PF_STRING "s760mw" -#define MPS_OS_S7 -#define MPS_ARCH_60 -#define MPS_BUILD_MW -#define MPS_T_WORD unsigned long -#define MPS_WORD_WIDTH 32 -#define MPS_WORD_SHIFT 5 -#define MPS_PF_ALIGN 1 - -/* MW C/C++/ASM Lang Ref (CW9), pp. 184-186. Metrowerks does not document - * a way to determine the OS -- we assume MacOS 7. - */ - -#elif defined(__MWERKS__) && __POWERPC__ == 1 -#define MPS_PF_S7PPMW -#define MPS_PF_STRING "s7ppmw" -#define MPS_OS_S7 -#define MPS_ARCH_PP -#define MPS_BUILD_MW -#define MPS_T_WORD unsigned long -#define MPS_WORD_WIDTH 32 -#define MPS_WORD_SHIFT 5 -#define MPS_PF_ALIGN 8 /* .macos.ppc.align */ - -/* 1. MPW 3.0 C Ref, p. 43. - * 2. MPW SC/SCpp C/C++ Compiler for 68k Macintosh, p 3-60. - * These are the two MPW 68k compilers. They do not define anything - * which lets us determine the system version. - */ - -#elif defined(m68k) && (defined (applec) || defined(__SC__)) -#define MPS_PF_S760AC -#define MPS_PF_STRING "s760ac" -#define MPS_OS_S7 -#define MPS_ARCH_60 -#define MPS_BUILD_AC -#define MPS_T_WORD unsigned long -#define MPS_WORD_WIDTH 32 -#define MPS_WORD_SHIFT 5 -#define MPS_PF_ALIGN 1 - -/* 1. C++/C Compiler for Macintosh with PowerPC, p 3-36. - * 2. MPW MrC/MrCpp C/C++ Compiler for Power Macintosh, p 3-57. - * These are the two MPW PowerPC compilers. They do not define anything - * which lets us determine the system version. - */ - -#elif defined(__PPCC__) || (defined(__MRC__) && defined(__POWERPC)) -#define MPS_PF_S7PPAC -#define MPS_PF_STRING "s7ppac" -#define MPS_OS_S7 -#define MPS_ARCH_PP -#define MPS_BUILD_AC -#define MPS_T_WORD unsigned long -#define MPS_WORD_WIDTH 32 -#define MPS_WORD_SHIFT 5 -#define MPS_PF_ALIGN 8 /* .macos.ppc.align */ - -/* GCC 2.7.2.1, gcc -E -dM -traditional-cpp and - */ - -#elif defined(__APPLE__) && defined(__ppc__) && defined(__MACH__) && defined(__GNUC__) -#define MPS_PF_XCPPGC -#define MPS_PF_STRING "xcppgc" -#define MPS_OS_XC -#define MPS_ARCH_PP -#define MPS_BUILD_GC -#define MPS_T_WORD unsigned long -#define MPS_WORD_WIDTH 32 -#define MPS_WORD_SHIFT 5 -#define MPS_PF_ALIGN 8 /* .macos.ppc.align */ - -/* GCC 2.5.8, gcc -E -dM, (__SVR4 indicates Solaris) */ - -#elif defined(__sun__) && defined(__sparc__) && defined(__GNUC__) \ - && !defined(__svr4__) -#define MPS_PF_SUS8GC -#define MPS_PF_STRING "sus8gc" -#define MPS_OS_SU -#define MPS_ARCH_S8 -#define MPS_BUILD_GC -#define MPS_T_WORD unsigned long -#define MPS_WORD_WIDTH 32 -#define MPS_WORD_SHIFT 5 -#define MPS_PF_ALIGN 8 - -/* LCC 3.4 (ish), man page */ - -#elif defined(sun) && defined(sparc) && defined(__LCC__) \ - && !defined(__svr4__) -#define MPS_PF_SUS8LC -#define MPS_PF_STRING "sus8lc" -#define MPS_OS_SU -#define MPS_ARCH_S8 -#define MPS_BUILD_LC -#define MPS_T_WORD unsigned long -#define MPS_WORD_WIDTH 32 -#define MPS_WORD_SHIFT 5 -#define MPS_PF_ALIGN 8 - -/* GCC 2.5.8, gcc -E -dM */ - -#elif defined(__sun__) && defined(__sparc__) && defined(__GNUC__) \ - && defined(__svr4__) -#define MPS_PF_SOS8GC -#define MPS_PF_STRING "sos8gc" -#define MPS_OS_SO -#define MPS_ARCH_S8 -#define MPS_BUILD_GC -#define MPS_T_WORD unsigned long -#define MPS_WORD_WIDTH 32 -#define MPS_WORD_SHIFT 5 -#define MPS_PF_ALIGN 8 - -/* SunPro C, man cc (confirmed by grep). Note that this doesn't - * actually nail down UltraSPARCs; there are no compiler predefined - * macros for that. - */ - -#elif defined(__sun) && defined(__SUNPRO_C) && defined(__SVR4) \ - && defined(__sparc) - -#define MPS_PF_SOS9SC -#define MPS_PF_STRING "sos9sc" -#define MPS_OS_SO -#define MPS_ARCH_S9 -#define MPS_BUILD_SC -#define MPS_T_WORD unsigned long -#define MPS_WORD_WIDTH 32 -#define MPS_WORD_SHIFT 5 -#define MPS_PF_ALIGN 8 - -/* GCC 2.6.3, gcc -E -dM */ - -#elif defined(__osf__) && defined(__alpha__) && defined(__GNUC__) -#define MPS_PF_O1ALGC -#define MPS_PF_STRING "o1algc" -#define MPS_OS_O1 -#define MPS_ARCH_AL -#define MPS_BUILD_GC -#define MPS_T_WORD unsigned long -#define MPS_T_SHORT unsigned -#define MPS_WORD_WIDTH 64 -#define MPS_WORD_SHIFT 6 -#define MPS_PF_ALIGN 8 - -/* From the cc(1) man page */ - -#elif defined(__osf__) && defined(__alpha) && defined(__DECC) -#define MPS_PF_O1ALCC -#define MPS_PF_STRING "o1alcc" -#define MPS_OS_O1 -#define MPS_ARCH_AL -#define MPS_BUILD_CC -#define MPS_T_WORD unsigned long -#define MPS_T_SHORT unsigned -#define MPS_WORD_WIDTH 64 -#define MPS_WORD_SHIFT 6 -#define MPS_PF_ALIGN 8 - -/* GCC 2.6.3, gcc -E -dM - * The actual granularity of GNU malloc is 8, but field alignments are - * all 4. - */ - -#elif defined(__linux__) && defined(__i386__) && defined(__GNUC__) -#define MPS_PF_LII4GC -#define MPS_PF_STRING "lii4gc" -#define MPS_OS_LI -#define MPS_ARCH_I4 -#define MPS_BUILD_GC -#define MPS_T_WORD unsigned long -#define MPS_WORD_WIDTH 32 -#define MPS_WORD_SHIFT 5 -#define MPS_PF_ALIGN 4 - -/* GCC 2.7.2, gcc -E -dM */ - -#elif defined(__linux__) && defined(__PPC__) && defined(__GNUC__) -#define MPS_PF_LIPPGC -#define MPS_PF_STRING "lippgc" -#define MPS_OS_LI -#define MPS_ARCH_PP -#define MPS_BUILD_GC -#define MPS_T_WORD unsigned long -#define MPS_WORD_WIDTH 32 -#define MPS_WORD_SHIFT 5 -#define MPS_PF_ALIGN 8 /* @@@@ not tested */ - -#else -#error "Unable to detect target platform" -#endif - - -#endif /* mpstd_h */ From a59fd7ad3f7d5892b31368577e663e04b1335661 Mon Sep 17 00:00:00 2001 From: Nick Barnes Date: Mon, 24 Sep 2001 17:17:56 +0100 Subject: [PATCH 02/10] First freebsd attempt: branch linux files. Copied from Perforce Change: 22636 ServerID: perforce.ravenbrook.com --- mps/src/fri4gc.gmk | 25 ++++ mps/src/lockfr.c | 258 ++++++++++++++++++++++++++++++++++++++ mps/src/mpstd.h | 16 ++- mps/src/prmci3fr.c | 86 +++++++++++++ mps/src/protfr.c | 90 ++++++++++++++ mps/src/protfri3.c | 151 ++++++++++++++++++++++ mps/src/ssfri3.c | 58 +++++++++ mps/src/thfri4.c | 303 +++++++++++++++++++++++++++++++++++++++++++++ mps/src/vmfr.c | 292 +++++++++++++++++++++++++++++++++++++++++++ 9 files changed, 1278 insertions(+), 1 deletion(-) create mode 100644 mps/src/fri4gc.gmk create mode 100644 mps/src/lockfr.c create mode 100644 mps/src/prmci3fr.c create mode 100644 mps/src/protfr.c create mode 100644 mps/src/protfri3.c create mode 100644 mps/src/ssfri3.c create mode 100644 mps/src/thfri4.c create mode 100644 mps/src/vmfr.c diff --git a/mps/src/fri4gc.gmk b/mps/src/fri4gc.gmk new file mode 100644 index 00000000000..b8963680eb9 --- /dev/null +++ b/mps/src/fri4gc.gmk @@ -0,0 +1,25 @@ +# impl.gmk.lii4gc: BUILD FOR LINUX/INTEL/GCC PLATFORM +# +# $HopeName: MMsrc!lii4gc.gmk(trunk.5) $ +# Copyright (C) 2000 Harlequin Limited. All rights reserved. + +PFM = fri4gc + +PFMDEFS = -D_REENTRANT + +MPMPF = mpsliban.c mpsioan.c lockfr.c thfri4.c pthrdext.c vmfr.c \ + protfr.c protfri3.c proti3.c prmci3fr.c ssfri3.c span.c +SWPF = than.c vmfr.c protsw.c prmcan.c ssan.c + +LIBS = -lm -pthread + +include gc.gmk + +CC = cc + +# Suppress some warnings (SuSE). +# .void: -Wpointer-arith cannot be used because the string.h header does +# arithmetic on void*. +CFLAGSCOMPILER := $(subst -Wpointer-arith,,$(CFLAGSCOMPILER)) + +include comm.gmk diff --git a/mps/src/lockfr.c b/mps/src/lockfr.c new file mode 100644 index 00000000000..97e242d1d6a --- /dev/null +++ b/mps/src/lockfr.c @@ -0,0 +1,258 @@ +/* impl.c.lockli: RECURSIVE LOCKS FOR POSIX SYSTEMS + * + * $HopeName$ + * Copyright (C) 2000 Harlequin Limited. All rights reserved. + * + * .linux: This implementation currently just supports LinuxThreads + * (platform MPS_OS_LI), Single Unix i/f. + * + * .posix: In fact, the implementation should be reusable for most POSIX + * implementations, but may need some customization for each. + * + * .design: These locks are implemented using mutexes. + * + * .recursive: Mutexes support both non-recursive and recursive locking, but + * only at initialization time. This doesn't match the API of MPS Lock module, + * which chooses at locking time, so all locks are made (non-recursive) + * errorchecking. Recursive locks are implemented by checking the error + * code. + * + * .claims: During use the claims field is updated to remember the number of + * claims acquired on a lock. This field must only be modified + * while we hold the mutex. + */ + +#define _XOPEN_SOURCE 500 +#include +#include +#include + +#include "mpmtypes.h" +#include "lock.h" +#include "config.h" + + +#ifndef MPS_OS_LI +#error "lockli.c is specific to LinuxThreads but MPS_OS_LI not defined" +#endif + +SRCID(lockli, "$HopeName$"); + + +/* LockAttrSetRecursive -- Set mutexattr to permit recursive locking + * + * There's a standard way to do this - but early LinuxThreads doesn't + * quite follow the standard. Some other implementations might not + * either. + */ + +#ifdef OLD_LINUXTHREADS + +#define LockAttrSetRecursive(attrptr) \ + pthread_mutexattr_setkind_np(attrptr, PTHREAD_MUTEX_ERRORCHECK_NP) + +#else + +#define LockAttrSetRecursive(attrptr) \ + pthread_mutexattr_settype(attrptr, PTHREAD_MUTEX_ERRORCHECK) + +#endif + + +/* LockStruct -- the MPS lock structure + * + * .lock.posix: Posix lock structure; uses a mutex. + */ + +typedef struct LockStruct { + Sig sig; /* design.mps.sig */ + unsigned long claims; /* # claims held by owner */ + pthread_mutex_t mut; /* the mutex itself */ +} LockStruct; + + +/* LockSize -- size of a LockStruct */ + +size_t LockSize(void) +{ + return sizeof(LockStruct); +} + + +/* LockCheck -- check a lock */ + +Bool LockCheck(Lock lock) +{ + CHECKS(Lock, lock); + /* While claims can't be very large, I don't dare to put a limit on it. */ + /* There's no way to test the mutex, or check if it's held by somebody. */ + return TRUE; +} + + +/* LockInit -- initialize a lock */ + +void LockInit(Lock lock) +{ + pthread_mutexattr_t attr; + int res; + + AVER(lock != NULL); + lock->claims = 0; + res = pthread_mutexattr_init(&attr); + AVER(res == 0); + res = LockAttrSetRecursive(&attr); + AVER(res == 0); + res = pthread_mutex_init(&lock->mut, &attr); + AVER(res == 0); + res = pthread_mutexattr_destroy(&attr); + AVER(res == 0); + lock->sig = LockSig; + AVERT(Lock, lock); +} + + +/* LockFinish -- finish a lock */ + +void LockFinish(Lock lock) +{ + int res; + + AVERT(Lock, lock); + /* Lock should not be finished while held */ + AVER(lock->claims == 0); + res = pthread_mutex_destroy(&lock->mut); + AVER(res == 0); + lock->sig = SigInvalid; +} + + +/* LockClaim -- claim a lock (non-recursive) */ + +void LockClaim(Lock lock) +{ + int res; + + AVERT(Lock, lock); + + res = pthread_mutex_lock(&lock->mut); + /* pthread_mutex_lock will error if we own the lock already. */ + AVER(res == 0); + + /* This should be the first claim. Now we own the mutex */ + /* it is ok to check this. */ + AVER(lock->claims == 0); + lock->claims = 1; +} + + +/* LockReleaseMPM -- release a lock (non-recursive) */ + +void LockReleaseMPM(Lock lock) +{ + int res; + + AVERT(Lock, lock); + AVER(lock->claims == 1); /* The lock should only be held once */ + lock->claims = 0; /* Must set this before releasing the lock */ + res = pthread_mutex_unlock(&lock->mut); + /* pthread_mutex_unlock will error if we didn't own the lock. */ + AVER(res == 0); +} + + +/* LockClaimRecursive -- claim a lock (recursive) */ + +void LockClaimRecursive(Lock lock) +{ + int res; + + AVERT(Lock, lock); + + res = pthread_mutex_lock(&lock->mut); + /* pthread_mutex_lock will return: */ + /* 0 if we have just claimed the lock */ + /* EDEADLK if we own the lock already. */ + AVER((res == 0 && lock->claims == 0) || + (res == EDEADLK && lock->claims > 0)); + + ++lock->claims; + AVER(lock->claims > 0); +} + + +/* LockReleaseRecursive -- release a lock (recursive) */ + +void LockReleaseRecursive(Lock lock) +{ + int res; + + AVERT(Lock, lock); + AVER(lock->claims > 0); + --lock->claims; + if (lock->claims == 0) { + res = pthread_mutex_unlock(&lock->mut); + /* pthread_mutex_unlock will error if we didn't own the lock. */ + AVER(res == 0); + } +} + + +/* Global locks + * + * .global: The two "global" locks are statically allocated normal locks. + */ + +static LockStruct globalLockStruct; +static LockStruct globalRecLockStruct; +static Lock globalLock = &globalLockStruct; +static Lock globalRecLock = &globalRecLockStruct; +static pthread_once_t isGlobalLockInit = PTHREAD_ONCE_INIT; + +static void globalLockInit(void) +{ + LockInit(globalLock); + LockInit(globalRecLock); +} + + +/* LockClaimGlobalRecursive -- claim the global recursive lock */ + +void LockClaimGlobalRecursive(void) +{ + int res; + + /* Ensure the global lock has been initialized */ + res = pthread_once(&isGlobalLockInit, globalLockInit); + AVER(res == 0); + LockClaimRecursive(globalRecLock); +} + + +/* LockReleaseGlobalRecursive -- release the global recursive lock */ + +void LockReleaseGlobalRecursive(void) +{ + LockReleaseRecursive(globalRecLock); +} + + +/* LockClaimGlobal -- claim the global non-recursive lock */ + +void LockClaimGlobal(void) +{ + int res; + + /* Ensure the global lock has been initialized */ + res = pthread_once(&isGlobalLockInit, globalLockInit); + AVER(res == 0); + LockClaim(globalLock); +} + + +/* LockReleaseGlobal -- release the global non-recursive lock */ + +void LockReleaseGlobal(void) +{ + LockReleaseMPM(globalLock); +} diff --git a/mps/src/mpstd.h b/mps/src/mpstd.h index 2365ceb1a3f..766e0da1980 100644 --- a/mps/src/mpstd.h +++ b/mps/src/mpstd.h @@ -160,7 +160,7 @@ /* GCC 2.7.2.1, gcc -E -dM -traditional-cpp and + * ools/Preprocessor/Preprocessor.[ef].html> */ #elif defined(__APPLE__) && defined(__ppc__) && defined(__MACH__) && defined(__GNUC__) @@ -291,6 +291,20 @@ #define MPS_WORD_SHIFT 5 #define MPS_PF_ALIGN 8 /* @@@@ not tested */ +/* GCC 2.95.3, gcc -E -dM + */ + +#elif defined(__FreeBSD__) && defined (__i386__) && defined (__GNUC__) +#define MPS_PF_FRI4GC +#define MPS_PF_STRING "fri4gc" +#define MPS_OS_FR +#define MPS_ARCH_I4 +#define MPS_BUILD_GC +#define MPS_T_WORD unsigned long +#define MPS_WORD_WIDTH 32 +#define MPS_WORD_SHIFT 5 +#define MPS_PF_ALIGN 4 + #else #error "Unable to detect target platform" #endif diff --git a/mps/src/prmci3fr.c b/mps/src/prmci3fr.c new file mode 100644 index 00000000000..f0013092970 --- /dev/null +++ b/mps/src/prmci3fr.c @@ -0,0 +1,86 @@ +/* impl.c.prmci3li: PROTECTION MUTATOR CONTEXT INTEL 386 (LINUX) + * + * $HopeName: MMsrc!prmci3li.c(trunk.3) $ + * Copyright (C) 1999 Harlequin Limited. All rights reserved. + * + * .purpose: This module implements the part of the protection module + * that decodes the MutatorFaultContext. + * + * + * SOURCES + * + * .source.i486: Intel486 Microprocessor Family Programmer's + * Reference Manual + * + * .source.linux.kernel: Linux kernel source files. + * + * + * ASSUMPTIONS + * + * .assume.regref: The resisters in the context can be modified by + * storing into an MRef pointer. + */ + +/* prmcli.h will include mpm.h after defining open sesame magic */ +#include "prmcli.h" +#include "prmci3.h" + +SRCID(prmci3li, "$HopeName$"); + + +/* Prmci3AddressHoldingReg -- return an address of a register in a context */ + +MRef Prmci3AddressHoldingReg(MutatorFaultContext context, unsigned int regnum) +{ + struct sigcontext *scp; + + AVER(regnum <= 7); + AVER(regnum >= 0); + + scp = context->scp; + + /* .source.i486 */ + /* .assume.regref */ + switch (regnum) { + case 0: return (MRef)&scp->eax; + case 1: return (MRef)&scp->ecx; + case 2: return (MRef)&scp->edx; + case 3: return (MRef)&scp->ebx; + case 4: return (MRef)&scp->esp; + case 5: return (MRef)&scp->ebp; + case 6: return (MRef)&scp->esi; + case 7: return (MRef)&scp->edi; + } + NOTREACHED; + return (MRef)NULL; /* Keep compiler happy. */ +} + + +/* Prmci3DecodeFaultContext -- decode fault to find faulting address and IP */ + +void Prmci3DecodeFaultContext(MRef *faultmemReturn, + Byte **insvecReturn, + MutatorFaultContext context) +{ + struct sigcontext *scp; + + scp = context->scp; + + /* Assert that this is a page fault exception. The computation of */ + /* faultmem depends on this. See .source.i486 (9.9.14). */ + AVER(scp->trapno == 14); + + /* cr2 contains the address which caused the fault. */ + /* See .source.i486 (9.9.14) and */ + /* .source.linux.kernel (linux/arch/i386/mm/fault.c). */ + *faultmemReturn = (MRef)scp->cr2; + *insvecReturn = (Byte*)scp->eip; +} + + +/* Prmci3StepOverIns -- modify context to step over instruction */ + +void Prmci3StepOverIns(MutatorFaultContext context, Size inslen) +{ + context->scp->eip += (unsigned long)inslen; +} diff --git a/mps/src/protfr.c b/mps/src/protfr.c new file mode 100644 index 00000000000..20c9dfc5b55 --- /dev/null +++ b/mps/src/protfr.c @@ -0,0 +1,90 @@ +/* impl.c.protli: PROTECTION FOR LINUX + * + * $HopeName: $ + * Copyright (C) 1995,1999 Harlequin Group, all rights reserved + * + */ + +#include "mpm.h" + +#ifndef MPS_OS_LI +#error "protli.c is Linux specific, but MPS_OS_LI is not set" +#endif +#ifndef PROTECTION +#error "protli.c implements protection, but PROTECTION is not set" +#endif + +#include +#include +#include +#include + +SRCID(protli, "$HopeName: $"); + + +/* ProtSet -- set protection + * + * This is just a thin veneer on top of mprotect(2). + */ + +void ProtSet(Addr base, Addr limit, AccessSet mode) +{ + int flags; + int res; + + AVER(sizeof(int) == sizeof(Addr)); /* should be redundant; will fail on Alpha */ + AVER(base < limit); + AVER(base != 0); + AVER(AddrOffset(base, limit) <= INT_MAX); /* should be redundant */ + +#if 0 + /* .flags.trouble: This less strict version of flags (which allows write + * access unless explicitly told not to) caused mmqa test 37 to fail. + * This might be a bug in MPS, so for now we go with the stricter + * version that matches the Win32 implementation. */ + flags = 0; + if((mode & AccessREAD) == 0) + flags |= PROT_READ | PROT_EXEC; + if((mode & AccessWRITE) == 0) + flags |= PROT_WRITE; +#endif + flags = PROT_READ | PROT_WRITE | PROT_EXEC; + if((mode & AccessWRITE) != 0) + flags = PROT_READ | PROT_EXEC; + if((mode & AccessREAD) != 0) + flags = 0; + + res = mprotect((void *)base, (size_t)AddrOffset(base, limit), flags); + AVER(res == 0); +} + + +/* ProtSync -- synchronize protection settings with hardware + * + * This does nothing under Linux. + */ + +void ProtSync(Arena arena) +{ + NOOP; +} + + + +/* ProtTramp -- protection trampoline + * + * The protection trampoline is trivial under Linux, as there is nothing + * that needs to be done in the dynamic context of the mutator in order + * to catch faults. (Contrast this with Win32 Structured Exception + * Handling.) + */ + +void ProtTramp(void **resultReturn, void *(*f)(void *, size_t), + void *p, size_t s) +{ + AVER(resultReturn != NULL); + AVER(FUNCHECK(f)); + /* Can't check p and s as they are interpreted by the client */ + + *resultReturn = (*f)(p, s); +} diff --git a/mps/src/protfri3.c b/mps/src/protfri3.c new file mode 100644 index 00000000000..3e3f6b3dd92 --- /dev/null +++ b/mps/src/protfri3.c @@ -0,0 +1,151 @@ +/* impl.c.protlii3: PROTECTION FOR LINUX (INTEL 386) + * + * $HopeName: MMsrc!protlii3.c(trunk.3) $ + * Copyright (C) 2000 Harlequin Limited. All rights reserved. + * + * SOURCES + * + * .source.i486: Intel486 Microprocessor Family Programmer's + * Reference Manual + * + * .source.linux.kernel: Linux kernel source files. + */ + +#include "prmcli.h" + +#ifndef MPS_OS_LI +#error "protlii3.c is Linux-specific, but MPS_OS_LI is not set" +#endif +#if !defined(MPS_ARCH_I3) && !defined(MPS_ARCH_I4) +#error "protlii3.c is Intel-specific, but MPS_ARCH_I3 or MPS_ARCH_I4 is not set" +#endif +#ifndef PROTECTION +#error "protlii3.c implements protection, but PROTECTION is not set" +#endif + +#include +#include +#include +#include + +SRCID(protlii3, "$HopeName: MMsrc!protlii3.c(trunk.3) $"); + + +/* Useful stuff that doesn't appear to be in any header files. */ + +/* Interrupt number 14 is Page Fault. */ +#define TRAPNO_PAGE_FAULT 14 + +/* Bits in err field of sigcontext for interrupt 14 (page fault) */ +#define PAGE_FAULT_ERR_PAGEPROT 0x1 +#define PAGE_FAULT_ERR_WRITE 0x2 +#define PAGE_FAULT_ERR_USERMODE 0x4 + + +/* The previously-installed signal action, as returned by */ +/* sigaction(3). See ProtSetup. */ + +static struct sigaction sigNext; + + +typedef void (*__real_lii3_sighandler_t)(int, struct sigcontext); + + +/* sigHandle -- protection signal handler + * + * This is the signal handler installed by ProtSetup to deal with + * protection faults. It is installed on the SIGSEGV signal. + * It decodes the protection fault details from the signal context + * and passes them to ArenaAccess, which attempts to handle the + * fault and remove its cause. If the fault is handled, then + * the handler returns and execution resumes. If it isn't handled, + * then sigHandle does its best to pass the signal on to the + * previously installed signal handler (sigNext). + * + * .sigh.args: There is no officially documented way of getting the + * sigcontext, but on x86 Linux at least it is passed BY VALUE as a + * second argument to the signal handler. The prototype doesn't + * include this arg. + * See .source.linux.kernel (linux/arch/i386/kernel/signal.c). + * + * .sigh.context: We only know how to handle interrupt 14, where + * context.err gives the page fault error code and context.cr2 gives + * the fault address. See .source.i486 (9.9.14) and + * .source.linux.kernel (linux/arch/i386/mm/fault.c). + * + * .sigh.addr: We assume that the OS decodes the address to something + * sensible + */ + +static void sigHandle(int sig, struct sigcontext context) /* .sigh.args */ +{ + AVER(sig == SIGSEGV); + + if(context.trapno == TRAPNO_PAGE_FAULT) { /* .sigh.context */ + AccessSet mode; + Addr base, limit; + MutatorFaultContextStruct mfContext; + + mfContext.scp = &context; + + mode = ((context.err & PAGE_FAULT_ERR_WRITE) != 0) /* .sigh.context */ + ? (AccessREAD | AccessWRITE) + : AccessREAD; + + /* We assume that the access is for one word at the address. */ + base = (Addr)context.cr2; /* .sigh.addr */ + limit = AddrAdd(base, (Size)sizeof(Addr)); + + /* Offer each protection structure the opportunity to handle the */ + /* exception. If it succeeds, then allow the mutator to continue. */ + + if(ArenaAccess(base, mode, &mfContext)) + return; + } + + /* The exception was not handled by any known protection structure, */ + /* so throw it to the previously installed handler. */ + + /* @@@@ This is really weak. */ + /* Need to implement rest of the contract of sigaction */ + /* We might also want to set SA_RESETHAND in the flags and explicitly */ + /* reinstall the handler from withint itself so the SIG_DFL/SIG_IGN */ + /* case can work properly by just returning. */ + switch ((int)sigNext.sa_handler) { + case (int)SIG_DFL: + case (int)SIG_IGN: + abort(); + NOTREACHED; + break; + default: + (*(__real_lii3_sighandler_t)sigNext.sa_handler)(sig, context); + break; + } +} + + +/* ProtSetup -- global protection setup + * + * Under Linux, the global setup involves installing a signal handler + * on SIGSEGV to catch and handle page faults (see sigHandle). + * The previous handler is recorded so that it can be reached from + * sigHandle if it fails to handle the fault. + * + * NOTE: There are problems with this approach: + * 1. we can't honor the sa_flags for the previous handler, + * 2. what if this thread is suspended just after calling signal(3)? + * The sigNext variable will never be initialized! + */ + +void ProtSetup(void) +{ + struct sigaction sa; + int result; + + sa.sa_handler = (__sighandler_t)sigHandle; /* .sigh.args */ + sigemptyset(&sa.sa_mask); + sa.sa_flags = 0; + + result = sigaction(SIGSEGV, &sa, &sigNext); + AVER(result == 0); +} diff --git a/mps/src/ssfri3.c b/mps/src/ssfri3.c new file mode 100644 index 00000000000..23e0f25c2a2 --- /dev/null +++ b/mps/src/ssfri3.c @@ -0,0 +1,58 @@ +/* impl.c.sslii3: LINUX/INTEL STACK SCANNING + * + * $HopeName: MMsrc!sslii3.c(trunk.1) $ + * Copyright (C) 1999. Harlequin Group plc. All rights reserved. + * + * This scans the stack and fixes the registers which may contain + * roots. See design.mps.thread-manager + * + * The registers edi, esi, ebx are the registers defined to be preserved + * across function calls and therefore may contain roots. + * These are pushed on the stack for scanning. + * + * SOURCES + * + * .source.callees.saves: Set of callee-saved registers taken from + * CALL_USED_REGISTERS in /config/i386/i386.h. + * + * ASSUMPTIONS + * + * .assume.align: The stack pointer is assumed to be aligned on a word + * boundary. + * + * .assume.asm.stack: The compiler must not do wacky things with the + * stack pointer around a call since we need to ensure that the + * callee-save regs are visible during TraceScanArea. + * + * .assume.asm.order: The volatile modifier should prevent movement + * of code, which might break .assume.asm.stack. + * + */ + + +#include "mpm.h" + +SRCID(sslii3, "$HopeName: MMsrc!sslii3.c(trunk.1) $"); + +/* .assume.asm.order */ +#define ASMV(x) __asm__ volatile (x) + + +Res StackScan(ScanState ss, Addr *stackBot) +{ + Addr *stackTop; + Res res; + + /* .assume.asm.stack */ + ASMV("push %ebx"); /* These registers are callee-saved */ + ASMV("push %esi"); /* and so may contain roots. They are pushed */ + ASMV("push %edi"); /* for scanning. See .source.callees.saves. */ + ASMV("mov %%esp, %0" : "=r" (stackTop) :); /* stackTop = esp */ + + AVER(AddrIsAligned((Addr)stackTop, sizeof(Addr))); /* .assume.align */ + res = TraceScanArea(ss, stackTop, stackBot); + + ASMV("add $12, %esp"); /* pop 3 regs to restore the stack pointer */ + + return res; +} diff --git a/mps/src/thfri4.c b/mps/src/thfri4.c new file mode 100644 index 00000000000..f42e7a1f52a --- /dev/null +++ b/mps/src/thfri4.c @@ -0,0 +1,303 @@ +/* impl.c.thlii3: Threads Manager for Intel x86 systems with LinuxThreads + * + * $HopeName: MMsrc!thlii4.c(trunk.2) $ + * Copyright (C) 2000 Harlequin Limited. All rights reserved. + * + * .purpose: This is a pthreads implementation of the threads manager. + * This implements impl.h.th. + * + * .design: See design.mps.thread-manager. + * + * .thread.id: The thread id is used to identify the current thread. + * + * ASSUMPTIONS + * + * .error.resume: PThreadextResume is assumed to succeed unless the thread + * has been destroyed. + * .error.suspend: PThreadextSuspend is assumed to succeed unless the thread + * has been destroyed. In this case, the suspend context is set to NULL; + * + * .stack.full-descend: assumes full descending stack. + * i.e. stack pointer points to the last allocated location; + * stack grows downwards. + * + * .stack.below-bottom: it's legal for the stack pointer to be at a + * higher address than the registered bottom of stack. This might + * happen if the stack of another thread doesn't contain any frames + * belonging to the client language. In this case, the stack should + * not be scanned. + * + * .stack.align: assume roots on the stack are always word-aligned, + * but don't assume that the stack pointer is necessarily + * word-aligned at the time of reading the context of another thread. + * + * .sp: The stack pointer in the context is ESP. + * .context.regroots: The root regs are EDI, ESI, EBX, EDX, ECX, EAX are + * assumed to be recorded in the context at pointer-aligned boundaries. + */ + +#include "prmcli.h" +#include "mpm.h" + +#if !defined(MPS_OS_LI) || !defined(MPS_ARCH_I4) +#error "Compiling thlii4 when MPS_OS_LI or MPS_ARCH_I4 not defined." +#endif + +#include +#include "pthrdext.h" + +SRCID(thlii4, "$HopeName: MMsrc!thlii4.c(trunk.2) $"); + + +/* ThreadStruct -- thread desriptor */ + +typedef struct ThreadStruct { /* PThreads thread structure */ + Sig sig; /* design.mps.sig */ + Serial serial; /* from arena->threadSerial */ + Arena arena; /* owning arena */ + RingStruct arenaRing; /* threads attached to arena */ + PThreadextStruct thrextStruct; /* PThreads extension */ + pthread_t id; /* Pthread object of thread */ + struct sigcontext *scpSusp; /* Context if thread is suspended */ +} ThreadStruct; + + +/* ThreadCheck -- check a thread */ + +Bool ThreadCheck(Thread thread) +{ + CHECKS(Thread, thread); + CHECKU(Arena, thread->arena); + CHECKL(thread->serial < thread->arena->threadSerial); + CHECKL(RingCheck(&thread->arenaRing)); + CHECKD(PThreadext, &thread->thrextStruct); + return TRUE; +} + +Bool ThreadCheckSimple(Thread thread) +{ + CHECKS(Thread, thread); + return TRUE; +} + + +/* ThreadRegister -- register a thread with an arena */ + +Res ThreadRegister(Thread *threadReturn, Arena arena) +{ + Res res; + Thread thread; + void *p; + + AVER(threadReturn != NULL); + AVERT(Arena, arena); + + res = ControlAlloc(&p, arena, sizeof(ThreadStruct), + /* withReservoirPermit */ FALSE); + if(res != ResOK) + return res; + thread = (Thread)p; + + thread->id = pthread_self(); + + RingInit(&thread->arenaRing); + + thread->sig = ThreadSig; + thread->serial = arena->threadSerial; + ++arena->threadSerial; + thread->arena = arena; + thread->scpSusp = NULL; + + PThreadextInit(&thread->thrextStruct, thread->id); + + AVERT(Thread, thread); + + RingAppend(ArenaThreadRing(arena), &thread->arenaRing); + + *threadReturn = thread; + return ResOK; +} + + +/* ThreadDeregister -- deregister a thread from an arena */ + +void ThreadDeregister(Thread thread, Arena arena) +{ + AVERT(Thread, thread); + AVERT(Arena, arena); + + RingRemove(&thread->arenaRing); + + thread->sig = SigInvalid; + + RingFinish(&thread->arenaRing); + + PThreadextFinish(&thread->thrextStruct); + + ControlFree(arena, thread, sizeof(ThreadStruct)); +} + + +/* mapThreadRing -- map over threads on ring calling a function on each one + * except the current thread + */ + +static void mapThreadRing(Ring threadRing, void (*func)(Thread)) +{ + Ring node, next; + pthread_t self; + + AVERT(Ring, threadRing); + + self = pthread_self(); + RING_FOR(node, threadRing, next) { + Thread thread = RING_ELT(Thread, arenaRing, node); + AVERT(Thread, thread); + if(! pthread_equal(self, thread->id)) /* .thread.id */ + (*func)(thread); + } +} + + +/* ThreadRingSuspend -- suspend all threads on a ring, expect the current one */ + + +static void threadSuspend(Thread thread) +{ + /* .error.suspend */ + /* In the error case (PThreadextSuspend returning ResFAIL), we */ + /* assume the thread has been destroyed. */ + /* In which case we simply continue. */ + Res res; + res = PThreadextSuspend(&thread->thrextStruct, &thread->scpSusp); + if(res != ResOK) + thread->scpSusp = NULL; +} + + + +void ThreadRingSuspend(Ring threadRing) +{ + mapThreadRing(threadRing, threadSuspend); +} + + +/* ThreadRingResume -- resume all threads on a ring (expect the current one) */ + + +static void threadResume(Thread thread) +{ + /* .error.resume */ + /* If the previous suspend failed (thread->scpSusp == NULL), */ + /* or in the error case (PThreadextResume returning ResFAIL), */ + /* assume the thread has been destroyed. */ + /* In which case we simply continue. */ + if(thread->scpSusp != NULL) { + (void)PThreadextResume(&thread->thrextStruct); + thread->scpSusp = NULL; + } +} + +void ThreadRingResume(Ring threadRing) +{ + mapThreadRing(threadRing, threadResume); +} + + +/* ThreadRingThread -- return the thread at the given ring element */ + +Thread ThreadRingThread(Ring threadRing) +{ + Thread thread; + AVERT(Ring, threadRing); + thread = RING_ELT(Thread, arenaRing, threadRing); + AVERT(Thread, thread); + return thread; +} + + +/* ThreadArena -- get the arena of a thread + * + * Must be thread-safe. See design.mps.interface.c.thread-safety. + */ + +Arena ThreadArena(Thread thread) +{ + /* Can't check thread as that would not be thread-safe. */ + return thread->arena; +} + + +/* ThreadScan -- scan the state of a thread (stack and regs) */ + +Res ThreadScan(ScanState ss, Thread thread, void *stackBot) +{ + pthread_t self; + Res res; + + AVERT(Thread, thread); + self = pthread_self(); + if(pthread_equal(self, thread->id)) { + /* scan this thread's stack */ + res = StackScan(ss, stackBot); + if(res != ResOK) + return res; + } else { + struct sigcontext *scp; + Addr *stackBase, *stackLimit, stackPtr; + + scp = thread->scpSusp; + if(scp == NULL) { + /* .error.suspend */ + /* We assume that the thread must have been destroyed. */ + /* We ignore the situation by returning immediately. */ + return ResOK; + } + + stackPtr = (Addr)scp->esp; /* .i3.sp */ + /* .stack.align */ + stackBase = (Addr *)AddrAlignUp(stackPtr, sizeof(Addr)); + stackLimit = (Addr *)stackBot; + if (stackBase >= stackLimit) + return ResOK; /* .stack.below-bottom */ + + /* scan stack inclusive of current sp and exclusive of + * stackBot (.stack.full-descend) + */ + res = TraceScanAreaTagged(ss, stackBase, stackLimit); + if(res != ResOK) + return res; + + /* (.context.regroots) + * This scans the root registers (.context.regroots). It also + * unecessarily scans the rest of the context. The optimisation + * to scan only relevent parts would be machine dependent. + */ + res = TraceScanAreaTagged(ss, (Addr *)scp, + (Addr *)((char *)scp + sizeof(*scp))); + if(res != ResOK) + return res; + } + + return ResOK; +} + + +/* ThreadDescribe -- describe a thread */ + +Res ThreadDescribe(Thread thread, mps_lib_FILE *stream) +{ + Res res; + + res = WriteF(stream, + "Thread $P ($U) {\n", (WriteFP)thread, (WriteFU)thread->serial, + " arena $P ($U)\n", + (WriteFP)thread->arena, (WriteFU)thread->arena->serial, + " id $U\n", (WriteFU)thread->id, + "} Thread $P ($U)\n", (WriteFP)thread, (WriteFU)thread->serial, + NULL); + if(res != ResOK) + return res; + + return ResOK; +} diff --git a/mps/src/vmfr.c b/mps/src/vmfr.c new file mode 100644 index 00000000000..8fb9c978ed4 --- /dev/null +++ b/mps/src/vmfr.c @@ -0,0 +1,292 @@ +/* impl.c.vmli: VIRTUAL MEMORY MAPPING FOR LINUX + * + * $HopeName: MMsrc!vmli.c(trunk.7) $ + * Copyright (C) 2000 Harlequin Limited. All rights reserved. + * + * .purpose: This is the implementation of the virtual memory mapping + * interface (vm.h) for Linux. It was created by copying vmo1.c (the + * DIGITAL UNIX implementation) as that seemed to be closest. + * + * .design: See design.mps.vm. .design.linux: mmap(2) is used to + * reserve address space by creating a mapping with page access none. + * mmap(2) is used to map pages onto store by creating a copy-on-write + * (MAP_PRIVATE) mapping with the flag MAP_ANONYMOUS. + * + * .assume.not-last: The implementation of VMCreate assumes that + * mmap() will not choose a region which contains the last page + * in the address space, so that the limit of the mapped area + * is representable. + * + * .assume.mmap.err: ENOMEM is the only error we really expect to + * get from mmap. The others are either caused by invalid params + * or features we don't use. See mmap(2) for details. + * + * .assume.off_t: We assume that the Size type (defined by the MM) fits + * in the off_t type (define by the system (POSIX?)). In fact we test + * the more stringent requirement that they are the same size. This + * assumption is made in VMUnmap. + * + * .remap: Possibly this should use mremap to reduce the number of + * distinct mappings. According to our current testing, it doesn't + * seem to be a problem. + */ + +/* Use all extensions */ +#define _GNU_SOURCE 1 + +/* for open(2) */ +#include +#include +#include + +/* for mmap(2), munmap(2) */ +#include + +/* for errno(2) */ +#include + +/* for sysconf(2), close(2) */ +#include + +#include "mpm.h" + + +#ifndef MPS_OS_LI +#error "vmli.c is LINUX specific, but MPS_OS_LI is not set" +#endif + +SRCID(vmli, "$HopeName: MMsrc!vmli.c(trunk.7) $"); + + +/* VMStruct -- virtual memory structure */ + +#define VMSig ((Sig)0x519B3999) /* SIGnature VM */ + +typedef struct VMStruct { + Sig sig; /* design.mps.sig */ + Align align; /* page size */ + Addr base, limit; /* boundaries of reserved space */ + Size reserved; /* total reserved address space */ + Size mapped; /* total mapped memory */ +} VMStruct; + + +/* VMAlign -- return page size */ + +Align VMAlign(VM vm) +{ + return vm->align; +} + + +/* VMCheck -- check a VM */ + +Bool VMCheck(VM vm) +{ + CHECKS(VM, vm); + CHECKL(vm->base != 0); + CHECKL(vm->limit != 0); + CHECKL(vm->base < vm->limit); + CHECKL(vm->mapped <= vm->reserved); + CHECKL(SizeIsP2(vm->align)); + CHECKL(AddrIsAligned(vm->base, vm->align)); + CHECKL(AddrIsAligned(vm->limit, vm->align)); + return TRUE; +} + + +/* VMCreate -- reserve some virtual address space, and create a VM structure */ + +Res VMCreate(VM *vmReturn, Size size) +{ + Align align; + VM vm; + long pagesize; + void *addr; + Res res; + + AVER(vmReturn != NULL); + + /* sysconf code copied wholesale from vmso.c */ + /* Find out the page size from the OS */ + pagesize = sysconf(_SC_PAGESIZE); + /* check the actual returned pagesize will fit in an object of */ + /* type Align. */ + AVER(pagesize > 0); + AVER((unsigned long)pagesize <= (unsigned long)(Align)-1); + /* Note implicit conversion from "long" to "Align". */ + align = pagesize; + AVER(SizeIsP2(align)); + size = SizeAlignUp(size, align); + if((size == 0) || (size > (Size)(size_t)-1)) + return ResRESOURCE; + + /* Map in a page to store the descriptor on. */ + addr = mmap(0, (size_t)SizeAlignUp(sizeof(VMStruct), align), + PROT_READ | PROT_WRITE, + MAP_ANONYMOUS | MAP_PRIVATE, + -1, 0); + if(addr == MAP_FAILED) { + int e = errno; + AVER(e == ENOMEM); /* .assume.mmap.err */ + return ResMEMORY; + } + vm = (VM)addr; + + vm->align = align; + + /* See .assume.not-last. */ + addr = mmap(0, (size_t)size, + PROT_NONE, MAP_ANONYMOUS | MAP_PRIVATE, + -1, 0); + if(addr == MAP_FAILED) { + int e = errno; + AVER(e == ENOMEM); /* .assume.mmap.err */ + res = ResRESOURCE; + goto failReserve; + } + + vm->base = (Addr)addr; + vm->limit = AddrAdd(vm->base, size); + vm->reserved = size; + vm->mapped = (Size)0; + + vm->sig = VMSig; + + AVERT(VM, vm); + + EVENT_PAA(VMCreate, vm, vm->base, vm->limit); + + *vmReturn = vm; + return ResOK; + +failReserve: + (void)munmap((void *)vm, (size_t)SizeAlignUp(sizeof(VMStruct), align)); + return res; +} + + +/* VMDestroy -- release all address space and destroy VM structure */ + +void VMDestroy(VM vm) +{ + int r; + + AVERT(VM, vm); + AVER(vm->mapped == (Size)0); + + /* This appears to be pretty pointless, since the descriptor */ + /* page is about to vanish completely. However, munmap might fail */ + /* for some reason, and this would ensure that it was still */ + /* discovered if sigs were being checked. */ + vm->sig = SigInvalid; + + r = munmap((void *)vm->base, (size_t)AddrOffset(vm->base, vm->limit)); + AVER(r == 0); + r = munmap((void *)vm, + (size_t)SizeAlignUp(sizeof(VMStruct), vm->align)); + AVER(r == 0); + + EVENT_P(VMDestroy, vm); +} + + +/* VMBase -- return the base address of the memory reserved */ + +Addr VMBase(VM vm) +{ + AVERT(VM, vm); + + return vm->base; +} + + +/* VMLimit -- return the limit address of the memory reserved */ + +Addr VMLimit(VM vm) +{ + AVERT(VM, vm); + + return vm->limit; +} + + +/* VMReserved -- return the amount of memory reserved */ + +Size VMReserved(VM vm) +{ + AVERT(VM, vm); + + return vm->reserved; +} + + +/* VMMapped -- return the amount of memory actually mapped */ + +Size VMMapped(VM vm) +{ + AVERT(VM, vm); + + return vm->mapped; +} + + +/* VMMap -- map the given range of memory */ + +Res VMMap(VM vm, Addr base, Addr limit) +{ + Size size; + + AVERT(VM, vm); + AVER(sizeof(void *) == sizeof(Addr)); + AVER(base < limit); + AVER(base >= vm->base); + AVER(limit <= vm->limit); + AVER(AddrIsAligned(base, vm->align)); + AVER(AddrIsAligned(limit, vm->align)); + + size = AddrOffset(base, limit); + + if(mmap((void *)base, (size_t)size, + PROT_READ | PROT_WRITE | PROT_EXEC, + MAP_ANONYMOUS | MAP_PRIVATE | MAP_FIXED, + -1, 0) + == MAP_FAILED) { + AVER(errno == ENOMEM); /* .assume.mmap.err */ + return ResMEMORY; + } + + vm->mapped += size; + + EVENT_PAA(VMMap, vm, base, limit); + return ResOK; +} + + +/* VMUnmap -- unmap the given range of memory */ + +void VMUnmap(VM vm, Addr base, Addr limit) +{ + Size size; + void *addr; + + AVERT(VM, vm); + AVER(base < limit); + AVER(base >= vm->base); + AVER(limit <= vm->limit); + AVER(AddrIsAligned(base, vm->align)); + AVER(AddrIsAligned(limit, vm->align)); + AVER(sizeof(off_t) == sizeof(Size)); /* .assume.off_t */ + + size = AddrOffset(base, limit); + + /* see design.mps.vmo1.fun.unmap.offset */ + addr = mmap((void *)base, (size_t)size, + PROT_NONE, MAP_ANONYMOUS | MAP_PRIVATE | MAP_FIXED, + -1, 0); + AVER(addr == (void *)base); + + vm->mapped -= size; + + EVENT_PAA(VMUnmap, vm, base, limit); +} From 9daaa5ceeb9ea2af9f09ffa31e8dfad17aea6878 Mon Sep 17 00:00:00 2001 From: Nick Barnes Date: Tue, 2 Oct 2001 14:25:10 +0100 Subject: [PATCH 03/10] Need a version of this for freebsd also. Copied from Perforce Change: 22870 ServerID: perforce.ravenbrook.com --- mps/src/prmcfr.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 mps/src/prmcfr.h diff --git a/mps/src/prmcfr.h b/mps/src/prmcfr.h new file mode 100644 index 00000000000..477875303bc --- /dev/null +++ b/mps/src/prmcfr.h @@ -0,0 +1,26 @@ +/* impl.h.prmcli: PROTECTION MUTATOR CONTEXT (Linux) + * + * $HopeName: $ + * Copyright (C) 1998 The Harlequin Group Limited. All rights reserved. + * + * .readership: MPS developers. + */ + +#ifndef prmcli_h +#define prmcli_h + + +/* open sesame magic */ +#define _BSD_SOURCE 1 +#define _POSIX_C_SOURCE 1 + +#include "mpm.h" + +#include + +typedef struct MutatorFaultContextStruct { /* Protection fault context data */ + struct sigcontext *scp; /* Linux sigcontext */ +} MutatorFaultContextStruct; + + +#endif /* prmcli_h */ From 2dbe0fc6f261213726edfb7ed4a33e5571dabf9c Mon Sep 17 00:00:00 2001 From: Nick Barnes Date: Tue, 2 Oct 2001 15:29:52 +0100 Subject: [PATCH 04/10] This instruction stepping stuff with the mutatorfaultcontext only really works for dylan. Copied from Perforce Change: 22873 ServerID: perforce.ravenbrook.com --- mps/src/fri4gc.gmk | 4 +-- mps/src/prmci3fr.c | 86 ---------------------------------------------- 2 files changed, 2 insertions(+), 88 deletions(-) delete mode 100644 mps/src/prmci3fr.c diff --git a/mps/src/fri4gc.gmk b/mps/src/fri4gc.gmk index b8963680eb9..fadadd13e69 100644 --- a/mps/src/fri4gc.gmk +++ b/mps/src/fri4gc.gmk @@ -1,4 +1,4 @@ -# impl.gmk.lii4gc: BUILD FOR LINUX/INTEL/GCC PLATFORM +# impl.gmk.fri4gc: BUILD FOR FreeBSD/INTEL/GCC PLATFORM # # $HopeName: MMsrc!lii4gc.gmk(trunk.5) $ # Copyright (C) 2000 Harlequin Limited. All rights reserved. @@ -8,7 +8,7 @@ PFM = fri4gc PFMDEFS = -D_REENTRANT MPMPF = mpsliban.c mpsioan.c lockfr.c thfri4.c pthrdext.c vmfr.c \ - protfr.c protfri3.c proti3.c prmci3fr.c ssfri3.c span.c + protfr.c protfri3.c prmcan.c ssfri3.c span.c SWPF = than.c vmfr.c protsw.c prmcan.c ssan.c LIBS = -lm -pthread diff --git a/mps/src/prmci3fr.c b/mps/src/prmci3fr.c deleted file mode 100644 index f0013092970..00000000000 --- a/mps/src/prmci3fr.c +++ /dev/null @@ -1,86 +0,0 @@ -/* impl.c.prmci3li: PROTECTION MUTATOR CONTEXT INTEL 386 (LINUX) - * - * $HopeName: MMsrc!prmci3li.c(trunk.3) $ - * Copyright (C) 1999 Harlequin Limited. All rights reserved. - * - * .purpose: This module implements the part of the protection module - * that decodes the MutatorFaultContext. - * - * - * SOURCES - * - * .source.i486: Intel486 Microprocessor Family Programmer's - * Reference Manual - * - * .source.linux.kernel: Linux kernel source files. - * - * - * ASSUMPTIONS - * - * .assume.regref: The resisters in the context can be modified by - * storing into an MRef pointer. - */ - -/* prmcli.h will include mpm.h after defining open sesame magic */ -#include "prmcli.h" -#include "prmci3.h" - -SRCID(prmci3li, "$HopeName$"); - - -/* Prmci3AddressHoldingReg -- return an address of a register in a context */ - -MRef Prmci3AddressHoldingReg(MutatorFaultContext context, unsigned int regnum) -{ - struct sigcontext *scp; - - AVER(regnum <= 7); - AVER(regnum >= 0); - - scp = context->scp; - - /* .source.i486 */ - /* .assume.regref */ - switch (regnum) { - case 0: return (MRef)&scp->eax; - case 1: return (MRef)&scp->ecx; - case 2: return (MRef)&scp->edx; - case 3: return (MRef)&scp->ebx; - case 4: return (MRef)&scp->esp; - case 5: return (MRef)&scp->ebp; - case 6: return (MRef)&scp->esi; - case 7: return (MRef)&scp->edi; - } - NOTREACHED; - return (MRef)NULL; /* Keep compiler happy. */ -} - - -/* Prmci3DecodeFaultContext -- decode fault to find faulting address and IP */ - -void Prmci3DecodeFaultContext(MRef *faultmemReturn, - Byte **insvecReturn, - MutatorFaultContext context) -{ - struct sigcontext *scp; - - scp = context->scp; - - /* Assert that this is a page fault exception. The computation of */ - /* faultmem depends on this. See .source.i486 (9.9.14). */ - AVER(scp->trapno == 14); - - /* cr2 contains the address which caused the fault. */ - /* See .source.i486 (9.9.14) and */ - /* .source.linux.kernel (linux/arch/i386/mm/fault.c). */ - *faultmemReturn = (MRef)scp->cr2; - *insvecReturn = (Byte*)scp->eip; -} - - -/* Prmci3StepOverIns -- modify context to step over instruction */ - -void Prmci3StepOverIns(MutatorFaultContext context, Size inslen) -{ - context->scp->eip += (unsigned long)inslen; -} From 894748f515ff87248a4b702bc1d1d72a4f583188 Mon Sep 17 00:00:00 2001 From: Nick Barnes Date: Mon, 8 Oct 2001 15:15:16 +0100 Subject: [PATCH 05/10] Robot users use the p4 user 'infosys'. Copied from Perforce Change: 23054 ServerID: perforce.ravenbrook.com --- mps/src/lockfr.c | 48 ++++++------------ mps/src/prmcfr.h | 15 ++---- mps/src/protfr.c | 22 +++++---- mps/src/protfri3.c | 119 ++++++++++++++++++++------------------------- mps/src/pthrdext.h | 8 +-- mps/src/thfri4.c | 30 ++++++------ mps/src/thlii4.c | 34 ++++++------- mps/src/vmfr.c | 34 +++++-------- 8 files changed, 134 insertions(+), 176 deletions(-) diff --git a/mps/src/lockfr.c b/mps/src/lockfr.c index 97e242d1d6a..e6d1041912d 100644 --- a/mps/src/lockfr.c +++ b/mps/src/lockfr.c @@ -1,28 +1,26 @@ -/* impl.c.lockli: RECURSIVE LOCKS FOR POSIX SYSTEMS +/* impl.c.lockfr: RECURSIVE LOCKS FOR POSIX SYSTEMS * * $HopeName$ * Copyright (C) 2000 Harlequin Limited. All rights reserved. * - * .linux: This implementation currently just supports LinuxThreads - * (platform MPS_OS_LI), Single Unix i/f. + * .freebsd: This implementation supports FreeBSD (platform + * MPS_OS_FR). * * .posix: In fact, the implementation should be reusable for most POSIX - * implementations, but may need some customization for each. + * implementations, but may need some customization for each. * * .design: These locks are implemented using mutexes. * - * .recursive: Mutexes support both non-recursive and recursive locking, but - * only at initialization time. This doesn't match the API of MPS Lock module, - * which chooses at locking time, so all locks are made (non-recursive) - * errorchecking. Recursive locks are implemented by checking the error - * code. + * .recursive: Mutexes support both non-recursive and recursive + * locking, but only at initialization time. This doesn't match the + * API of MPS Lock module, which chooses at locking time, so all locks + * are made (non-recursive) errorchecking. Recursive locks are + * implemented by checking the error code. * - * .claims: During use the claims field is updated to remember the number of - * claims acquired on a lock. This field must only be modified - * while we hold the mutex. - */ + * .claims: During use the claims field is updated to remember the + * number of claims acquired on a lock. This field must only be + * modified while we hold the mutex. */ -#define _XOPEN_SOURCE 500 #include #include #include @@ -32,32 +30,16 @@ #include "config.h" -#ifndef MPS_OS_LI -#error "lockli.c is specific to LinuxThreads but MPS_OS_LI not defined" +#ifndef MPS_OS_FR +#error "lockfr.c is FreeBSD specific but MPS_OS_FR not defined" #endif SRCID(lockli, "$HopeName$"); -/* LockAttrSetRecursive -- Set mutexattr to permit recursive locking - * - * There's a standard way to do this - but early LinuxThreads doesn't - * quite follow the standard. Some other implementations might not - * either. - */ - -#ifdef OLD_LINUXTHREADS - -#define LockAttrSetRecursive(attrptr) \ - pthread_mutexattr_setkind_np(attrptr, PTHREAD_MUTEX_ERRORCHECK_NP) - -#else - #define LockAttrSetRecursive(attrptr) \ pthread_mutexattr_settype(attrptr, PTHREAD_MUTEX_ERRORCHECK) -#endif - /* LockStruct -- the MPS lock structure * @@ -173,7 +155,7 @@ void LockClaimRecursive(Lock lock) /* pthread_mutex_lock will return: */ /* 0 if we have just claimed the lock */ /* EDEADLK if we own the lock already. */ - AVER((res == 0 && lock->claims == 0) || + AVER((res == 0 && lock->claims == 0) || (res == EDEADLK && lock->claims > 0)); ++lock->claims; diff --git a/mps/src/prmcfr.h b/mps/src/prmcfr.h index 477875303bc..53d3fb75d4d 100644 --- a/mps/src/prmcfr.h +++ b/mps/src/prmcfr.h @@ -1,4 +1,4 @@ -/* impl.h.prmcli: PROTECTION MUTATOR CONTEXT (Linux) +/* impl.h.prmcli: PROTECTION MUTATOR CONTEXT (FreeBSD) * * $HopeName: $ * Copyright (C) 1998 The Harlequin Group Limited. All rights reserved. @@ -6,21 +6,16 @@ * .readership: MPS developers. */ -#ifndef prmcli_h -#define prmcli_h - - -/* open sesame magic */ -#define _BSD_SOURCE 1 -#define _POSIX_C_SOURCE 1 +#ifndef prmcfr_h +#define prmcfr_h #include "mpm.h" #include typedef struct MutatorFaultContextStruct { /* Protection fault context data */ - struct sigcontext *scp; /* Linux sigcontext */ + ucontext_t *ucontext; } MutatorFaultContextStruct; -#endif /* prmcli_h */ +#endif /* prmcfr_h */ diff --git a/mps/src/protfr.c b/mps/src/protfr.c index 20c9dfc5b55..403e2639344 100644 --- a/mps/src/protfr.c +++ b/mps/src/protfr.c @@ -1,4 +1,4 @@ -/* impl.c.protli: PROTECTION FOR LINUX +/* impl.c.protfr: PROTECTION FOR FreeBSD * * $HopeName: $ * Copyright (C) 1995,1999 Harlequin Group, all rights reserved @@ -7,11 +7,11 @@ #include "mpm.h" -#ifndef MPS_OS_LI -#error "protli.c is Linux specific, but MPS_OS_LI is not set" +#ifndef MPS_OS_FR +#error "protfr.c is FreeBSD specific, but MPS_OS_FR is not set" #endif #ifndef PROTECTION -#error "protli.c implements protection, but PROTECTION is not set" +#error "protfr.c implements protection, but PROTECTION is not set" #endif #include @@ -19,7 +19,7 @@ #include #include -SRCID(protli, "$HopeName: $"); +SRCID(protfr, "$HopeName: $"); /* ProtSet -- set protection @@ -42,6 +42,8 @@ void ProtSet(Addr base, Addr limit, AccessSet mode) * access unless explicitly told not to) caused mmqa test 37 to fail. * This might be a bug in MPS, so for now we go with the stricter * version that matches the Win32 implementation. */ + /* .flags.trouble.freebsd: the above comment was in the Linux version + * of this code; I haven't verified it for FreeBSD. */ flags = 0; if((mode & AccessREAD) == 0) flags |= PROT_READ | PROT_EXEC; @@ -61,7 +63,7 @@ void ProtSet(Addr base, Addr limit, AccessSet mode) /* ProtSync -- synchronize protection settings with hardware * - * This does nothing under Linux. + * This does nothing under FreeBSD. */ void ProtSync(Arena arena) @@ -73,10 +75,10 @@ void ProtSync(Arena arena) /* ProtTramp -- protection trampoline * - * The protection trampoline is trivial under Linux, as there is nothing - * that needs to be done in the dynamic context of the mutator in order - * to catch faults. (Contrast this with Win32 Structured Exception - * Handling.) + * The protection trampoline is trivial under FreeBSD, as there is + * nothing that needs to be done in the dynamic context of the mutator + * in order to catch faults. (Contrast this with Win32 Structured + * Exception Handling.) */ void ProtTramp(void **resultReturn, void *(*f)(void *, size_t), diff --git a/mps/src/protfri3.c b/mps/src/protfri3.c index 3e3f6b3dd92..7da59b53a86 100644 --- a/mps/src/protfri3.c +++ b/mps/src/protfri3.c @@ -1,45 +1,32 @@ -/* impl.c.protlii3: PROTECTION FOR LINUX (INTEL 386) +/* impl.c.protfri3: PROTECTION FOR FREEBSD (INTEL 386) * * $HopeName: MMsrc!protlii3.c(trunk.3) $ * Copyright (C) 2000 Harlequin Limited. All rights reserved. * * SOURCES * - * .source.i486: Intel486 Microprocessor Family Programmer's + * .source.i486: Intel486 Microprocessor Family Programmer's * Reference Manual * - * .source.linux.kernel: Linux kernel source files. + * .source.man: sigaction(2): FreeBSD System Calls Manual. */ -#include "prmcli.h" +#include "prmcfr.h" -#ifndef MPS_OS_LI -#error "protlii3.c is Linux-specific, but MPS_OS_LI is not set" +#ifndef MPS_OS_FR +#error "protfri3.c is FreeBSD-specific, but MPS_OS_FR is not set" #endif #if !defined(MPS_ARCH_I3) && !defined(MPS_ARCH_I4) -#error "protlii3.c is Intel-specific, but MPS_ARCH_I3 or MPS_ARCH_I4 is not set" +#error "protfri3.c is Intel-specific, but MPS_ARCH_I3 or MPS_ARCH_I4 is not set" #endif #ifndef PROTECTION -#error "protlii3.c implements protection, but PROTECTION is not set" +#error "protfri3.c implements protection, but PROTECTION is not set" #endif -#include -#include -#include #include +#include -SRCID(protlii3, "$HopeName: MMsrc!protlii3.c(trunk.3) $"); - - -/* Useful stuff that doesn't appear to be in any header files. */ - -/* Interrupt number 14 is Page Fault. */ -#define TRAPNO_PAGE_FAULT 14 - -/* Bits in err field of sigcontext for interrupt 14 (page fault) */ -#define PAGE_FAULT_ERR_PAGEPROT 0x1 -#define PAGE_FAULT_ERR_WRITE 0x2 -#define PAGE_FAULT_ERR_USERMODE 0x4 +SRCID(protfri3, "$HopeName: MMsrc!protlii3.c(trunk.3) $"); /* The previously-installed signal action, as returned by */ @@ -47,58 +34,53 @@ SRCID(protlii3, "$HopeName: MMsrc!protlii3.c(trunk.3) $"); static struct sigaction sigNext; - -typedef void (*__real_lii3_sighandler_t)(int, struct sigcontext); - - /* sigHandle -- protection signal handler * * This is the signal handler installed by ProtSetup to deal with - * protection faults. It is installed on the SIGSEGV signal. - * It decodes the protection fault details from the signal context - * and passes them to ArenaAccess, which attempts to handle the - * fault and remove its cause. If the fault is handled, then - * the handler returns and execution resumes. If it isn't handled, - * then sigHandle does its best to pass the signal on to the - * previously installed signal handler (sigNext). + * protection faults. It is installed on the SIGBUS signal. It + * decodes the protection fault details from the signal context and + * passes them to ArenaAccess, which attempts to handle the fault and + * remove its cause. If the fault is handled, then the handler + * returns and execution resumes. If it isn't handled, then + * sigHandle does its best to pass the signal on to the previously + * installed signal handler (sigNext). * - * .sigh.args: There is no officially documented way of getting the - * sigcontext, but on x86 Linux at least it is passed BY VALUE as a - * second argument to the signal handler. The prototype doesn't - * include this arg. - * See .source.linux.kernel (linux/arch/i386/kernel/signal.c). + * .sigh.args: The sigaction manual page .source.man documents three + * different handler prototypes: ANSI C sa_handler, traditional BSD + * sa_handler, and POSIX SA_SIGINFO sa_sigaction. The ANSI C + * prototype isn't powerful enough for us (can't get addresses), and + * the manual page deprecates the BSD sa_handler in favour of the + * POSIX SA_SIGINFO sa_sigaction. In that prototype, the arguments + * are: signal number, pointer to signal info structure, pointer to + * signal context structure. * - * .sigh.context: We only know how to handle interrupt 14, where - * context.err gives the page fault error code and context.cr2 gives - * the fault address. See .source.i486 (9.9.14) and - * .source.linux.kernel (linux/arch/i386/mm/fault.c). + * .sigh.context: We only know how to handle signals with code + * BUS_PAGE_FAULT, where info->si_addr gives the fault address. * - * .sigh.addr: We assume that the OS decodes the address to something - * sensible + * .sigh.mode: The fault type (read/write) does not appear to be + * available to the signal handler (see mail archive). */ - -static void sigHandle(int sig, struct sigcontext context) /* .sigh.args */ -{ - AVER(sig == SIGSEGV); - if(context.trapno == TRAPNO_PAGE_FAULT) { /* .sigh.context */ +static void sigHandle(int sig, siginfo_t *info, void *context) /* .sigh.args */ +{ + ucontext_t *ucontext = (ucontext_t *)context; + AVER(sig == SIGBUS); + + if(info->si_code == BUS_PAGE_FAULT) { /* .sigh.context */ AccessSet mode; Addr base, limit; MutatorFaultContextStruct mfContext; - mfContext.scp = &context; + mfContext.ucontext = ucontext; - mode = ((context.err & PAGE_FAULT_ERR_WRITE) != 0) /* .sigh.context */ - ? (AccessREAD | AccessWRITE) - : AccessREAD; + mode = AccessREAD | AccessWRITE; /* .sigh.mode */ /* We assume that the access is for one word at the address. */ - base = (Addr)context.cr2; /* .sigh.addr */ + base = (Addr)info->si_addr; /* .sigh.context */ limit = AddrAdd(base, (Size)sizeof(Addr)); /* Offer each protection structure the opportunity to handle the */ /* exception. If it succeeds, then allow the mutator to continue. */ - if(ArenaAccess(base, mode, &mfContext)) return; } @@ -118,7 +100,13 @@ static void sigHandle(int sig, struct sigcontext context) /* .sigh.args */ NOTREACHED; break; default: - (*(__real_lii3_sighandler_t)sigNext.sa_handler)(sig, context); + if ((int)sigNext.sa_handler & SA_SIGINFO) { + (*sigNext.sa_sigaction)(sig, info, context); + } else { + /* @@@@ what if the previous handler is BSD-style? */ + /* We don't have a struct sigcontext to pass to it. */ + (*sigNext.sa_handler)(sig, info->si_code); + } break; } } @@ -126,26 +114,25 @@ static void sigHandle(int sig, struct sigcontext context) /* .sigh.args */ /* ProtSetup -- global protection setup * - * Under Linux, the global setup involves installing a signal handler - * on SIGSEGV to catch and handle page faults (see sigHandle). - * The previous handler is recorded so that it can be reached from - * sigHandle if it fails to handle the fault. + * Under FreeBSD, the global setup involves installing a signal + * handler on SIGBUS to catch and handle page faults (see + * sigHandle). The previous handler is recorded so that it can be + * reached from sigHandle if it fails to handle the fault. * * NOTE: There are problems with this approach: * 1. we can't honor the sa_flags for the previous handler, * 2. what if this thread is suspended just after calling signal(3)? - * The sigNext variable will never be initialized! - */ + * The sigNext variable will never be initialized! */ void ProtSetup(void) { struct sigaction sa; int result; - sa.sa_handler = (__sighandler_t)sigHandle; /* .sigh.args */ + sa.sa_sigaction = sigHandle; sigemptyset(&sa.sa_mask); - sa.sa_flags = 0; + sa.sa_flags = SA_SIGINFO; - result = sigaction(SIGSEGV, &sa, &sigNext); + result = sigaction(SIGBUS, &sa, &sigNext); AVER(result == 0); } diff --git a/mps/src/pthrdext.h b/mps/src/pthrdext.h index 4ec4daa99f9..4b32adb649b 100644 --- a/mps/src/pthrdext.h +++ b/mps/src/pthrdext.h @@ -26,13 +26,13 @@ typedef struct PThreadextStruct *PThreadext; /* PThreadextStruct -- structure definition * - * Should be embedded in a client structure + * Should be embedded in a client structure */ typedef struct PThreadextStruct { Sig sig; /* design.mps.sig */ pthread_t id; /* Thread ID */ - struct sigcontext *suspendedScp; /* sigcontext if suspended */ + struct MutatorFaultContext *suspendedMFC; /* context if suspended */ RingStruct threadRing; /* ring of suspended threads */ RingStruct idRing; /* duplicate suspensions for id */ } PThreadextStruct; @@ -56,8 +56,8 @@ extern void PThreadextFinish(PThreadext pthreadext); /* PThreadextSuspend -- Suspend a pthreadext and return its context. */ -extern Res PThreadextSuspend(PThreadext pthreadext, - struct sigcontext **contextReturn); +extern Res PThreadextSuspend(PThreadext pthreadext, + MutatorFaultContext contextReturn); /* PThreadextResume -- Resume a suspended pthreadext */ diff --git a/mps/src/thfri4.c b/mps/src/thfri4.c index f42e7a1f52a..2d25100fc7a 100644 --- a/mps/src/thfri4.c +++ b/mps/src/thfri4.c @@ -1,4 +1,4 @@ -/* impl.c.thlii3: Threads Manager for Intel x86 systems with LinuxThreads +/* impl.c.thfri3: Threads Manager for Intel x86 systems on FreeBSD * * $HopeName: MMsrc!thlii4.c(trunk.2) $ * Copyright (C) 2000 Harlequin Limited. All rights reserved. @@ -21,14 +21,14 @@ * i.e. stack pointer points to the last allocated location; * stack grows downwards. * - * .stack.below-bottom: it's legal for the stack pointer to be at a - * higher address than the registered bottom of stack. This might - * happen if the stack of another thread doesn't contain any frames + * .stack.below-bottom: it's legal for the stack pointer to be at a + * higher address than the registered bottom of stack. This might + * happen if the stack of another thread doesn't contain any frames * belonging to the client language. In this case, the stack should * not be scanned. * * .stack.align: assume roots on the stack are always word-aligned, - * but don't assume that the stack pointer is necessarily + * but don't assume that the stack pointer is necessarily * word-aligned at the time of reading the context of another thread. * * .sp: The stack pointer in the context is ESP. @@ -36,17 +36,17 @@ * assumed to be recorded in the context at pointer-aligned boundaries. */ -#include "prmcli.h" +#include "prmcfr.h" #include "mpm.h" -#if !defined(MPS_OS_LI) || !defined(MPS_ARCH_I4) -#error "Compiling thlii4 when MPS_OS_LI or MPS_ARCH_I4 not defined." +#if !defined(MPS_OS_FR) || !defined(MPS_ARCH_I4) +#error "Compiling thfri4 when MPS_OS_FR or MPS_ARCH_I4 not defined." #endif #include #include "pthrdext.h" -SRCID(thlii4, "$HopeName: MMsrc!thlii4.c(trunk.2) $"); +SRCID(thfri4, "$HopeName: MMsrc!thlii4.c(trunk.2) $"); /* ThreadStruct -- thread desriptor */ @@ -58,7 +58,7 @@ typedef struct ThreadStruct { /* PThreads thread structure */ RingStruct arenaRing; /* threads attached to arena */ PThreadextStruct thrextStruct; /* PThreads extension */ pthread_t id; /* Pthread object of thread */ - struct sigcontext *scpSusp; /* Context if thread is suspended */ + MutatorFaultContextStruct mfc; /* Context if thread is suspended */ } ThreadStruct; @@ -92,9 +92,9 @@ Res ThreadRegister(Thread *threadReturn, Arena arena) AVER(threadReturn != NULL); AVERT(Arena, arena); - res = ControlAlloc(&p, arena, sizeof(ThreadStruct), + res = ControlAlloc(&p, arena, sizeof(ThreadStruct), /* withReservoirPermit */ FALSE); - if(res != ResOK) + if(res != ResOK) return res; thread = (Thread)p; @@ -288,15 +288,15 @@ Res ThreadScan(ScanState ss, Thread thread, void *stackBot) Res ThreadDescribe(Thread thread, mps_lib_FILE *stream) { Res res; - + res = WriteF(stream, "Thread $P ($U) {\n", (WriteFP)thread, (WriteFU)thread->serial, - " arena $P ($U)\n", + " arena $P ($U)\n", (WriteFP)thread->arena, (WriteFU)thread->arena->serial, " id $U\n", (WriteFU)thread->id, "} Thread $P ($U)\n", (WriteFP)thread, (WriteFU)thread->serial, NULL); - if(res != ResOK) + if(res != ResOK) return res; return ResOK; diff --git a/mps/src/thlii4.c b/mps/src/thlii4.c index f42e7a1f52a..c31a690c8af 100644 --- a/mps/src/thlii4.c +++ b/mps/src/thlii4.c @@ -21,14 +21,14 @@ * i.e. stack pointer points to the last allocated location; * stack grows downwards. * - * .stack.below-bottom: it's legal for the stack pointer to be at a - * higher address than the registered bottom of stack. This might - * happen if the stack of another thread doesn't contain any frames + * .stack.below-bottom: it's legal for the stack pointer to be at a + * higher address than the registered bottom of stack. This might + * happen if the stack of another thread doesn't contain any frames * belonging to the client language. In this case, the stack should * not be scanned. * * .stack.align: assume roots on the stack are always word-aligned, - * but don't assume that the stack pointer is necessarily + * but don't assume that the stack pointer is necessarily * word-aligned at the time of reading the context of another thread. * * .sp: The stack pointer in the context is ESP. @@ -58,7 +58,7 @@ typedef struct ThreadStruct { /* PThreads thread structure */ RingStruct arenaRing; /* threads attached to arena */ PThreadextStruct thrextStruct; /* PThreads extension */ pthread_t id; /* Pthread object of thread */ - struct sigcontext *scpSusp; /* Context if thread is suspended */ + MutatorFaultContextStruct mfc; /* Context if thread is suspended */ } ThreadStruct; @@ -92,9 +92,9 @@ Res ThreadRegister(Thread *threadReturn, Arena arena) AVER(threadReturn != NULL); AVERT(Arena, arena); - res = ControlAlloc(&p, arena, sizeof(ThreadStruct), + res = ControlAlloc(&p, arena, sizeof(ThreadStruct), /* withReservoirPermit */ FALSE); - if(res != ResOK) + if(res != ResOK) return res; thread = (Thread)p; @@ -106,7 +106,7 @@ Res ThreadRegister(Thread *threadReturn, Arena arena) thread->serial = arena->threadSerial; ++arena->threadSerial; thread->arena = arena; - thread->scpSusp = NULL; + thread->mfc.scp = NULL; PThreadextInit(&thread->thrextStruct, thread->id); @@ -169,9 +169,9 @@ static void threadSuspend(Thread thread) /* assume the thread has been destroyed. */ /* In which case we simply continue. */ Res res; - res = PThreadextSuspend(&thread->thrextStruct, &thread->scpSusp); + res = PThreadextSuspend(&thread->thrextStruct, &thread->mfc); if(res != ResOK) - thread->scpSusp = NULL; + thread->mfc.scp = NULL; } @@ -188,13 +188,13 @@ void ThreadRingSuspend(Ring threadRing) static void threadResume(Thread thread) { /* .error.resume */ - /* If the previous suspend failed (thread->scpSusp == NULL), */ + /* If the previous suspend failed (thread->mfc.scp == NULL), */ /* or in the error case (PThreadextResume returning ResFAIL), */ /* assume the thread has been destroyed. */ /* In which case we simply continue. */ - if(thread->scpSusp != NULL) { + if(thread->mfc.scp != NULL) { (void)PThreadextResume(&thread->thrextStruct); - thread->scpSusp = NULL; + thread->mfc.scp = NULL; } } @@ -246,7 +246,7 @@ Res ThreadScan(ScanState ss, Thread thread, void *stackBot) struct sigcontext *scp; Addr *stackBase, *stackLimit, stackPtr; - scp = thread->scpSusp; + scp = thread->mfc.scp; if(scp == NULL) { /* .error.suspend */ /* We assume that the thread must have been destroyed. */ @@ -288,15 +288,15 @@ Res ThreadScan(ScanState ss, Thread thread, void *stackBot) Res ThreadDescribe(Thread thread, mps_lib_FILE *stream) { Res res; - + res = WriteF(stream, "Thread $P ($U) {\n", (WriteFP)thread, (WriteFU)thread->serial, - " arena $P ($U)\n", + " arena $P ($U)\n", (WriteFP)thread->arena, (WriteFU)thread->arena->serial, " id $U\n", (WriteFU)thread->id, "} Thread $P ($U)\n", (WriteFP)thread, (WriteFU)thread->serial, NULL); - if(res != ResOK) + if(res != ResOK) return res; return ResOK; diff --git a/mps/src/vmfr.c b/mps/src/vmfr.c index 8fb9c978ed4..122f2703760 100644 --- a/mps/src/vmfr.c +++ b/mps/src/vmfr.c @@ -1,16 +1,16 @@ -/* impl.c.vmli: VIRTUAL MEMORY MAPPING FOR LINUX +/* impl.c.vmli: VIRTUAL MEMORY MAPPING FOR FreeBSD * * $HopeName: MMsrc!vmli.c(trunk.7) $ * Copyright (C) 2000 Harlequin Limited. All rights reserved. * - * .purpose: This is the implementation of the virtual memory mapping - * interface (vm.h) for Linux. It was created by copying vmo1.c (the + * .purpose: This is the implementation of the virtual memory mapping + * interface (vm.h) for FreeBSD. It was created by copying vmli.c (the * DIGITAL UNIX implementation) as that seemed to be closest. * - * .design: See design.mps.vm. .design.linux: mmap(2) is used to + * .design: See design.mps.vm. .design.freebsd: mmap(2) is used to * reserve address space by creating a mapping with page access none. * mmap(2) is used to map pages onto store by creating a copy-on-write - * (MAP_PRIVATE) mapping with the flag MAP_ANONYMOUS. + * (MAP_PRIVATE) mapping with the flag MAP_ANON. * * .assume.not-last: The implementation of VMCreate assumes that * mmap() will not choose a region which contains the last page @@ -31,31 +31,24 @@ * seem to be a problem. */ -/* Use all extensions */ -#define _GNU_SOURCE 1 - -/* for open(2) */ -#include -#include -#include - /* for mmap(2), munmap(2) */ +#include #include /* for errno(2) */ #include -/* for sysconf(2), close(2) */ +/* for getpagesize(3) */ #include #include "mpm.h" -#ifndef MPS_OS_LI -#error "vmli.c is LINUX specific, but MPS_OS_LI is not set" +#ifndef MPS_OS_FR +#error "vmfr.c is FreeBSD specific, but MPS_OS_FR is not set" #endif -SRCID(vmli, "$HopeName: MMsrc!vmli.c(trunk.7) $"); +SRCID(vmfr, "$HopeName: MMsrc!vmli.c(trunk.7) $"); /* VMStruct -- virtual memory structure */ @@ -101,20 +94,19 @@ Res VMCreate(VM *vmReturn, Size size) { Align align; VM vm; - long pagesize; + int pagesize; void *addr; Res res; AVER(vmReturn != NULL); - /* sysconf code copied wholesale from vmso.c */ /* Find out the page size from the OS */ - pagesize = sysconf(_SC_PAGESIZE); + pagesize = getpagesize(); /* check the actual returned pagesize will fit in an object of */ /* type Align. */ AVER(pagesize > 0); AVER((unsigned long)pagesize <= (unsigned long)(Align)-1); - /* Note implicit conversion from "long" to "Align". */ + /* Note implicit conversion from "int" to "Align". */ align = pagesize; AVER(SizeIsP2(align)); size = SizeAlignUp(size, align); From b8b4cd53fd392b665ffdd4fe4776f306c90962b2 Mon Sep 17 00:00:00 2001 From: Nick Barnes Date: Mon, 29 Oct 2001 14:51:01 +0000 Subject: [PATCH 06/10] Freebsd locking for mps. Copied from Perforce Change: 23624 ServerID: perforce.ravenbrook.com --- mps/src/lockfr.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/mps/src/lockfr.c b/mps/src/lockfr.c index e6d1041912d..454d6e9efb4 100644 --- a/mps/src/lockfr.c +++ b/mps/src/lockfr.c @@ -34,11 +34,7 @@ #error "lockfr.c is FreeBSD specific but MPS_OS_FR not defined" #endif -SRCID(lockli, "$HopeName$"); - - -#define LockAttrSetRecursive(attrptr) \ - pthread_mutexattr_settype(attrptr, PTHREAD_MUTEX_ERRORCHECK) +SRCID(lockfr, "$HopeName$"); /* LockStruct -- the MPS lock structure @@ -83,7 +79,7 @@ void LockInit(Lock lock) lock->claims = 0; res = pthread_mutexattr_init(&attr); AVER(res == 0); - res = LockAttrSetRecursive(&attr); + res = pthread_mutexattr_settype(attrptr, PTHREAD_MUTEX_ERRORCHECK); AVER(res == 0); res = pthread_mutex_init(&lock->mut, &attr); AVER(res == 0); From 1608bcdc852a5560a48b2a617d4a71bd4a543ba7 Mon Sep 17 00:00:00 2001 From: Nick Barnes Date: Tue, 30 Oct 2001 16:51:46 +0000 Subject: [PATCH 07/10] Mps now appears to work on freebsd. Copied from Perforce Change: 23651 ServerID: perforce.ravenbrook.com --- mps/src/eventcnv.c | 23 +++--- mps/src/eventpro.c | 21 +++--- mps/src/lockfr.c | 2 +- mps/src/protfr.c | 1 + mps/src/protfri3.c | 13 ++-- mps/src/pthrdext.c | 171 ++++++++++++++++++++++++++++----------------- mps/src/pthrdext.h | 4 +- mps/src/ssfri3.c | 6 +- mps/src/thfri4.c | 26 +++---- mps/src/thlii4.c | 14 ++-- mps/src/vmfr.c | 14 ++-- 11 files changed, 169 insertions(+), 126 deletions(-) diff --git a/mps/src/eventcnv.c b/mps/src/eventcnv.c index 5d13c00de63..fd17d442702 100644 --- a/mps/src/eventcnv.c +++ b/mps/src/eventcnv.c @@ -125,12 +125,12 @@ static char *parseArgs(int argc, char *argv[]) { char *name = "mpsio.log"; int i = 1; - + if (argc >= 1) prog = argv[0]; else prog = "unknown"; - + while (i < argc) { /* consider argument i */ if (argv[i][0] == '-') { /* it's an option argument */ switch (argv[i][1]) { @@ -138,9 +138,9 @@ static char *parseArgs(int argc, char *argv[]) ++ i; if (i == argc) usageError(); - else + else name = argv[i]; - break; + break; case 'p': /* partial log */ partialLog = TRUE; break; @@ -154,7 +154,7 @@ static char *parseArgs(int argc, char *argv[]) usageError(); else parseEventSpec(argv[i]); - } break; + } break; case 'b': { /* bucket size */ ++ i; if (i == argc) @@ -165,7 +165,7 @@ static char *parseArgs(int argc, char *argv[]) n = sscanf(argv[i], "%lu", &bucketSize); if (n != 1) usageError(); } - } break; + } break; case 'S': /* style */ style = argv[i][2]; /* '\0' for human-readable, 'L' for Lisp, */ break; /* 'C' for CDF. */ @@ -192,7 +192,7 @@ static void processEvent(EventProc proc, Event event, Word etime) if (res != ResOK) error("Can't record event: error %d.", res); switch(event->any.code) { - default: + default: break; } } @@ -246,7 +246,7 @@ static void reportEventResults(eventCountArray eventCounts) { EventCode i; unsigned long total = 0; - + for(i = 0; i <= EventCodeMAX; ++i) { total += eventCounts[i]; if (eventEnabled[i]) @@ -441,7 +441,7 @@ static void readLog(EventProc proc) printf("%u", (unsigned)code); break; } - + switch (style) { case '\0': printf(" %8lu", (ulong)eventTime); break; @@ -591,11 +591,16 @@ int main(int argc, char *argv[]) EventProc proc; Res res; +#if !defined(MPS_OS_FR) + /* GCC -ansi -pedantic -Werror on FreeBSD will fail here + * with the warning "statement with no effect". */ + assert(CHECKCONV(ulong, Word)); assert(CHECKCONV(ulong, Addr)); assert(CHECKCONV(ulong, void *)); assert(CHECKCONV(unsigned, EventCode)); assert(CHECKCONV(Addr, void *)); /* for labelled pointers */ +#endif filename = parseArgs(argc, argv); diff --git a/mps/src/eventpro.c b/mps/src/eventpro.c index 9cb8700fe8d..dae0aecf1c9 100644 --- a/mps/src/eventpro.c +++ b/mps/src/eventpro.c @@ -19,7 +19,6 @@ #include /* size_t */ #include /* strcmp */ - struct EventProcStruct { Bool partialLog; /* Is this a partial log? */ EventProcReader reader; /* reader fn */ @@ -91,7 +90,7 @@ static eventRecord eventTypes[] = { static size_t eventType2Index(EventType type) { size_t i; - + for(i = 0; i < eventTypeCount; ++i) if (eventTypes[i].type == type) return i; @@ -105,7 +104,7 @@ static size_t eventType2Index(EventType type) static size_t eventCode2Index(EventCode code, Bool errorp) { size_t i; - + for(i = 0; i < eventTypeCount; ++i) if (eventTypes[i].code == code) return i; @@ -120,7 +119,7 @@ static size_t eventCode2Index(EventCode code, Bool errorp) EventCode EventName2Code(char *name) { size_t i; - + for(i = 0; i < eventTypeCount; ++i) if (strcmp(eventTypes[i].name, name) == 0) { assert(eventTypes[i].code <= EventCodeMAX); @@ -250,7 +249,7 @@ EventString LabelText(EventProc proc, Word id) Res EventRead(Event *eventReturn, EventProc proc) { - size_t index, length; + size_t eventIndex, length; Res res; EventType type; Event event; @@ -259,8 +258,8 @@ Res EventRead(Event *eventReturn, EventProc proc) res = proc->reader(proc->readerP, &type, sizeof(EventType)); if (res != ResOK) return res; - index = eventType2Index(type); - length = eventTypes[index].length; + eventIndex = eventType2Index(type); + length = eventTypes[eventIndex].length; if (proc->cachedEvent != NULL) { event = proc->cachedEvent; proc->cachedEvent = NULL; @@ -306,7 +305,7 @@ Res EventRecord(EventProc proc, Event event, Word etime) switch(event->any.code) { case EventIntern: { /* id, label */ Symbol sym = malloc(sizeof(symbolStruct)); - + if (sym == NULL) return ResMEMORY; sym->id = event->ws.w0; res = eventStringCopy(&(sym->name), &(event->ws.s1)); @@ -332,7 +331,7 @@ Res EventRecord(EventProc proc, Event event, Word etime) else res = TableDefine(proc->labelTable, (Word)label->addr, label); } break; - default: + default: res = ResOK; break; } @@ -386,7 +385,11 @@ Res EventProcCreate(EventProc *procReturn, Bool partial, assert(CHECKFIELD(EventUnion, any.code, EventWSStruct, code)); assert(CHECKFIELD(EventUnion, any.clock, EventWSStruct, clock)); /* check use of labelTable */ +#if !defined(MPS_OS_FR) + /* GCC -ansi -pedantic -Werror on FreeBSD will fail here + * with the warning "statement with no effect". */ assert(sizeof(Word) >= sizeof(Addr)); +#endif proc->partialLog = partial; proc->reader = reader; proc->readerP = readerP; diff --git a/mps/src/lockfr.c b/mps/src/lockfr.c index 454d6e9efb4..10030afe675 100644 --- a/mps/src/lockfr.c +++ b/mps/src/lockfr.c @@ -79,7 +79,7 @@ void LockInit(Lock lock) lock->claims = 0; res = pthread_mutexattr_init(&attr); AVER(res == 0); - res = pthread_mutexattr_settype(attrptr, PTHREAD_MUTEX_ERRORCHECK); + res = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK); AVER(res == 0); res = pthread_mutex_init(&lock->mut, &attr); AVER(res == 0); diff --git a/mps/src/protfr.c b/mps/src/protfr.c index 403e2639344..5e0ef52665b 100644 --- a/mps/src/protfr.c +++ b/mps/src/protfr.c @@ -17,6 +17,7 @@ #include #include #include +#include #include SRCID(protfr, "$HopeName: $"); diff --git a/mps/src/protfri3.c b/mps/src/protfri3.c index 7da59b53a86..4f30a79a249 100644 --- a/mps/src/protfri3.c +++ b/mps/src/protfri3.c @@ -63,15 +63,11 @@ static struct sigaction sigNext; static void sigHandle(int sig, siginfo_t *info, void *context) /* .sigh.args */ { - ucontext_t *ucontext = (ucontext_t *)context; AVER(sig == SIGBUS); if(info->si_code == BUS_PAGE_FAULT) { /* .sigh.context */ AccessSet mode; Addr base, limit; - MutatorFaultContextStruct mfContext; - - mfContext.ucontext = ucontext; mode = AccessREAD | AccessWRITE; /* .sigh.mode */ @@ -81,7 +77,7 @@ static void sigHandle(int sig, siginfo_t *info, void *context) /* .sigh.args */ /* Offer each protection structure the opportunity to handle the */ /* exception. If it succeeds, then allow the mutator to continue. */ - if(ArenaAccess(base, mode, &mfContext)) + if(ArenaAccess(base, mode, NULL)) return; } @@ -104,8 +100,11 @@ static void sigHandle(int sig, siginfo_t *info, void *context) /* .sigh.args */ (*sigNext.sa_sigaction)(sig, info, context); } else { /* @@@@ what if the previous handler is BSD-style? */ - /* We don't have a struct sigcontext to pass to it. */ - (*sigNext.sa_handler)(sig, info->si_code); + /* We don't have a struct sigcontext to pass to it. + The second argument (the code) is just info->si_code + but the third argument (the sigcontext) we would have to + fake from the ucontext. We could do that. */ + (*sigNext.sa_handler)(sig); } break; } diff --git a/mps/src/pthrdext.c b/mps/src/pthrdext.c index 2651e06db36..1d58dfb86e1 100644 --- a/mps/src/pthrdext.c +++ b/mps/src/pthrdext.c @@ -13,9 +13,11 @@ */ +#ifdef MPS_OS_LI /* open sesame magic */ #define _BSD_SOURCE 1 #define _POSIX_C_SOURCE 1 +#endif #include #include @@ -37,7 +39,7 @@ SRCID(pthreadext, "$HopeName$"); */ #define PTHREADEXT_SIGSUSPEND SIGXFSZ -#define PTHREADEXT_SIGRESUME SIGPWR +#define PTHREADEXT_SIGRESUME SIGXCPU /* Static data initiatialized on first use of the module @@ -63,9 +65,89 @@ static PThreadext suspendingVictim = NULL; /* current victim */ static RingStruct suspendedRing; /* PThreadext suspend ring */ -static void suspendSignalHandler(int sig, struct sigcontext scp); -static void resumeSignalHandler(int sig); +/* suspendSignalHandler -- signal handler called when suspending a thread + * + * See design.mps.pthreadext.impl.suspend-handler + * + * The interface for determining the MFC might be platform specific. + * + * Handle PTHREADEXT_SIGSUSPEND in the target thread, to suspend it until + * receiving PTHREADEXT_SIGRESUME (resume). Note that this is run with both + * PTHREADEXT_SIGSUSPEND and PTHREADEXT_SIGRESUME blocked. Having + * PTHREADEXT_SIGRESUME blocked prevents a resume before we can finish the + * suspend protocol. + */ +#if defined(MPS_OS_LI) + +#include "prmcli.h" + +static void suspendSignalHandler(int sig, struct sigcontext scp) +{ + sigset_t signal_set; + MutatorFaultContextStruct mfContext; + + AVER(sig == PTHREADEXT_SIGSUSPEND); + UNUSED(sig); + + AVER(suspendingVictim != NULL); + mfContext.scp = &scp; + suspendingVictim->suspendedMFC = &mfContext; + /* Block all signals except PTHREADEXT_SIGRESUME while suspended. */ + sigfillset(&signal_set); + sigdelset(&signal_set, PTHREADEXT_SIGRESUME); + sem_post(&pthreadextSem); + sigsuspend(&signal_set); + + /* Once here, the resume signal handler has run to completion. */ + return; +} + +#elif defined(MPS_OS_FR) + +#include "prmcfr.h" + +static void suspendSignalHandler(int sig, + siginfo_t *info, + void *context) +{ + sigset_t signal_set; + ucontext_t ucontext; + MutatorFaultContextStruct mfContext; + + AVER(sig == PTHREADEXT_SIGSUSPEND); + UNUSED(sig); + + AVER(suspendingVictim != NULL); + /* copy the ucontext structure so we definitely have it on our stack, + * not (e.g.) shared with other threads. */ + ucontext = *(ucontext_t *)context; + mfContext.ucontext = &ucontext; + suspendingVictim->suspendedMFC = &mfContext; + /* Block all signals except PTHREADEXT_SIGRESUME while suspended. */ + sigfillset(&signal_set); + sigdelset(&signal_set, PTHREADEXT_SIGRESUME); + sem_post(&pthreadextSem); + sigsuspend(&signal_set); + + /* Once here, the resume signal handler has run to completion. */ + return; +} + +#endif + + +/* resumeSignalHandler -- signal handler called when resuming a thread + * + * See design.mps.pthreadext.impl.suspend-handler + */ + +static void resumeSignalHandler(int sig) +{ + AVER(sig == PTHREADEXT_SIGRESUME); + UNUSED(sig); + return; +} /* PThreadextModuleInit -- Initialize the PThreadext module * @@ -96,13 +178,20 @@ static void PThreadextModuleInit(void) /* PTHREADEXT_SIGRESUME signal cannot be delivered before the */ /* target thread calls sigsuspend.) */ - pthreadext_sigsuspend.sa_flags = 0; - pthreadext_sigsuspend.sa_handler = (__sighandler_t)suspendSignalHandler; status = sigemptyset(&pthreadext_sigsuspend.sa_mask); AVER(status == 0); status = sigaddset(&pthreadext_sigsuspend.sa_mask, PTHREADEXT_SIGRESUME); AVER(status == 0); +#if defined(MPS_OS_LI) + pthreadext_sigsuspend.sa_flags = 0; + pthreadext_sigsuspend.sa_handler = (__sighandler_t)suspendSignalHandler; + +#elif defined(MPS_OS_FR) + pthreadext_sigsuspend.sa_flags = SA_SIGINFO; + pthreadext_sigsuspend.sa_sigaction = suspendSignalHandler; +#endif + pthreadext_sigresume.sa_flags = 0; pthreadext_sigresume.sa_handler = resumeSignalHandler; status = sigemptyset(&pthreadext_sigresume.sa_mask); @@ -131,7 +220,7 @@ extern Bool PThreadextCheck(PThreadext pthreadext) /* can't check ID */ CHECKL(RingCheck(&pthreadext->threadRing)); CHECKL(RingCheck(&pthreadext->idRing)); - if (pthreadext->suspendedScp == NULL) { + if (pthreadext->suspendedMFC == NULL) { /* not suspended */ CHECKL(RingIsSingle(&pthreadext->threadRing)); CHECKL(RingIsSingle(&pthreadext->idRing)); @@ -142,7 +231,7 @@ extern Bool PThreadextCheck(PThreadext pthreadext) RING_FOR(node, &pthreadext->idRing, next) { PThreadext pt = RING_ELT(PThreadext, idRing, node); CHECKL(pt->id == pthreadext->id); - CHECKL(pt->suspendedScp == pthreadext->suspendedScp); + CHECKL(pt->suspendedMFC == pthreadext->suspendedMFC); } } status = pthread_mutex_unlock(&pthreadextMut); @@ -163,7 +252,7 @@ extern void PThreadextInit(PThreadext pthreadext, pthread_t id) AVER(status == 0); pthreadext->id = id; - pthreadext->suspendedScp = NULL; + pthreadext->suspendedMFC = NULL; RingInit(&pthreadext->threadRing); RingInit(&pthreadext->idRing); pthreadext->sig = PThreadextSig; @@ -185,7 +274,7 @@ extern void PThreadextFinish(PThreadext pthreadext) status = pthread_mutex_lock(&pthreadextMut); AVER(status == 0); - if(pthreadext->suspendedScp == NULL) { + if(pthreadext->suspendedMFC == NULL) { AVER(RingIsSingle(&pthreadext->threadRing)); AVER(RingIsSingle(&pthreadext->idRing)); } else { @@ -205,60 +294,12 @@ extern void PThreadextFinish(PThreadext pthreadext) } -/* suspendSignalHandler -- signal handler called when suspending a thread - * - * See design.mps.pthreadext.impl.suspend-handler - * - * The interface for determining the sigcontext might be platform specific. - * - * Handle PTHREADEXT_SIGSUSPEND in the target thread, to suspend it until - * receiving PTHREADEXT_SIGRESUME (resume). Note that this is run with both - * PTHREADEXT_SIGSUSPEND and PTHREADEXT_SIGRESUME blocked. Having - * PTHREADEXT_SIGRESUME blocked prevents a resume before we can finish the - * suspend protocol. - */ - -static void suspendSignalHandler(int sig, struct sigcontext scp) -{ - sigset_t signal_set; - - AVER(sig == PTHREADEXT_SIGSUSPEND); - UNUSED(sig); - - /* Tell caller about the sigcontext. */ - AVER(suspendingVictim != NULL); - suspendingVictim->suspendedScp = &scp; - - /* Block all signals except PTHREADEXT_SIGRESUME while suspended. */ - sigfillset(&signal_set); - sigdelset(&signal_set, PTHREADEXT_SIGRESUME); - sem_post(&pthreadextSem); - sigsuspend(&signal_set); - - /* Once here, the resume signal handler has run to completion. */ - return; -} - - -/* resumeSignalHandler -- signal handler called when resuming a thread - * - * See design.mps.pthreadext.impl.suspend-handler - */ - -static void resumeSignalHandler(int sig) -{ - AVER(sig == PTHREADEXT_SIGRESUME); - UNUSED(sig); - return; -} - - /* PThreadextSuspend -- suspend a thread * * See design.mps.pthreadext.impl.suspend */ -Res PThreadextSuspend(PThreadext target, struct sigcontext **contextReturn) +Res PThreadextSuspend(PThreadext target, MutatorFaultContext *contextReturn) { Ring node, next; Res res; @@ -266,7 +307,7 @@ Res PThreadextSuspend(PThreadext target, struct sigcontext **contextReturn) AVERT(PThreadext, target); AVER(contextReturn != NULL); - AVER(target->suspendedScp == NULL); /* multiple suspends illegal */ + AVER(target->suspendedMFC == NULL); /* multiple suspends illegal */ /* Serialize access to suspend, makes life easier */ status = pthread_mutex_lock(&pthreadextMut); @@ -280,7 +321,7 @@ Res PThreadextSuspend(PThreadext target, struct sigcontext **contextReturn) PThreadext alreadySusp = RING_ELT(PThreadext, threadRing, node); if (alreadySusp->id == target->id) { RingAppend(&alreadySusp->idRing, &target->idRing); - target->suspendedScp = alreadySusp->suspendedScp; + target->suspendedMFC = alreadySusp->suspendedMFC; goto noteSuspended; } } @@ -302,9 +343,9 @@ Res PThreadextSuspend(PThreadext target, struct sigcontext **contextReturn) } noteSuspended: - AVER(target->suspendedScp != NULL); + AVER(target->suspendedMFC != NULL); RingAppend(&suspendedRing, &target->threadRing); - *contextReturn = target->suspendedScp; + *contextReturn = target->suspendedMFC; res = ResOK; unlock: @@ -316,7 +357,7 @@ unlock: /* PThreadextResume -- resume a suspended thread - * + * * See design.mps.pthreadext.impl.resume */ @@ -327,7 +368,7 @@ Res PThreadextResume(PThreadext target) AVERT(PThreadext, target); AVER(pthreadextModuleInitialized); /* must have been a prior suspend */ - AVER(target->suspendedScp != NULL); + AVER(target->suspendedMFC != NULL); /* Serialize access to suspend, makes life easier. */ status = pthread_mutex_lock(&pthreadextMut); @@ -353,7 +394,7 @@ Res PThreadextResume(PThreadext target) noteResumed: /* Remove the thread from the suspended ring */ RingRemove(&target->threadRing); - target->suspendedScp = NULL; + target->suspendedMFC = NULL; res = ResOK; unlock: diff --git a/mps/src/pthrdext.h b/mps/src/pthrdext.h index 4b32adb649b..32fec1a0c7d 100644 --- a/mps/src/pthrdext.h +++ b/mps/src/pthrdext.h @@ -32,7 +32,7 @@ typedef struct PThreadextStruct *PThreadext; typedef struct PThreadextStruct { Sig sig; /* design.mps.sig */ pthread_t id; /* Thread ID */ - struct MutatorFaultContext *suspendedMFC; /* context if suspended */ + MutatorFaultContext suspendedMFC; /* context if suspended */ RingStruct threadRing; /* ring of suspended threads */ RingStruct idRing; /* duplicate suspensions for id */ } PThreadextStruct; @@ -57,7 +57,7 @@ extern void PThreadextFinish(PThreadext pthreadext); /* PThreadextSuspend -- Suspend a pthreadext and return its context. */ extern Res PThreadextSuspend(PThreadext pthreadext, - MutatorFaultContext contextReturn); + MutatorFaultContext *contextReturn); /* PThreadextResume -- Resume a suspended pthreadext */ diff --git a/mps/src/ssfri3.c b/mps/src/ssfri3.c index 23e0f25c2a2..a887fba4ec8 100644 --- a/mps/src/ssfri3.c +++ b/mps/src/ssfri3.c @@ -1,9 +1,9 @@ -/* impl.c.sslii3: LINUX/INTEL STACK SCANNING +/* impl.c.ssfri3: FREEBSD/INTEL STACK SCANNING * * $HopeName: MMsrc!sslii3.c(trunk.1) $ * Copyright (C) 1999. Harlequin Group plc. All rights reserved. * - * This scans the stack and fixes the registers which may contain + * This scans the stack and fixes the registers which may contain * roots. See design.mps.thread-manager * * The registers edi, esi, ebx are the registers defined to be preserved @@ -32,7 +32,7 @@ #include "mpm.h" -SRCID(sslii3, "$HopeName: MMsrc!sslii3.c(trunk.1) $"); +SRCID(ssfri3, "$HopeName: MMsrc!sslii3.c(trunk.1) $"); /* .assume.asm.order */ #define ASMV(x) __asm__ volatile (x) diff --git a/mps/src/thfri4.c b/mps/src/thfri4.c index 2d25100fc7a..fa792eb69eb 100644 --- a/mps/src/thfri4.c +++ b/mps/src/thfri4.c @@ -58,7 +58,7 @@ typedef struct ThreadStruct { /* PThreads thread structure */ RingStruct arenaRing; /* threads attached to arena */ PThreadextStruct thrextStruct; /* PThreads extension */ pthread_t id; /* Pthread object of thread */ - MutatorFaultContextStruct mfc; /* Context if thread is suspended */ + MutatorFaultContext mfc; /* Context if thread is suspended */ } ThreadStruct; @@ -106,7 +106,7 @@ Res ThreadRegister(Thread *threadReturn, Arena arena) thread->serial = arena->threadSerial; ++arena->threadSerial; thread->arena = arena; - thread->scpSusp = NULL; + thread->mfc = NULL; PThreadextInit(&thread->thrextStruct, thread->id); @@ -169,9 +169,9 @@ static void threadSuspend(Thread thread) /* assume the thread has been destroyed. */ /* In which case we simply continue. */ Res res; - res = PThreadextSuspend(&thread->thrextStruct, &thread->scpSusp); + res = PThreadextSuspend(&thread->thrextStruct, &thread->mfc); if(res != ResOK) - thread->scpSusp = NULL; + thread->mfc = NULL; } @@ -188,13 +188,13 @@ void ThreadRingSuspend(Ring threadRing) static void threadResume(Thread thread) { /* .error.resume */ - /* If the previous suspend failed (thread->scpSusp == NULL), */ + /* If the previous suspend failed (thread->mfc == NULL), */ /* or in the error case (PThreadextResume returning ResFAIL), */ /* assume the thread has been destroyed. */ /* In which case we simply continue. */ - if(thread->scpSusp != NULL) { + if(thread->mfc != NULL) { (void)PThreadextResume(&thread->thrextStruct); - thread->scpSusp = NULL; + thread->mfc = NULL; } } @@ -243,18 +243,18 @@ Res ThreadScan(ScanState ss, Thread thread, void *stackBot) if(res != ResOK) return res; } else { - struct sigcontext *scp; + MutatorFaultContext mfc; Addr *stackBase, *stackLimit, stackPtr; - scp = thread->scpSusp; - if(scp == NULL) { + mfc = thread->mfc; + if(mfc == NULL) { /* .error.suspend */ /* We assume that the thread must have been destroyed. */ /* We ignore the situation by returning immediately. */ return ResOK; } - stackPtr = (Addr)scp->esp; /* .i3.sp */ + stackPtr = (Addr)mfc->ucontext->uc_mcontext.mc_esp; /* .i3.sp */ /* .stack.align */ stackBase = (Addr *)AddrAlignUp(stackPtr, sizeof(Addr)); stackLimit = (Addr *)stackBot; @@ -273,8 +273,8 @@ Res ThreadScan(ScanState ss, Thread thread, void *stackBot) * unecessarily scans the rest of the context. The optimisation * to scan only relevent parts would be machine dependent. */ - res = TraceScanAreaTagged(ss, (Addr *)scp, - (Addr *)((char *)scp + sizeof(*scp))); + res = TraceScanAreaTagged(ss, (Addr *)mfc->ucontext, + (Addr *)((char *)mfc->ucontext + sizeof(*(mfc->ucontext)))); if(res != ResOK) return res; } diff --git a/mps/src/thlii4.c b/mps/src/thlii4.c index c31a690c8af..f4384d611fe 100644 --- a/mps/src/thlii4.c +++ b/mps/src/thlii4.c @@ -58,7 +58,7 @@ typedef struct ThreadStruct { /* PThreads thread structure */ RingStruct arenaRing; /* threads attached to arena */ PThreadextStruct thrextStruct; /* PThreads extension */ pthread_t id; /* Pthread object of thread */ - MutatorFaultContextStruct mfc; /* Context if thread is suspended */ + MutatorFaultContext mfc; /* Context if thread is suspended */ } ThreadStruct; @@ -106,7 +106,7 @@ Res ThreadRegister(Thread *threadReturn, Arena arena) thread->serial = arena->threadSerial; ++arena->threadSerial; thread->arena = arena; - thread->mfc.scp = NULL; + thread->mfc = NULL; PThreadextInit(&thread->thrextStruct, thread->id); @@ -171,7 +171,7 @@ static void threadSuspend(Thread thread) Res res; res = PThreadextSuspend(&thread->thrextStruct, &thread->mfc); if(res != ResOK) - thread->mfc.scp = NULL; + thread->mfc = NULL; } @@ -188,13 +188,13 @@ void ThreadRingSuspend(Ring threadRing) static void threadResume(Thread thread) { /* .error.resume */ - /* If the previous suspend failed (thread->mfc.scp == NULL), */ + /* If the previous suspend failed (thread->mfc == NULL), */ /* or in the error case (PThreadextResume returning ResFAIL), */ /* assume the thread has been destroyed. */ /* In which case we simply continue. */ - if(thread->mfc.scp != NULL) { + if(thread->mfc != NULL) { (void)PThreadextResume(&thread->thrextStruct); - thread->mfc.scp = NULL; + thread->mfc = NULL; } } @@ -246,7 +246,7 @@ Res ThreadScan(ScanState ss, Thread thread, void *stackBot) struct sigcontext *scp; Addr *stackBase, *stackLimit, stackPtr; - scp = thread->mfc.scp; + scp = thread->mfc->scp; if(scp == NULL) { /* .error.suspend */ /* We assume that the thread must have been destroyed. */ diff --git a/mps/src/vmfr.c b/mps/src/vmfr.c index 122f2703760..5c3b8bea774 100644 --- a/mps/src/vmfr.c +++ b/mps/src/vmfr.c @@ -21,11 +21,6 @@ * get from mmap. The others are either caused by invalid params * or features we don't use. See mmap(2) for details. * - * .assume.off_t: We assume that the Size type (defined by the MM) fits - * in the off_t type (define by the system (POSIX?)). In fact we test - * the more stringent requirement that they are the same size. This - * assumption is made in VMUnmap. - * * .remap: Possibly this should use mremap to reduce the number of * distinct mappings. According to our current testing, it doesn't * seem to be a problem. @@ -116,7 +111,7 @@ Res VMCreate(VM *vmReturn, Size size) /* Map in a page to store the descriptor on. */ addr = mmap(0, (size_t)SizeAlignUp(sizeof(VMStruct), align), PROT_READ | PROT_WRITE, - MAP_ANONYMOUS | MAP_PRIVATE, + MAP_ANON | MAP_PRIVATE, -1, 0); if(addr == MAP_FAILED) { int e = errno; @@ -129,7 +124,7 @@ Res VMCreate(VM *vmReturn, Size size) /* See .assume.not-last. */ addr = mmap(0, (size_t)size, - PROT_NONE, MAP_ANONYMOUS | MAP_PRIVATE, + PROT_NONE, MAP_ANON | MAP_PRIVATE, -1, 0); if(addr == MAP_FAILED) { int e = errno; @@ -241,7 +236,7 @@ Res VMMap(VM vm, Addr base, Addr limit) if(mmap((void *)base, (size_t)size, PROT_READ | PROT_WRITE | PROT_EXEC, - MAP_ANONYMOUS | MAP_PRIVATE | MAP_FIXED, + MAP_ANON | MAP_PRIVATE | MAP_FIXED, -1, 0) == MAP_FAILED) { AVER(errno == ENOMEM); /* .assume.mmap.err */ @@ -268,13 +263,12 @@ void VMUnmap(VM vm, Addr base, Addr limit) AVER(limit <= vm->limit); AVER(AddrIsAligned(base, vm->align)); AVER(AddrIsAligned(limit, vm->align)); - AVER(sizeof(off_t) == sizeof(Size)); /* .assume.off_t */ size = AddrOffset(base, limit); /* see design.mps.vmo1.fun.unmap.offset */ addr = mmap((void *)base, (size_t)size, - PROT_NONE, MAP_ANONYMOUS | MAP_PRIVATE | MAP_FIXED, + PROT_NONE, MAP_ANON | MAP_PRIVATE | MAP_FIXED, -1, 0); AVER(addr == (void *)base); From 07665d5d3bc36481c3ffc7900a4a8832ed260884 Mon Sep 17 00:00:00 2001 From: Nick Barnes Date: Tue, 30 Oct 2001 17:13:15 +0000 Subject: [PATCH 08/10] Some comments still referred to linux. Copied from Perforce Change: 23652 ServerID: perforce.ravenbrook.com --- mps/src/prmcfr.h | 2 +- mps/src/vmfr.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mps/src/prmcfr.h b/mps/src/prmcfr.h index 53d3fb75d4d..85c6ba0c14c 100644 --- a/mps/src/prmcfr.h +++ b/mps/src/prmcfr.h @@ -1,4 +1,4 @@ -/* impl.h.prmcli: PROTECTION MUTATOR CONTEXT (FreeBSD) +/* impl.h.prmcfr: PROTECTION MUTATOR CONTEXT (FREEBSD) * * $HopeName: $ * Copyright (C) 1998 The Harlequin Group Limited. All rights reserved. diff --git a/mps/src/vmfr.c b/mps/src/vmfr.c index 5c3b8bea774..ca0c9edda27 100644 --- a/mps/src/vmfr.c +++ b/mps/src/vmfr.c @@ -1,4 +1,4 @@ -/* impl.c.vmli: VIRTUAL MEMORY MAPPING FOR FreeBSD +/* impl.c.vmfr: VIRTUAL MEMORY MAPPING FOR FreeBSD * * $HopeName: MMsrc!vmli.c(trunk.7) $ * Copyright (C) 2000 Harlequin Limited. All rights reserved. From 97c2eb376fb90f732c61124763a4d07c20f37ed7 Mon Sep 17 00:00:00 2001 From: Nick Barnes Date: Wed, 31 Oct 2001 12:53:11 +0000 Subject: [PATCH 09/10] Need pthread header on freebsd as well as linux. Copied from Perforce Change: 23674 ServerID: perforce.ravenbrook.com --- mps/src/awlutth.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mps/src/awlutth.c b/mps/src/awlutth.c index cecdc77bfbc..8e317d6c0ae 100644 --- a/mps/src/awlutth.c +++ b/mps/src/awlutth.c @@ -19,7 +19,7 @@ #include "mpsw3.h" #endif #include -#ifdef MPS_OS_LI +#if defined(MPS_OS_LI) || defined(MPS_OS_FR) #include #endif @@ -274,7 +274,7 @@ static void *setup(void *v, size_t s) "Weak AP Create\n"); die(mps_ap_create(&bogusap, tablepool, MPS_RANK_EXACT), "Bogus AP Create\n"); - + test(leafap, exactap, weakap, bogusap); mps_ap_destroy(bogusap); From 07c9fb51e485c5eed1619ba244e7e45f3457a69b Mon Sep 17 00:00:00 2001 From: Nick Barnes Date: Wed, 31 Oct 2001 13:47:36 +0000 Subject: [PATCH 10/10] This open-sesame magic is linux-specific. Copied from Perforce Change: 23676 ServerID: perforce.ravenbrook.com --- mps/src/pthrdext.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mps/src/pthrdext.c b/mps/src/pthrdext.c index 1d58dfb86e1..3ba128d44b5 100644 --- a/mps/src/pthrdext.c +++ b/mps/src/pthrdext.c @@ -13,7 +13,9 @@ */ -#ifdef MPS_OS_LI +#include "mpm.h" + +#if defined(MPS_OS_LI) /* open sesame magic */ #define _BSD_SOURCE 1 #define _POSIX_C_SOURCE 1 @@ -28,7 +30,6 @@ #include #include "pthrdext.h" -#include "mpm.h" SRCID(pthreadext, "$HopeName$");