Class ArrayPool

    • Constructor Detail

      • ArrayPool

        public ArrayPool()
    • Method Detail

      • get

        public TArray get()
        Description copied from interface: IElementPool
        Retrieves an element in the current pool
        Specified by:
        get in interface IElementPool<TArray>
        Returns:
        an element in the pool
      • repay

        public void repay​(TArray element)
        Description copied from interface: IElementPool
        When you finished using an element, repay (free) it for the reusing
        Specified by:
        repay in interface IElementPool<TArray>
        Parameters:
        element - the finished using element
      • cleanup

        public void cleanup()
        Description copied from interface: IElementPool
        Clean up, after that all arrays will be set to null
        Specified by:
        cleanup in interface IElementPool<TArray>
      • getPoolSize

        public int getPoolSize()
        Description copied from interface: IElementPool
        Retrieves the pool size
        Specified by:
        getPoolSize in interface IElementPool<TArray>
        Returns:
        the total number of element or -1 if any exceptions caused