Search in sources :

Example 1 with MMTkThread

use of org.mmtk.harness.scheduler.MMTkThread in project JikesRVM by JikesRVM.

the class FreeListTests method testSetSentinel.

@Test
public void testSetSentinel() throws Throwable {
    Thread t = new MMTkThread() {

        public void run() {
            GenericFreeList fl = createFreeList(1024, 2, 32);
            fl.setSentinel(1);
        }
    };
    runMMTkThread(t);
}
Also used : MMTkThread(org.mmtk.harness.scheduler.MMTkThread) MMTkThread(org.mmtk.harness.scheduler.MMTkThread) Test(org.junit.Test)

Example 2 with MMTkThread

use of org.mmtk.harness.scheduler.MMTkThread in project JikesRVM by JikesRVM.

the class FreeListTests method testAlloc6.

/**
 * Test coalescing across different unit sizes
 */
@Test
public void testAlloc6() throws Throwable {
    Thread t = new MMTkThread() {

        public void run() {
            GenericFreeList fl = createFreeList(4, 2, 32);
            assertEquals(0, fl.alloc(1));
            assertEquals(2, fl.alloc(2));
            assertEquals(1, fl.alloc(1));
            assertEquals(-1, fl.alloc(1));
            fl.free(0);
            fl.free(2);
            assertEquals(-1, fl.alloc(4));
            fl.free(1);
            assertEquals(0, fl.alloc(4));
        }
    };
    runMMTkThread(t);
}
Also used : MMTkThread(org.mmtk.harness.scheduler.MMTkThread) MMTkThread(org.mmtk.harness.scheduler.MMTkThread) Test(org.junit.Test)

Example 3 with MMTkThread

use of org.mmtk.harness.scheduler.MMTkThread in project JikesRVM by JikesRVM.

the class FreeListTests method testAlloc5.

/**
 * Allocate different sizes, ensuring that allocations are correctly aligned
 */
@Test
public void testAlloc5() throws Throwable {
    Thread t = new MMTkThread() {

        public void run() {
            GenericFreeList fl = createFreeList(4, 2, 1);
            assertEquals(0, fl.alloc(1));
            assertEquals(2, fl.alloc(2));
            assertEquals(1, fl.alloc(1));
            assertEquals(-1, fl.alloc(1));
        }
    };
    runMMTkThread(t);
}
Also used : MMTkThread(org.mmtk.harness.scheduler.MMTkThread) MMTkThread(org.mmtk.harness.scheduler.MMTkThread) Test(org.junit.Test)

Example 4 with MMTkThread

use of org.mmtk.harness.scheduler.MMTkThread in project JikesRVM by JikesRVM.

the class RawMemoryFreeListTest method testRawMemoryFreeListAddrAddrIntInt.

@Test
public void testRawMemoryFreeListAddrAddrIntInt() throws Throwable {
    Thread t = new MMTkThread() {

        @Override
        public void run() {
            new RawMemoryFreeList(baseAddress, mapLimit(1024, 1), 1024, 1);
        }
    };
    runMMTkThread(t);
}
Also used : MMTkThread(org.mmtk.harness.scheduler.MMTkThread) MMTkThread(org.mmtk.harness.scheduler.MMTkThread) Test(org.junit.Test)

Example 5 with MMTkThread

use of org.mmtk.harness.scheduler.MMTkThread in project JikesRVM by JikesRVM.

the class RawMemoryFreeListTest method testGenericFreeListIntIntIntLarge.

@Test
public void testGenericFreeListIntIntIntLarge() throws Throwable {
    Thread t = new MMTkThread() {

        @Override
        public void run() {
            new RawMemoryFreeList(baseAddress, mapLimit(ONE_MEG, 32), ONE_MEG, 2, 32);
        }
    };
    runMMTkThread(t);
}
Also used : MMTkThread(org.mmtk.harness.scheduler.MMTkThread) MMTkThread(org.mmtk.harness.scheduler.MMTkThread) Test(org.junit.Test)

Aggregations

MMTkThread (org.mmtk.harness.scheduler.MMTkThread)29 Test (org.junit.Test)25 BaseMMTkTest (org.mmtk.harness.tests.BaseMMTkTest)7 Address (org.vmmagic.unboxed.Address)6 ArrayList (java.util.ArrayList)1 WatchAddress (org.mmtk.harness.options.WatchAddress)1 Factory (org.mmtk.harness.vm.Factory)1 Extent (org.vmmagic.unboxed.Extent)1