public class mainer { public static final int single NUM_ITERS = 100000; public static final int single NUM_REGIONS = 500; public static void main(String[]args) { if (Ti.thisProc() == 0) System.out.println("test1"); test(); if (Ti.thisProc() == 0) System.out.println("test2"); test2(0); test(); if (Ti.thisProc() == 0) System.out.println("done."); } public static single void test() { for (int single i=0; i <= NUM_ITERS; i++) { doit(); if (Ti.thisProc() == 0 && i % 500 == 0) System.out.println(i); } } public static single void doit() { SharedRegion single sr = new SharedRegion(); PrivateRegion r = new PrivateRegion(); { Object o1 = new (sr) Object(); Object o2 = new (r) Object(); } try { sr.delete(); r.delete(); } catch (Throwable exn) { System.out.println("error: got an exn"); } } public static single void test2(int single count) { if (count == NUM_REGIONS) { test(); return; } SharedRegion single sr = new SharedRegion(); PrivateRegion pr = new PrivateRegion(); for (int x = 0; x < 100; x++) { Object o1 = new (sr) Object(); Object o2 = new (pr) Object(); } test2(count + 1); try { sr.delete(); pr.delete(); } catch (Throwable exn) { System.out.println("error: got an exn"); } } }