com.sun.grizzly.memory.slab
Class SlabMemoryManagerImpl

java.lang.Object
  extended by com.sun.grizzly.memory.ByteBufferManager
      extended by com.sun.grizzly.memory.slab.SlabMemoryManagerBase
          extended by com.sun.grizzly.memory.slab.SlabMemoryManagerImpl
All Implemented Interfaces:
MemoryManager<ByteBufferWrapper>, WrapperAware<ByteBufferWrapper>

public class SlabMemoryManagerImpl
extends SlabMemoryManagerBase

A simple non-pooled implementation of an Allocator. It creates a Slab whenever the current Slab is exhausted, and relies on the garbage collector to recover the space. Generally this should only be used with BufferType HEAP.

Author:
Ken Cavanaugh

Field Summary
 
Fields inherited from class com.sun.grizzly.memory.ByteBufferManager
isDirect
 
Constructor Summary
SlabMemoryManagerImpl(int maxAllocationSize, boolean bufferType)
           
 
Method Summary
 boolean bufferType()
           
 void dispose(Slab slab, ByteBuffer store)
           
 int maxAllocationSize()
          Returns the maximum size that can be allocated by an allocate( int ) call.
 
Methods inherited from class com.sun.grizzly.memory.slab.SlabMemoryManagerBase
allocate, allocate, reallocate, release
 
Methods inherited from class com.sun.grizzly.memory.ByteBufferManager
allocate0, isDirect, setDirect, wrap, wrap, wrap, wrap, wrap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SlabMemoryManagerImpl

public SlabMemoryManagerImpl(int maxAllocationSize,
                             boolean bufferType)
Method Detail

maxAllocationSize

public int maxAllocationSize()
Description copied from class: SlabMemoryManagerBase
Returns the maximum size that can be allocated by an allocate( int ) call.

Specified by:
maxAllocationSize in class SlabMemoryManagerBase

bufferType

public boolean bufferType()

dispose

public void dispose(Slab slab,
                    ByteBuffer store)
Specified by:
dispose in class SlabMemoryManagerBase


Copyright © 2009 SUN Microsystems. All Rights Reserved.