FreeListManager { int getLargestSlabSize() { return this.slabs[0].getSize(); } FreeListManager(MemoryAllocatorImpl ma, final Slab[] slabs); long getUsedMemory(); long getFreeMemory(); @SuppressWarnings("synthetic-access") OffHeapStoredObject allocate(int size); @SuppressWarnings("synthetic-access") void free(long addr); static final int TINY_MULTIPLE; static final int TINY_FREE_LIST_COUNT; static final int HUGE_MULTIPLE; static final int MAX_TINY; }
@Test public void firstSlabAlwaysLargest() { this.freeListManager = createFreeListManager(ma, new Slab[] {new SlabImpl(10), new SlabImpl(100)}); assertThat(this.freeListManager.getLargestSlabSize()).isEqualTo(10); }