Interface ChunkPool

All Known Implementing Classes:
ObjectChunkSoftPool

public interface ChunkPool
Interface for pools of Chunks.
  • Method Details

    • takeWritableChunk

      <ATTR extends Any> WritableChunk<ATTR> takeWritableChunk(int capacity)
      Take a WritableChunk of at least the specified capacity. The result belongs to the caller until released.
      Parameters:
      capacity - The minimum capacity for the result
      Returns:
      A WritableChunk of at least the specified capacity that belongs to the caller until released
    • giveWritableChunk

      <ATTR extends Any> void giveWritableChunk(@NotNull @NotNull WritableChunk<ATTR> writableChunk)
      Return a WritableChunk to the pool.
      Parameters:
      writableChunk - The chunk to give
    • takeResettableChunk

      <ATTR extends Any> ResettableReadOnlyChunk<ATTR> takeResettableChunk()
      Take a ResettableReadOnlyChunk. The result belongs to the caller until released.
      Returns:
      A ResettableReadOnlyChunk that belongs to the caller until released
    • giveResettableChunk

      <ATTR extends Any> void giveResettableChunk(@NotNull @NotNull ResettableReadOnlyChunk<ATTR> resettableChunk)
      Return a ResettableReadOnlyChunk of to the pool.
      Parameters:
      resettableChunk - The chunk to give
    • takeResettableWritableChunk

      <ATTR extends Any> ResettableWritableChunk<ATTR> takeResettableWritableChunk()
      Take a ResettableWritableChunk. The result belongs to the caller until released.
      Returns:
      A ResettableWritableChunk that belongs to the caller until released
    • giveResettableWritableChunk

      <ATTR extends Any> void giveResettableWritableChunk(@NotNull @NotNull ResettableWritableChunk<ATTR> resettableWritableChunk)
      Return a ResettableWritableChunk of to the pool.
      Parameters:
      resettableWritableChunk - The chunk to give