Beispiel #1
0
        /// <summary>
        /// Add <see cref="PoolChunk{T}"/> and <paramref name="handle"/> to the cache if there is enough room.
        /// </summary>
        /// <returns><c>true</c> if it fit into the cache <c>false</c> otherwise.</returns>
        internal bool Add(PoolArena <T> area, PoolChunk <T> chunk, long handle, int normCapacity, SizeClass sizeClass)
        {
            MemoryRegionCache cache = Cache(area, normCapacity, sizeClass);

            if (cache is null)
            {
                return(false);
            }
            return(cache.Add(chunk, handle));
        }
Beispiel #2
0
        ///
        // Add {@link PoolChunk} and {@code handle} to the cache if there is enough room.
        // Returns {@code true} if it fit into the cache {@code false} otherwise.
        //
        internal bool Add(PoolArena <T> area, PoolChunk <T> chunk, long handle, int normCapacity, SizeClass sizeClass)
        {
            MemoryRegionCache c = this.Cache(normCapacity, sizeClass);

            return(c != null && c.Add(chunk, handle));
        }