private FixedAllocator findAllocator(final int block){
  if (block > cSmallSlot) {
    return null;
  }
  final Bucket stats=m_storageStats.findBucket(block);
  if (stats == null) {
    return null;
  }
  if (stats.m_allocators < cSmallSlotWasteCheckAllocators) {
    return null;
  }
  final float slotWaste=stats.slotsUnused();
  if (slotWaste < cSmallSlotHighWaste) {
    return null;
  }
  FixedAllocator candidate=null;
  int candidateFreeBits=cSmallSlotThresholdHighWaste;
  for (int i=0; i < m_allocs.size(); i++) {
    final FixedAllocator tst=m_allocs.get(i);
    if (tst.getBlockSize() == block) {
      if (tst.m_freeBits > candidateFreeBits) {
        candidate=tst;
        candidateFreeBits=candidate.m_freeBits;
      }
    }
  }
  if (candidate != null) {
    candidate.m_smallSlotHighWaste=true;
    if (log.isDebugEnabled()) {
      log.debug("Found candidate small slot allocator");
    }
  }
  return candidate;
}

private FixedAllocator findAllocator ( final int block ) { if ( block > cSmallSlot ) { return null ; } final Bucket stats = m_storageStats . findBucket ( block ) ; if ( stats == null ) { return null ; } if ( stats . m_allocators < cSmallSlotWasteCheckAllocators ) { return null ; } final float slotWaste = stats . slotsUnused ( ) ; if ( slotWaste < cSmallSlotHighWaste ) { return null ; } FixedAllocator candidate = null ; int candidateFreeBits = cSmallSlotThresholdHighWaste ; for ( int i = 0 ; i < m_allocs . size ( ) ; i ++ ) { final FixedAllocator tst = m_allocs . get ( i ) ; if ( tst . getBlockSize ( ) == block ) { if ( tst . m_freeBits > candidateFreeBits ) { candidate = tst ; candidateFreeBits = candidate . m_freeBits ; } } } if ( candidate != null ) { candidate . m_smallSlotHighWaste = true ; if ( log . isDebugEnabled ( ) ) { log . debug ( "Found candidate small slot allocator" ) ; } } return candidate ; }
for a small slot size only , look for an existing allocator that has a sufficient percentage of free bits and add it to the free list . if this test fails then the caller must allocate a new allocator .
